15
15
jobs :
16
16
prepare :
17
17
name : Prepare release
18
- runs-on : ubuntu-20.04
18
+ runs-on : ubuntu-latest
19
19
timeout-minutes : 30
20
20
outputs :
21
21
tag_name : ${{ steps.release_info.outputs.tag_name }}
@@ -66,78 +66,81 @@ jobs:
66
66
uses : ./.github/workflows/docker-publish.yml
67
67
68
68
release :
69
- name : ${{ matrix.job. target }} (${{ matrix.job .os }})
70
- runs-on : ${{ matrix.job. os }}
71
- timeout-minutes : 60
69
+ name : ${{ matrix.target }} (${{ matrix.os }})
70
+ runs-on : ${{ matrix.os }}
71
+ timeout-minutes : 90
72
72
needs : prepare
73
73
strategy :
74
74
fail-fast : false
75
75
matrix :
76
- job :
77
- # The OS is used for the runner
78
- # The platform is a generic platform name
79
- # The target is used by Cargo
80
- # The arch is either 386, arm64 or amd64
81
- # The svm target platform to use for the binary https://github.com/roynalnaruto/svm-rs/blob/84cbe0ac705becabdc13168bae28a45ad2299749/svm-builds/build.rs#L4-L24
76
+ include :
77
+ # `os`: GHA runner
78
+ # `target`: Rust build target triple
79
+ # `platform` and `arch`: Used in tarball names
80
+ # `svm`: target platform to use for the Solc binary: https://github.com/roynalnaruto/svm-rs/blob/84cbe0ac705becabdc13168bae28a45ad2299749/svm-builds/build.rs#L4-L24
82
81
- os : ubuntu-20.04
83
- platform : linux
84
82
target : x86_64-unknown-linux-gnu
85
- arch : amd64
86
83
svm_target_platform : linux-amd64
87
- - os : ubuntu-20.04
88
84
platform : linux
85
+ arch : amd64
86
+ - os : ubuntu-20.04
89
87
target : aarch64-unknown-linux-gnu
90
- arch : arm64
91
88
svm_target_platform : linux-aarch64
89
+ platform : linux
90
+ arch : arm64
92
91
- os : macos-latest
93
- platform : darwin
94
92
target : x86_64-apple-darwin
95
- arch : amd64
96
93
svm_target_platform : macosx-amd64
97
- - os : macos-latest
98
94
platform : darwin
95
+ arch : amd64
96
+ - os : macos-latest
99
97
target : aarch64-apple-darwin
100
- arch : arm64
101
98
svm_target_platform : macosx-aarch64
99
+ platform : darwin
100
+ arch : arm64
102
101
- os : windows-latest
103
- platform : win32
104
102
target : x86_64-pc-windows-msvc
105
- arch : amd64
106
103
svm_target_platform : windows-amd64
107
-
104
+ platform : win32
105
+ arch : amd64
108
106
steps :
109
107
- uses : actions/checkout@v3
110
108
- uses : dtolnay/rust-toolchain@stable
111
109
with :
112
- targets : ${{ matrix.job. target }}
110
+ targets : ${{ matrix.target }}
113
111
- uses : Swatinem/rust-cache@v2
114
112
with :
115
113
cache-on-failure : true
116
114
117
115
- name : Apple M1 setup
118
- if : ${{ matrix.job. target == 'aarch64-apple-darwin' }}
116
+ if : matrix.target == 'aarch64-apple-darwin'
119
117
run : |
120
118
echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV
121
119
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV
122
120
123
121
- name : Linux ARM setup
124
- if : ${{ matrix.job. target == 'aarch64-unknown-linux-gnu' }}
122
+ if : matrix.target == 'aarch64-unknown-linux-gnu'
125
123
run : |
126
124
sudo apt-get update -y
127
125
sudo apt-get install -y gcc-aarch64-linux-gnu
128
126
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
129
127
130
128
- name : Build binaries
131
129
env :
132
- SVM_TARGET_PLATFORM : ${{ matrix.job.svm_target_platform }}
133
- run : cargo build --release --bins --target ${{ matrix.job.target }}
130
+ SVM_TARGET_PLATFORM : ${{ matrix.svm_target_platform }}
131
+ shell : bash
132
+ # Windows runs out of RAM when building binaries with LLVM
133
+ run : |
134
+ flags=()
135
+ [[ "${{ matrix.target }}" == *windows* ]] && flags+="-j2"
136
+ cargo build --release --bins --target ${{ matrix.target }} "${flags[@]}"
134
137
135
138
- name : Archive binaries
136
139
id : artifacts
137
140
env :
138
- PLATFORM_NAME : ${{ matrix.job. platform }}
139
- TARGET : ${{ matrix.job. target }}
140
- ARCH : ${{ matrix.job. arch }}
141
+ PLATFORM_NAME : ${{ matrix.platform }}
142
+ TARGET : ${{ matrix.target }}
143
+ ARCH : ${{ matrix.arch }}
141
144
VERSION_NAME :
142
145
${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
143
146
shell : bash
@@ -159,10 +162,10 @@ jobs:
159
162
160
163
- name : Build man page
161
164
id : man
162
- if : ${{ matrix.job. target == 'x86_64-unknown-linux-gnu' }}
165
+ if : matrix.target == 'x86_64-unknown-linux-gnu'
163
166
env :
164
- PLATFORM_NAME : ${{ matrix.job. platform }}
165
- TARGET : ${{ matrix.job. target }}
167
+ PLATFORM_NAME : ${{ matrix.platform }}
168
+ TARGET : ${{ matrix.target }}
166
169
VERSION_NAME :
167
170
${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
168
171
shell : bash
@@ -207,9 +210,10 @@ jobs:
207
210
208
211
cleanup :
209
212
name : Release cleanup
210
- runs-on : ubuntu-20.04
213
+ runs-on : ubuntu-latest
211
214
timeout-minutes : 30
212
215
needs : release
216
+ if : always()
213
217
steps :
214
218
- uses : actions/checkout@v3
215
219
@@ -234,7 +238,7 @@ jobs:
234
238
name : Open an issue
235
239
runs-on : ubuntu-latest
236
240
needs : [prepare, release-docker, release, cleanup]
237
- if : ${{ failure() }}
241
+ if : failure()
238
242
steps :
239
243
- uses : actions/checkout@v3
240
244
- uses : JasonEtco/create-an-issue@v2
0 commit comments