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
|
|
|
|
uses: actions/checkout@v2
|
2022-01-21 16:48:43 +00:00
|
|
|
- name: Mount bazel caches
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
"~/.cache/bazel"
|
|
|
|
"~/.cache/bazel-repo"
|
|
|
|
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE') }}
|
|
|
|
restore-keys: bazel-cache-
|
2021-11-08 14:20:26 +00:00
|
|
|
- name: bazel test //...
|
|
|
|
env:
|
|
|
|
# Bazelisk will download bazel to here
|
|
|
|
XDG_CACHE_HOME: ~/.cache/bazel-repo
|
2021-11-08 15:26:45 +00:00
|
|
|
run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //...
|
2021-11-11 14:57:46 +00:00
|
|
|
- name: Prepare workspace snippet
|
2021-12-11 19:27:39 +00:00
|
|
|
run: .github/workflows/workspace_snippet.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt
|
2022-05-17 18:51:46 +00:00
|
|
|
- uses: tibdex/github-app-token@v1
|
|
|
|
id: generate-token
|
|
|
|
with:
|
|
|
|
app_id: ${{ secrets.BCR_APP_ID }}
|
|
|
|
private_key: ${{ secrets.BCR_APP_PRIVATE_KEY }}
|
2021-11-08 14:20:26 +00:00
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
prerelease: true
|
2021-12-11 19:27:39 +00:00
|
|
|
# Use GH feature to populate the changelog automatically
|
|
|
|
generate_release_notes: true
|
2021-11-11 14:57:46 +00:00
|
|
|
body_path: release_notes.txt
|
2022-05-17 18:51:46 +00:00
|
|
|
token: ${{ steps.generate-token.outputs.token }}
|