|
| 1 | +# Cut a release whenever a new tag is pushed to the repo. |
| 2 | +# You should use an annotated tag, like `git tag -a v1.2.3` |
| 3 | +# and put the release notes into the commit message for the tag. |
1 | 4 | name: Release Binary Package
|
2 | 5 | on:
|
3 | 6 | push:
|
4 | 7 | tags:
|
5 |
| - - v* |
| 8 | + - "v*.*.*" |
6 | 9 |
|
7 | 10 | jobs:
|
8 |
| - generate: |
9 |
| - name: Create release-artifacts |
| 11 | + build: |
10 | 12 | runs-on: ubuntu-latest
|
11 | 13 | steps:
|
12 |
| - - name: "Checkout the sources" |
13 |
| - |
| 14 | + - name: Checkout |
| 15 | + uses: actions/checkout@v3 |
| 16 | + - name: Mount bazel caches |
| 17 | + uses: actions/cache@v3 |
| 18 | + with: |
| 19 | + path: | |
| 20 | + ~/.cache/bazel |
| 21 | + key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', 'WORKSPACE.bzlmod') }} |
| 22 | + restore-keys: bazel-cache- |
14 | 23 | - name: Install JDK 11
|
15 | 24 | uses: actions/setup-java@v3
|
16 | 25 | with:
|
17 | 26 | distribution: "zulu"
|
18 | 27 | java-version: "11"
|
19 |
| - - name: Setup Bazelisk |
20 |
| - uses: bazelbuild/setup-bazelisk@v1 |
21 |
| - - name: Mount bazel cache |
22 |
| - uses: actions/cache@v2 |
23 |
| - with: |
24 |
| - path: "/home/runner/.cache/bazel" |
25 |
| - key: caches-${{ runner.os }}-release |
26 |
| - - name: Build release artifact |
27 |
| - run: bazelisk build //:rules_kotlin_release |
28 |
| - - name: Create release sha256 |
29 |
| - run: shasum -a 256 bazel-bin/rules_kotlin_release.tgz > bazel-bin/rules_kotlin_release.tgz.sha256 |
30 |
| - - name: Upload bazel-bin/rules_kotlin_release.tgz |
31 |
| - |
32 |
| - with: |
33 |
| - repo_token: ${{ secrets.GITHUB_TOKEN }} |
34 |
| - file: bazel-bin/rules_kotlin_release.tgz |
35 |
| - asset_name: rules_kotlin_release.tgz |
36 |
| - tag: ${{ github.ref }} |
37 |
| - overwrite: true |
38 |
| - - name: Upload bazel-bin/rules_kotlin_release.tgz.sha256 |
39 |
| - |
| 28 | + - name: Prepare release notes and artifacts |
| 29 | + env: |
| 30 | + # Bazelisk will download bazel to here. |
| 31 | + XDG_CACHE_HOME: ~/.cache/bazel-repo |
| 32 | + run: .github/workflows/release_prep.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt |
| 33 | + - name: Release |
| 34 | + uses: softprops/action-gh-release@v1 |
40 | 35 | with:
|
41 |
| - repo_token: ${{ secrets.GITHUB_TOKEN }} |
42 |
| - file: bazel-bin/rules_kotlin_release.tgz.sha256 |
43 |
| - asset_name: rules_kotlin_release.tgz.sha256 |
44 |
| - tag: ${{ github.ref }} |
45 |
| - overwrite: true |
| 36 | + prerelease: true |
| 37 | + # Use GH feature to populate the changelog automatically |
| 38 | + generate_release_notes: true |
| 39 | + body_path: release_notes.txt |
| 40 | + fail_on_unmatched_files: true |
| 41 | + files: rules_kotlin-*.tar.gz |
0 commit comments