22name : Release
33on :
44 workflow_dispatch :
5+ merge_group :
6+ pull_request :
7+ branches :
8+ - main
9+ paths :
10+ - version.bzl
11+ - .github/workflows/release.yaml
512 push :
613 branches :
714 - main
1724
1825jobs :
1926 validation :
20- runs-on : ubuntu-20 .04
27+ runs-on : ubuntu-22 .04
2128 steps :
22- - uses : actions/checkout@v3
23- # TODO: Unfortunately it's not obvious how to restrict `workflow_dispatch` to a particular branch
24- # so this step ensures releases are always done off of `main`.
25- - name : Ensure branch is 'main'
26- run : |
27- git fetch origin &> /dev/null
28- branch="$(git rev-parse --abbrev-ref HEAD)"
29- if [[ "${branch}" != "main" ]]; then
30- echo "The release branch must be main. Got '${branch}'' instead." >&2
31- exit 1
32- else
33- echo "Branch is '${branch}'"
34- fi
29+ - uses : actions/checkout@v4
3530 - name : Ensure release does not already exist
31+ if : startsWith(github.ref, 'refs/heads/main') == false
3632 run : |
3733 git fetch origin &> /dev/null
3834 version="$(grep 'VERSION =' ${{ github.workspace }}/version.bzl | sed 's/VERSION = "//' | sed 's/"//')"
5349 - os : macOS-13
5450 env :
5551 TARGET : " aarch64-apple-darwin"
56- - os : ubuntu-20 .04
52+ - os : ubuntu-22 .04
5753 env :
5854 TARGET : " aarch64-unknown-linux-gnu"
5955 - os : windows-2022
@@ -62,20 +58,20 @@ jobs:
6258 - os : macOS-13
6359 env :
6460 TARGET : " x86_64-apple-darwin"
65- - os : ubuntu-20 .04
61+ - os : ubuntu-22 .04
6662 env :
6763 TARGET : " x86_64-pc-windows-gnu"
6864 - os : windows-2022
6965 env :
7066 TARGET : " x86_64-pc-windows-msvc"
71- - os : ubuntu-20 .04
67+ - os : ubuntu-22 .04
7268 env :
7369 TARGET : " x86_64-unknown-linux-gnu"
74- - os : ubuntu-20 .04
70+ - os : ubuntu-22 .04
7571 env :
7672 TARGET : " x86_64-unknown-linux-musl"
7773 steps :
78- - uses : actions/checkout@v3
74+ - uses : actions/checkout@v4
7975 - name : Install rust toolchains for host
8076 run : |
8177 # Detect the current version of rust
9995 - name : Setup Windows Bazelrc
10096 run : |
10197 echo "startup --output_user_root=C:/tmp" > ./user.bazelrc
98+ echo "startup --windows_enable_symlinks" > ./user.bazelrc
99+ echo "build --enable_runfiles" > ./user.bazelrc
102100 if : startswith(matrix.os, 'Windows')
103101 - name : Build cargo-bazel binaries
104102 run : |
@@ -117,10 +115,11 @@ jobs:
117115 path : ${{ github.workspace }}/crate_universe/target/artifacts/${{ matrix.env.TARGET }}
118116 if-no-files-found : error
119117 release :
118+ if : startsWith(github.ref, 'refs/heads/main')
120119 needs : builds
121- runs-on : ubuntu-20 .04
120+ runs-on : ubuntu-22 .04
122121 steps :
123- - uses : actions/checkout@v3
122+ - uses : actions/checkout@v4
124123 - uses : actions/download-artifact@v4
125124 with :
126125 path : ${{ github.workspace }}/crate_universe/target/artifacts
0 commit comments