generated from bazel-contrib/rules-template
-
-
Notifications
You must be signed in to change notification settings - Fork 26
64 lines (55 loc) · 1.89 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# 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:
# We don't attempt to cross-compile rust binaries from one OS to another.
# So just spin up a runner on each OS to build its binaries.
strategy:
matrix:
# Pin to runner releases since our Rust compile is fiddly with system libs
os: [ubuntu-20.04, macos-12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Build Rust Binaries
env:
# NB: this variable is read by tools/release/copy_release_artifacts.sh
DEST: artifacts
run: |
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-${{ matrix.os }}
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-macos-latest/*
# ${GITHUB_WORKSPACE}/artifacts-ubuntu-latest/*
- uses: actions/download-artifact@v4
- name: Prepare release
run: .github/workflows/release_prep.sh > release_notes.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
prerelease: true
# Use GH feature to populate the changelog automatically
generate_release_notes: true
body_path: release_notes.txt
files: |
artifacts-*/*
rules_py-*.tar.gz
fail_on_unmatched_files: true