|
10 | 10 |
|
11 | 11 | jobs:
|
12 | 12 | build:
|
| 13 | + # Go cross-compilation works from linux -> any platform |
13 | 14 | runs-on: ubuntu-latest
|
14 | 15 | steps:
|
15 |
| - - name: Checkout |
16 |
| - uses: actions/checkout@v4 |
17 |
| - - name: Mount bazel caches |
18 |
| - uses: actions/cache@v4 |
19 |
| - with: |
20 |
| - path: | |
21 |
| - ~/.cache/bazel |
22 |
| - ~/.cache/bazel-repo |
23 |
| - key: bazel-cache-release-${{ hashFiles('.bazelrc', '.bazelversion', '.bazeliskrc', '**/BUILD', '**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', 'WORKSPACE.bazel', 'WORKSPACE.bzlmod', 'MODULE.bazel') }} |
24 |
| - restore-keys: bazel-cache-release- |
25 |
| - - name: bazel test //... (release) |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + - name: Build Go Binaries |
26 | 18 | env:
|
27 |
| - # Bazelisk will download bazel to here |
28 |
| - XDG_CACHE_HOME: ~/.cache/bazel-repo |
29 |
| - run: | |
30 |
| - bazel --bazelrc=.aspect/bazelrc/ci.bazelrc \ |
31 |
| - --bazelrc=.github/workflows/ci.bazelrc \ |
32 |
| - --bazelrc=.aspect/bazelrc/bazel6.bazelrc \ |
33 |
| - test --config=local //... |
34 |
| - - name: Build release artifacts |
| 19 | + # NB: this variable is read by tools/release/copy_release_artifacts.sh |
| 20 | + DEST: artifacts |
35 | 21 | run: |
|
36 |
| - if [ -n "$(git status --porcelain)" ]; then |
37 |
| - >&2 echo "ERROR: the git state is not clean, aborting build..." |
38 |
| - exit 1 |
39 |
| - fi |
40 |
| - rm -rf /tmp/aspect/release |
41 |
| - bazel --bazelrc=.aspect/bazelrc/ci.bazelrc \ |
42 |
| - --bazelrc=.github/workflows/ci.bazelrc \ |
43 |
| - --bazelrc=.aspect/bazelrc/bazel6.bazelrc \ |
44 |
| - run --config=local //tools/release -- /tmp/aspect/release |
| 22 | + rm -rf ${{ env.DEST }} |
| 23 | + mkdir -p ${{ env.DEST }} |
| 24 | + bazel --bazelrc=.github/workflows/ci.bazelrc \ |
| 25 | + run --config=release //tools/release:copy_release_artifacts |
| 26 | + - uses: actions/upload-artifact@v4 |
| 27 | + with: |
| 28 | + name: artifacts |
| 29 | + path: artifacts/ |
| 30 | + retention-days: 1 |
| 31 | + |
| 32 | + release: |
| 33 | + needs: build |
| 34 | + runs-on: ubuntu-latest |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + # Fetch the built artifacts from build jobs above and extract into |
| 38 | + # ${GITHUB_WORKSPACE}/artifacts/* |
| 39 | + - uses: actions/download-artifact@v4 |
| 40 | + |
45 | 41 | - name: Prepare workspace snippet
|
46 |
| - run: .github/workflows/release_prep.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt |
47 |
| - - name: Release |
48 |
| - uses: softprops/action-gh-release@v1 |
| 42 | + run: .github/workflows/release_prep.sh > release_notes.txt |
| 43 | + |
| 44 | + - uses: softprops/action-gh-release@v2 |
49 | 45 | with:
|
50 | 46 | # Use GH feature to populate the changelog automatically
|
51 | 47 | generate_release_notes: true
|
52 | 48 | files: |
|
53 |
| - /tmp/aspect/release/* |
| 49 | + artifacts/* |
54 | 50 | bazel-lib-*.tar.gz
|
55 | 51 | body_path: release_notes.txt
|
56 | 52 | fail_on_unmatched_files: true
|
0 commit comments