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

feat: use repository cache for release builds #116

Merged
merged 1 commit into from
Jan 20, 2022
Merged
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
19 changes: 18 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Bazel caches
uses: actions/cache@v2
with:
path: |
~/.cache/bazel
~/.cache/bazel-repo
key: >-
bazel-cache-${{ hashFiles('**/*.go', '**/BUILD.bazel', '**/*.bzl',
'WORKSPACE') }}
kormide marked this conversation as resolved.
Show resolved Hide resolved
restore-keys: bazel-cache-
- uses: bazelbuild/setup-bazelisk@v1
- name: Build release artifacts
run: |
Expand All @@ -19,7 +29,14 @@ jobs:
exit 1
fi
rm -rf /tmp/aspect/release
bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc run --config=release //release -- /tmp/aspect/release
bazel \
--bazelrc=.github/workflows/ci.bazelrc \
--bazelrc=.bazelrc \
run \
--config=release \
--disk_cache="${HOME}/.cache/bazel" \
--repository_cache="${HOME}/.cache/bazel-repo" \
//release -- /tmp/aspect/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
Expand Down