Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: release with local changes #76

Merged
merged 1 commit into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
build --disk_cache=.cache/bazel
build --repository_cache=.cache/bazel-repo
test --test_env=XDG_CACHE_HOME
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 //...
21 changes: 11 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/bin
/bazel-*
/.idea
/.cache