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:
|
2024-05-23 23:08:35 +00:00
|
|
|
# Go cross-compilation works from linux -> any platform
|
2021-11-08 14:20:26 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-05-23 23:08:35 +00:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Build Go Binaries
|
2021-11-08 14:20:26 +00:00
|
|
|
env:
|
2024-05-23 23:08:35 +00:00
|
|
|
# NB: this variable is read by tools/release/copy_release_artifacts.sh
|
|
|
|
DEST: artifacts
|
2023-01-03 20:26:51 +00:00
|
|
|
run: |
|
2024-05-23 23:08:35 +00:00
|
|
|
rm -rf ${{ env.DEST }}
|
|
|
|
mkdir -p ${{ env.DEST }}
|
|
|
|
bazel --bazelrc=.github/workflows/ci.bazelrc \
|
|
|
|
run --config=release //tools/release:copy_release_artifacts
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: artifacts
|
|
|
|
path: artifacts/
|
|
|
|
retention-days: 1
|
|
|
|
|
|
|
|
release:
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
# Fetch the built artifacts from build jobs above and extract into
|
|
|
|
# ${GITHUB_WORKSPACE}/artifacts/*
|
|
|
|
- uses: actions/download-artifact@v4
|
|
|
|
|
2023-01-03 20:37:05 +00:00
|
|
|
- name: Prepare workspace snippet
|
2024-05-23 23:08:35 +00:00
|
|
|
run: .github/workflows/release_prep.sh > release_notes.txt
|
|
|
|
|
|
|
|
- uses: softprops/action-gh-release@v2
|
2021-11-08 14:20:26 +00:00
|
|
|
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: |
|
2024-05-23 23:08:35 +00:00
|
|
|
artifacts/*
|
2023-02-01 18:28:46 +00:00
|
|
|
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
|