-
Notifications
You must be signed in to change notification settings - Fork 2
509 lines (495 loc) · 27.4 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
# Taken from: https://github.com/sharkdp/hyperfine
name: release
env:
MIN_SUPPORTED_RUST_VERSION: "1.56.0"
CICD_INTERMEDIATES_DIR: "_cicd-intermediates"
RUST_BACKTRACE: 1
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
matrix:
job:
# Tier 1
# DONE: Compiles
- { target: aarch64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: i686-pc-windows-gnu , os: windows-2019 }
# DONE: Compiles
#- { target: i686-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: i686-pc-windows-msvc , os: windows-2019 }
# DONE: Compiles
- { target: x86_64-apple-darwin , os: macos-10.15 }
# DONE: Compiles
#- { target: x86_64-pc-windows-gnu , os: windows-2019 }
# DONE: Compiles
- { target: x86_64-pc-windows-msvc , os: windows-2019 }
# DONE: Compiles
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 }
# Tier 2 with Host Tools
# DONE: Compiles
- { target: aarch64-apple-darwin , os: macos-11.0 }
# DONE: Compiles
#- { target: aarch64-pc-windows-msvc , os: windows-2019 }
# DONE: Compiles
#- { target: aarch64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: arm-unknown-linux-gnueabi , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: armv7-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: mips-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: mips64-unknown-linux-gnuabi64 , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: mips64el-unknown-linux-gnuabi64 , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: mipsel-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: powerpc-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: powerpc64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: powerpc64le-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
# DONE: Compiles
# DONE: Compiles
#- { target: x86_64-unknown-freebsd , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
# - { target: x86_64-unknown-illumos , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: arm-unknown-linux-musleabihf , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: i686-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: x86_64-unknown-netbsd , os: ubuntu-20.04, use-cross: true }
# Tier 2
# DONE: Compiles
#- { target: aarch64-apple-ios , os: macos-11 }
# DONE: Compiles
#- { target: aarch64-apple-ios-sim , os: macos-11 }
# TODO: needs cc
# - { target: aarch64-fuchsia , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: aarch64-linux-android , os: ubuntu-20.04, use-cross: true }
# TODO: needs cc
# - { target: aarch64-unknown-none-softfloat , os: ubuntu-20.04, use-cross: true }
# TODO: needs cc
# - { target: aarch64-unknown-none , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: arm-linux-androideabi , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: arm-unknown-linux-musleabi , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: arm-unknown-linux-musleabihf , os: ubuntu-20.04, use-cross: true }
# TODO: needs cc
# - { target: armebv7r-none-eabi , os: ubuntu-20.04, use-cross: true }
# TODO: needs cc
# - { target: armebv7r-none-eabihf , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: armv5te-unknown-linux-gnueabi , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: armv5te-unknown-linux-musleabi , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: armv7-linux-androideabi , os: ubuntu-20.04, use-cross: true }
# TODO: needs docker image for cross
# - { target: armv7-unknown-linux-gnueabi , os: ubuntu-20.04 }
# TODO: needs docker image for cross
# - { target: armv7-unknown-linux-musleabi , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: armv7-unknown-linux-musleabihf , os: ubuntu-20.04, use-cross: true }
# TODO: needs cc
# - { target: armv7a-none-eabi , os: ubuntu-20.04, use-cross: true }
# TODO: needs cc
# - { target: armv7r-none-eabi , os: ubuntu-20.04, use-cross: true }
# TODO: needs cc
# - { target: armv7r-none-eabihf , os: ubuntu-20.04, use-cross: true }
# TODO: needs emcc linker
# - { target: asmjs-unknown-emscripten , os: ubuntu-20.04, use-cross: true }
# TODO: needs linker
# - { target: i586-pc-windows-msvc , os: windows-2019 }
# DONE: Compiles
#- { target: i586-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: i586-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: i686-linux-android , os: ubuntu-20.04, use-cross: true }
# TODO: needs cc
# - { target: i686-unknown-freebsd , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: i686-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: mips-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
# TODO: needs docker image
# - { target: mips64-unknown-linux-muslabi64 , os: ubuntu-20.04, use-cross: true }
# TODO: needs docker image
# - { target: mips64el-unknown-linux-muslabi64 , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: mipsel-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
# DONE: Only emits Assembly
# - { target: nvptx64-nvidia-cuda , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: riscv32i-unknown-none-elf , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: riscv32imac-unknown-none-elf , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: riscv32imc-unknown-none-elf , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: riscv64gc-unknown-none-elf , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: riscv64imac-unknown-none-elf , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: sparc64-unknown-linux-gnu , os: ubuntu-20.04 }
# TODO: investigate
# - { target: sparcv9-sun-solaris , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: thumbv6m-none-eabi , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: thumbv7em-none-eabi , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: thumbv7em-none-eabihf , os: ubuntu-20.04, use-cross: true }
# TODO: requires cc
# - { target: thumbv7m-none-eabi , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: thumbv7neon-linux-androideabi , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: thumbv7neon-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: thumbv8m.base-none-eabi , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: thumbv8m.main-none-eabi , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: thumbv8m.main-none-eabihf , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: wasm32-unknown-emscripten , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: wasm32-unknown-unknown , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: wasm32-wasi , os: ubuntu-20.04, use-cross: true }
# DONE: Compiles
#- { target: x86_64-apple-ios , os: macos-10.15 }
# TODO: investigate
# - { target: x86_64-fortanix-unknown-sgx , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: x86_64-fuchsia , os: ubuntu-20.04 }
# DONE: Compiles
#- { target: x86_64-linux-android , os: ubuntu-20.04, use-cross: true }
# TODO: missing -lsocket -lposix4 -lmem
# - { target: x86_64-pc-solaris , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: x86_64-unknown-linux-gnux32 , os: ubuntu-20.04 }
# TODO: investigate
# - { target: x86_64-unknown-redox , os: ubuntu-20.04, use-cross: true }
# Tier 3
# TODO: investigate
# - { target: aarch64-apple-ios-macabi , os: macos-11 }
# TODO: investigate
# - { target: aarch64-apple-tvos , os: macos-11 }
# TODO: investigate
# - { target: aarch64-unknown-freebsd , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: aarch64-unknown-hermit , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: aarch64-unknown-uefi , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: aarch64-linux-gnu_ilp32 , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: aarch64_be-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: armv4t-unknown-linux-gnueabi , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: armv5te-unknown-linux-uclibceabi , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: armv6-unknown-freebsd , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: armv6-unknown-netbsd-eabihf , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: armv7-apple-ios , os: macos-10.15 }
# TODO: investigate
# - { target: armv7-unknown-freebsd , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: armv7-unknown-netbsd-eabihf , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: armv7-wrs-vxworks-eabihf , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: armv7a-none-eabihf , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: armv7s-apple-ios , os: macos-10.15 }
# TODO: investigate
# - { target: avr-unknown-gnu-atmega328 , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: bpfeb-unknown-none , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: bpfel-unknown-none , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: hexagon-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: i386-apple-ios , os: macos-10.15 }
# TODO: investigate
# - { target: i686-apple-darwin , os: macos-10.15 }
# DONE: Compiles
#- { target: i686-pc-windows-msvc , os: windows-2019 }
# TODO: investigate
# - { target: i686-unknown-haiku , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: i686-unknown-netbsd , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: i686-unknown-openbsd , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: i686-unknown-uefi , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: i686-uwp-windows-gnu , os: windows-2019 }
# TODO: investigate
# - { target: i686-uwp-windows-msvc , os: windows-2019 }
# TODO: investigate
# - { target: i686-wrs-vxworks , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: mips-unknown-linux-uclibc , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: mipsel-sony-psp , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: mipsel-unknown-linux-uclibc , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: mipsel-unknown-none , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: mipsisa32r6-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: mipsisa32r6el-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: mipsisa64r6-unknown-linux-gnuabi64 , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: mipsisa64r6el-unknown-linux-gnuabi64, os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: msp430-none-elf , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: powerpc-unknown-linux-gnuspe , os: ubuntu-20.04 }
# TODO: investigate
# - { target: powerpc-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: powerpc-unknown-netbsd , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: powerpc-unknown-openbsd , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: powerpc-wrs-vxworks-spe , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: powerpc-wrs-vxworks , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: powerpc64-unknown-freebsd , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: powerpc64le-unknown-freebsd , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: powerpc-unknown-freebsd , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: powerpc64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: powerpc64-wrs-vxworks , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: powerpc64le-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: riscv32gc-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: riscv32gc-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: riscv32imc-esp-espidf , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: riscv64gc-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: s390x-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: sparc-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: sparc64-unknown-netbsd , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: sparc64-unknown-openbsd , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: thumbv4t-none-eabi , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: thumbv7a-pc-windows-msvc , os: windows-2019 }
# TODO: investigate
# - { target: thumbv7a-uwp-windows-msvc , os: windows-2019 }
# TODO: investigate
# - { target: thumbv7neon-unknown-linux-musleabihf, os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: wasm64-unknown-unknown , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: x86_64-apple-ios-macabi , os: macos-10.15 }
# TODO: investigate
# - { target: x86_64-apple-tvos , os: macos-10.15 }
# TODO: investigate
# - { target: x86_64-pc-windows-msvc , os: windows-2019 }
# DONE: Compiles with no_std
# - { target: x86_64-sun-solaris , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: x86_64-unknown-dragonfly , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: x86_64-unknown-haiku , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: x86_64-unknown-hermit , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: x86_64-unknown-l4re-uclibc , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: x86_64-unknown-none-hermitkernel , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: x86_64-unknown-none-linuxkernel , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: x86_64-unknown-openbsd , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: x86_64-unknown-uefi , os: ubuntu-20.04, use-cross: true }
# TODO: investigate
# - { target: x86_64-uwp-windows-gnu , os: windows-2019 }
# TODO: investigate
# - { target: x86_64-uwp-windows-msvc , os: windows-2019 }
# TODO: investigate
# - { target: x86_64-wrs-vxworks , os: ubuntu-20.04, use-cross: true }
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install prerequisites
shell: bash
run: |
case ${{ matrix.job.target }} in
aarch64-linux-musl) sudo apt-get -y update ; sudo apt-get -y install musl-dev ;;
arm-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf export cc="gcc-arm-linux-gnueabihf" ;;
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ; export cc="gcc-aarch64-linux-gnu" ;;
powerpc-unknown-linux-gnuspe) sudo apt-get -y update ; sudo apt-get -y install gcc-powerpc-linux-gnuspe ; export cc="gcc-powerpc-linux-gnuspe" ;;
sparc-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install libc6-dev-sparc-sparc64-cross libc6-sparc-sparc64-cross ;;
armv7-unknown-linux-gnueabi) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabi ; export cc="gcc-arm-linux-gnueabi" ;;
x86_64-unknown-linux-gnux32) sudo apt-get -y update ; sudo apt-get -y install gcc-x86-64-linux-gnux32 ; export cc="gcc-x86-64-linux-gnux32" ;;
sparc64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-sparc64-linux-gnu ; export cc="gcc-sparc64-linux-gnu" ;;
i686-pc-windows-gnu) echo "C:\msys64\mingw32\bin" >> $GITHUB_PATH ;;
i686-pc-windows-msvc) echo "C:\msys64\mingw32\bin" >> $GITHUB_PATH ;;
i586-pc-windows-msvc) echo "C:\msys64\mingw32\bin" >> $GITHUB_PATH ;;
esac
- name: Extract crate information
shell: bash
run: |
echo "PROJECT_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV
echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
echo "PROJECT_MAINTAINER=$(sed -n 's/^authors = \["\(.*\)"\]/\1/p' Cargo.toml)" >> $GITHUB_ENV
echo "PROJECT_HOMEPAGE=$(sed -n 's/^homepage = "\(.*\)"/\1/p' Cargo.toml)" >> $GITHUB_ENV
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
target: ${{ matrix.job.target }}
toolchain: nightly
override: true
profile: minimal
- name: Show version information (Rust, cargo, Gcc)
shell: bash
run: |
cc --version || true
rustup -V
rustup toolchain list
rustup default
cargo -V
rustc -V
- name: Show rustc --version --verbose
shell: bash
run: rustc --version --verbose
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.job.use-cross }}
command: build
args: --locked --release --target=${{ matrix.job.target }}
- name: Strip debug information from executable
id: strip
shell: bash
run: |
# Figure out suffix of binary
EXE_suffix=""
case ${{ matrix.job.target }} in
*-pc-windows-*) EXE_suffix=".exe" ;;
esac;
# Figure out what strip tool to use if any
STRIP="strip"
case ${{ matrix.job.target }} in
arm-unknown-linux-*) STRIP="arm-linux-gnueabihf-strip" ;;
aarch64-pc-*) STRIP="" ;;
aarch64-unknown-*) STRIP="" ;;
armv7-unknown-*) STRIP="" ;;
mips-unknown-*) STRIP="" ;;
mips64-unknown-*) STRIP="" ;;
mips64el-unknown-*) STRIP="" ;;
mipsel-unknown-*) STRIP="" ;;
powerpc-unknown-*) STRIP="" ;;
powerpc64-unknown-*) STRIP="" ;;
powerpc64le-unknown-*) STRIP="" ;;
riscv64gc-unknown-*) STRIP="" ;;
s390x-unknown-*) STRIP="" ;;
x86_64-unknown-freebsd) STRIP="" ;;
x86_64-unknown-illumos) STRIP="" ;;
aarch64-linux-android) STRIP="" ;;
arm-linux-androideabi) STRIP="" ;;
armv5te-unknown-linux-gnueabi) STRIP="" ;;
armv5te-unknown-linux-musleabi) STRIP="" ;;
armv7-linux-androideabi) STRIP="" ;;
esac;
# Setup paths
BIN_DIR="${{ env.CICD_INTERMEDIATES_DIR }}/stripped-release-bin/"
mkdir -p "${BIN_DIR}"
BIN_NAME="${{ env.PROJECT_NAME }}${EXE_suffix}"
BIN_PATH="${BIN_DIR}/${BIN_NAME}"
TRIPLET_NAME="${{ matrix.job.target }}"
# Copy the release build binary to the result location
cp "target/$TRIPLET_NAME/release/${BIN_NAME}" "${BIN_DIR}"
# Also strip if possible
if [ -n "${STRIP}" ]; then
"${STRIP}" "${BIN_PATH}"
fi
# Let subsequent steps know where to find the (stripped) bin
echo ::set-output name=BIN_PATH::${BIN_PATH}
echo ::set-output name=BIN_NAME::${BIN_NAME}
- name: Create tarball
id: package
shell: bash
run: |
PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac;
PKG_BASENAME=${PROJECT_NAME}-v${PROJECT_VERSION}-${{ matrix.job.target }}
PKG_NAME=${PKG_BASENAME}${PKG_suffix}
echo ::set-output name=PKG_NAME::${PKG_NAME}
PKG_STAGING="${{ env.CICD_INTERMEDIATES_DIR }}/package"
ARCHIVE_DIR="${PKG_STAGING}/${PKG_BASENAME}/"
mkdir -p "${ARCHIVE_DIR}"
mkdir -p "${ARCHIVE_DIR}/autocomplete"
# Binary
cp "${{ steps.strip.outputs.BIN_PATH }}" "$ARCHIVE_DIR"
# base compressed package
pushd "${PKG_STAGING}/" >/dev/null
case ${{ matrix.job.target }} in
*-pc-windows-*) 7z -y a "${PKG_NAME}" "${PKG_BASENAME}"/* | tail -2 ;;
*) tar czf "${PKG_NAME}" "${PKG_BASENAME}"/* ;;
esac;
popd >/dev/null
# Let subsequent steps know where to find the compressed package
echo ::set-output name=PKG_PATH::"${PKG_STAGING}/${PKG_NAME}"
- name: "Artifact upload: tarball"
uses: actions/upload-artifact@master
with:
name: ${{ steps.package.outputs.PKG_NAME }}
path: ${{ steps.package.outputs.PKG_PATH }}
- name: Check for release
id: is-release
shell: bash
run: |
unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
echo ::set-output name=IS_RELEASE::${IS_RELEASE}
- name: Publish archives and packages
uses: softprops/action-gh-release@v1
if: steps.is-release.outputs.IS_RELEASE
with:
files: |
${{ steps.package.outputs.PKG_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}