-
Notifications
You must be signed in to change notification settings - Fork 34
94 lines (80 loc) · 2.37 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
name: Release Binary
on:
push:
tags:
- 'irust@[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: write
jobs:
build:
name: Release libs
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
###################
# cross-compile mac aarch64 from linux using zig
- if: runner.os == 'Linux'
uses: goto-bus-stop/setup-zig@v1
with:
version: 0.10.1
- if: runner.os == 'Linux'
name: Install cargo-zigbuild
run: |
cargo install cargo-zigbuild
- if: runner.os == 'Linux'
name: Build MacOS aarch64 binary
run: |
rustup target add aarch64-apple-darwin
cargo zigbuild --release --target aarch64-apple-darwin
###################
# Build for Musl
- if: runner.os == 'Linux'
name: Build Linux musl binary
run: |
rustup target add x86_64-unknown-linux-musl
cargo build --release --target=x86_64-unknown-linux-musl
####################################
- name: Build
if: runner.os != 'Linux'
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- if: runner.os == 'MacOS'
name: Upload MacOS x86_64 Binary
uses: svenstaro/upload-release-action@v2
with:
file: target/release/irust
asset_name: irust-x86_64-apple-darwin
tag: ${{ github.ref }}
overwrite: true
- if: runner.os == 'Linux'
name: Upload MacOS aarch64 binary
uses: svenstaro/upload-release-action@v2
with:
file: target/aarch64-apple-darwin/release/irust
asset_name: irust-aarch64-apple-darwin
tag: ${{ github.ref }}
overwrite: true
- if: runner.os == 'Linux'
name: Upload Linux binary
uses: svenstaro/upload-release-action@v2
with:
file: target/x86_64-unknown-linux-musl/release/irust
asset_name: irust-x86_64-unknown-linux-musl
tag: ${{ github.ref }}
overwrite: true
- if: runner.os == 'Windows'
name: Upload Windows binary
uses: svenstaro/upload-release-action@v2
with:
file: target/release/irust.exe
asset_name: irust-x86_64-pc-windows-msvc.exe
tag: ${{ github.ref }}
overwrite: true