-
Notifications
You must be signed in to change notification settings - Fork 0
161 lines (157 loc) · 6.09 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
name: Release
on:
push:
tags:
- "*"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build_release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
target:
[
# linux builds
x86_64-unknown-linux-gnu,
aarch64-unknown-linux-gnu,
arm-unknown-linux-gnueabihf,
# macos builds
x86_64-apple-darwin,
aarch64-apple-darwin,
# windows builds
x86_64-pc-windows-msvc,
x86_64-pc-windows-gnu,
# android builds
aarch64-linux-android,
armv7-linux-androideabi,
x86_64-linux-android,
i686-linux-android,
# ios builds
aarch64-apple-ios,
x86_64-apple-ios,
aarch64-apple-ios-sim,
wasm32-unknown-unknown,
]
toolchain: [stable]
exclude:
# Don't test linux/windows/android/ios targets on macos
- os: macos-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-unknown-linux-gnu
- os: macos-latest
target: arm-unknown-linux-gnueabihf
- os: macos-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: x86_64-pc-windows-gnu
- os: macos-latest
target: aarch64-linux-android
- os: macos-latest
target: armv7-linux-androideabi
- os: macos-latest
target: x86_64-linux-android
- os: macos-latest
target: i686-linux-android
# Don't test darwin/windows/ios/wasm targets on ubuntu
- os: ubuntu-latest
target: x86_64-apple-darwin
- os: ubuntu-latest
target: aarch64-apple-darwin
- os: ubuntu-latest
target: x86_64-pc-windows-msvc
- os: ubuntu-latest
target: aarch64-apple-ios
- os: ubuntu-latest
target: x86_64-apple-ios
- os: ubuntu-latest
target: aarch64-apple-ios-sim
- os: ubuntu-latest
target: wasm32-unknown-unknown
# Don't test darwin/linux/android/ios/wasm targets on windows
- os: windows-latest
target: x86_64-pc-windows-gnu
- os: windows-latest
target: x86_64-unknown-linux-gnu
- os: windows-latest
target: aarch64-unknown-linux-gnu
- os: windows-latest
target: arm-unknown-linux-gnueabihf
- os: windows-latest
target: x86_64-apple-darwin
- os: windows-latest
target: aarch64-apple-darwin
- os: windows-latest
target: aarch64-apple-ios
- os: windows-latest
target: x86_64-apple-ios
- os: windows-latest
target: aarch64-apple-ios-sim
- os: windows-latest
target: aarch64-linux-android
- os: windows-latest
target: armv7-linux-androideabi
- os: windows-latest
target: x86_64-linux-android
- os: windows-latest
target: i686-linux-android
- os: windows-latest
target: wasm32-unknown-unknown
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
target: ${{ matrix.target }}
override: true
- run: rustup target add ${{ matrix.target }}
- name: Install clang for ubuntu
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt install -y clang
fi
shell: bash
- name: Install wasm-pack (with workaround for Linux)
# see https://github.com/rustwasm/wasm-pack/issues/781#issuecomment-1242611389
# and https://github.com/rustwasm/wasm-pack/issues/823#issuecomment-1242611318
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo install --git https://github.com/frewsxcv/wasm-pack.git --branch patch-2
- name: Install wasm-pack (with official script)
if: ${{ matrix.os != 'ubuntu-latest'}}
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: wasm-build
if: ${{ matrix.target == 'wasm32-unknown-unknown' }}
run: wasm-pack build --release --target nodejs -- --no-default-features --features target-wasm --target-dir=target/
- name: install cross
run: cargo install -f cross
- name: target-c-sdk native build
if: ${{ matrix.target != 'wasm32-unknown-unknown' && (matrix.target == 'x86_64-unknown-linux-gnu' || matrix.target == 'aarch64-apple-darwin' || matrix.target == 'x86_64-apple-darwin' || matrix.target == 'x86_64-pc-windows-msvc') }}
run: cargo build --release --no-default-features --features target-c-sdk --target-dir=target/ --target=${{ matrix.target }}
- name: target-c-sdk cross build
if: ${{ matrix.target != 'x86_64-unknown-linux-gnu' && matrix.target != 'aarch64-apple-darwin' && matrix.target != 'x86_64-apple-darwin' && matrix.target != 'x86_64-pc-windows-msvc' && matrix.target != 'wasm32-unknown-unknown' }}
run: cross build --release --no-default-features --features target-c-sdk --target-dir target/ --target ${{ matrix.target }}
- name: Run tests
run: cargo test --verbose
- uses: haya14busa/action-cond@v1
id: files
with:
cond: ${{ matrix.target == 'wasm32-unknown-unknown' }}
if_true: pkg
if_false: target/${{ matrix.target }}/release/libvade_evan.a
- name: Compress files
uses: vimtor/action-zip@v1
with:
files: ${{ steps.files.outputs.value }}
dest: target/${{ matrix.target }}.zip
- name: Create Github Release
uses: ncipollo/release-action@v1
with:
artifacts: "target/${{ matrix.target }}.zip"
bodyFile: "VERSIONS.md"
replacesArtifacts: false
token: ${{ github.token }}
allowUpdates: true