2
2
name : Release
3
3
on :
4
4
workflow_dispatch :
5
+ merge_group :
6
+ pull_request :
7
+ branches :
8
+ - main
9
+ paths :
10
+ - version.bzl
11
+ - .github/workflows/release.yaml
5
12
push :
6
13
branches :
7
14
- main
17
24
18
25
jobs :
19
26
validation :
20
- runs-on : ubuntu-20 .04
27
+ runs-on : ubuntu-22 .04
21
28
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
35
30
- name : Ensure release does not already exist
31
+ if : startsWith(github.ref, 'refs/heads/main') == false
36
32
run : |
37
33
git fetch origin &> /dev/null
38
34
version="$(grep 'VERSION =' ${{ github.workspace }}/version.bzl | sed 's/VERSION = "//' | sed 's/"//')"
53
49
- os : macOS-13
54
50
env :
55
51
TARGET : " aarch64-apple-darwin"
56
- - os : ubuntu-20 .04
52
+ - os : ubuntu-22 .04
57
53
env :
58
54
TARGET : " aarch64-unknown-linux-gnu"
59
55
- os : windows-2022
@@ -62,20 +58,20 @@ jobs:
62
58
- os : macOS-13
63
59
env :
64
60
TARGET : " x86_64-apple-darwin"
65
- - os : ubuntu-20 .04
61
+ - os : ubuntu-22 .04
66
62
env :
67
63
TARGET : " x86_64-pc-windows-gnu"
68
64
- os : windows-2022
69
65
env :
70
66
TARGET : " x86_64-pc-windows-msvc"
71
- - os : ubuntu-20 .04
67
+ - os : ubuntu-22 .04
72
68
env :
73
69
TARGET : " x86_64-unknown-linux-gnu"
74
- - os : ubuntu-20 .04
70
+ - os : ubuntu-22 .04
75
71
env :
76
72
TARGET : " x86_64-unknown-linux-musl"
77
73
steps :
78
- - uses : actions/checkout@v3
74
+ - uses : actions/checkout@v4
79
75
- name : Install rust toolchains for host
80
76
run : |
81
77
# Detect the current version of rust
99
95
- name : Setup Windows Bazelrc
100
96
run : |
101
97
echo "startup --output_user_root=C:/tmp" > ./user.bazelrc
98
+ echo "startup --windows_enable_symlinks" > ./user.bazelrc
99
+ echo "build --enable_runfiles" > ./user.bazelrc
102
100
if : startswith(matrix.os, 'Windows')
103
101
- name : Build cargo-bazel binaries
104
102
run : |
@@ -117,10 +115,11 @@ jobs:
117
115
path : ${{ github.workspace }}/crate_universe/target/artifacts/${{ matrix.env.TARGET }}
118
116
if-no-files-found : error
119
117
release :
118
+ if : startsWith(github.ref, 'refs/heads/main')
120
119
needs : builds
121
- runs-on : ubuntu-20 .04
120
+ runs-on : ubuntu-22 .04
122
121
steps :
123
- - uses : actions/checkout@v3
122
+ - uses : actions/checkout@v4
124
123
- uses : actions/download-artifact@v4
125
124
with :
126
125
path : ${{ github.workspace }}/crate_universe/target/artifacts
0 commit comments