From 5b7bea16c6f3444b01ddc1c8f88c3c43abc7f33d Mon Sep 17 00:00:00 2001 From: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com> Date: Mon, 22 Nov 2021 11:07:49 -0800 Subject: [PATCH] fix: release with local changes Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com> --- .github/workflows/ci.bazelrc | 6 +++--- .github/workflows/ci.yml | 12 +++++------- .github/workflows/release.yml | 21 +++++++++++---------- .gitignore | 1 + 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.bazelrc b/.github/workflows/ci.bazelrc index 4d60d43e6..1708bba93 100644 --- a/.github/workflows/ci.bazelrc +++ b/.github/workflows/ci.bazelrc @@ -2,6 +2,6 @@ # Included with a --bazelrc option in the call to bazel in main.yml build --announce_rc test --test_output=errors -build --disk_cache=$HOME/.cache/bazel -build --repository_cache=$HOME/.cache/bazel-repo -test --test_env=XDG_CACHE_HOME \ No newline at end of file +build --disk_cache=.cache/bazel +build --repository_cache=.cache/bazel-repo +test --test_env=XDG_CACHE_HOME diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e15b9e0c..29f82e37c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,17 +24,15 @@ jobs: - name: Mount bazel action cache uses: actions/cache@v2 with: - path: "~/.cache/bazel" + path: .cache/bazel key: bazel - name: Mount bazel repo cache uses: actions/cache@v2 with: - path: "~/.cache/bazel-repo" + path: .cache/bazel-repo key: bazel-repo - name: bazel test //... env: - # Bazelisk will download bazel to here - XDG_CACHE_HOME: ~/.cache/bazel-repo - run: - bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test - //... + XDG_CACHE_HOME: .cache/bazel-repo + run: | + bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 781fec9f3..6d42fc3ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,20 +12,21 @@ jobs: - name: Checkout uses: actions/checkout@v2 - uses: bazelbuild/setup-bazelisk@v1 - - name: check git state is clean - run: git status --porcelain - - name: bazel test //... - env: - # Bazelisk will download bazel to here. - XDG_CACHE_HOME: ~/.cache/bazel-repo + - name: Build release artifacts run: | - # Test the repository. - bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test --config=release //... - # Copy the release artifacts to /tmp/aspect/release. + if [ -n "$(git status --porcelain)" ]; then + >&2 echo "ERROR: the git state is not clean, aborting build..." + exit 1 + fi rm -rf /tmp/aspect/release bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc run --config=release //release -- /tmp/aspect/release - - name: Release + if /tmp/aspect/release/aspect-linux_amd64 version | grep '(with local changes)'; then + >&2 echo "ERROR: the release contained changes in the git state and the release will not be produced" + exit 1 + fi + - name: Create GitHub draft release and upload artifacts uses: softprops/action-gh-release@v1 with: prerelease: true + draft: true files: /tmp/aspect/release/* diff --git a/.gitignore b/.gitignore index 4cb164eaa..01fb9d4d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /bin /bazel-* /.idea +/.cache