2021-11-08 14:20:26 +00:00
|
|
|
# Cut a release whenever a new tag is pushed to the repo.
|
|
|
|
# You should use an annotated tag, like `git tag -a v1.2.3`
|
|
|
|
# and put the release notes into the commit message for the tag.
|
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*.*.*"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-16 01:18:05 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-01-21 16:48:43 +00:00
|
|
|
- name: Mount bazel caches
|
2024-02-27 01:31:31 +00:00
|
|
|
uses: actions/cache@v4
|
2022-01-21 16:48:43 +00:00
|
|
|
with:
|
|
|
|
path: |
|
2022-08-04 00:05:22 +00:00
|
|
|
~/.cache/bazel
|
|
|
|
~/.cache/bazel-repo
|
2024-05-14 06:51:10 +00:00
|
|
|
key: bazel-cache-release-${{ hashFiles('.bazelrc', '.bazelversion', '.bazeliskrc', '**/BUILD', '**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', 'WORKSPACE.bazel', 'WORKSPACE.bzlmod', 'MODULE.bazel') }}
|
2024-01-08 00:12:05 +00:00
|
|
|
restore-keys: bazel-cache-release-
|
2023-09-24 22:06:10 +00:00
|
|
|
- name: bazel test //... (release)
|
2021-11-08 14:20:26 +00:00
|
|
|
env:
|
|
|
|
# Bazelisk will download bazel to here
|
|
|
|
XDG_CACHE_HOME: ~/.cache/bazel-repo
|
2024-01-08 00:12:05 +00:00
|
|
|
run: |
|
|
|
|
bazel --bazelrc=.aspect/bazelrc/ci.bazelrc \
|
|
|
|
--bazelrc=.github/workflows/ci.bazelrc \
|
|
|
|
--bazelrc=.aspect/bazelrc/bazel6.bazelrc \
|
|
|
|
test --config=local //...
|
2023-01-03 20:26:51 +00:00
|
|
|
- name: Build release artifacts
|
|
|
|
run: |
|
|
|
|
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
|
2024-01-08 00:12:05 +00:00
|
|
|
bazel --bazelrc=.aspect/bazelrc/ci.bazelrc \
|
|
|
|
--bazelrc=.github/workflows/ci.bazelrc \
|
|
|
|
--bazelrc=.aspect/bazelrc/bazel6.bazelrc \
|
|
|
|
run --config=local //tools/release -- /tmp/aspect/release
|
2023-01-03 20:37:05 +00:00
|
|
|
- name: Prepare workspace snippet
|
2023-02-01 18:39:22 +00:00
|
|
|
run: .github/workflows/release_prep.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt
|
2021-11-08 14:20:26 +00:00
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
2021-12-11 19:27:39 +00:00
|
|
|
# Use GH feature to populate the changelog automatically
|
|
|
|
generate_release_notes: true
|
2023-02-01 18:28:46 +00:00
|
|
|
files: |
|
|
|
|
/tmp/aspect/release/*
|
|
|
|
bazel-lib-*.tar.gz
|
2021-11-11 14:57:46 +00:00
|
|
|
body_path: release_notes.txt
|
2023-02-01 18:28:46 +00:00
|
|
|
fail_on_unmatched_files: true
|