fix: release with local changes (#76)
Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
diff --git a/.github/workflows/ci.bazelrc b/.github/workflows/ci.bazelrc
index 4d60d43..1708bba 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 3e15b9e..29f82e3 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -24,17 +24,15 @@
- 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 781fec9..6d42fc3 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -12,20 +12,21 @@
- 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 4cb164e..01fb9d4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
/bin
/bazel-*
/.idea
+/.cache