-
-
Notifications
You must be signed in to change notification settings - Fork 84
265 lines (227 loc) · 7.82 KB
/
publish.yaml
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
name: publish
on:
push:
tags:
- "v*"
- "prebuild-test.*"
jobs:
prebuild:
name: Prebuild for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
library_name: crsqlite.so
artifact_name: crsqlite.zip
asset_name: crsqlite-linux-x86_64.zip
- os: macos-latest
library_name: crsqlite.dylib
artifact_name: crsqlite.zip
asset_name: crsqlite-darwin-x86_64.zip
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Load .env file
uses: xom9ikk/dotenv@v2
with:
path: ./
- name: Build
run: |
cd core
make loadable
cd dist; zip crsqlite.zip ${{ matrix.library_name }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: core/dist/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
# we can probably collapse all these into the prebuild job
prebuild-macos-arm:
name: Prebuild for macos arm
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
library_name: crsqlite.dylib
artifact_name: crsqlite.zip
asset_name: crsqlite-darwin-aarch64.zip
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Rust Nightly
run: |
rustup toolchain install nightly-2023-10-05
rustup target add aarch64-apple-darwin --toolchain nightly-2023-10-05
- name: Build MacOS Arm dylib
run: |
cd core
export CI_MAYBE_TARGET="aarch64-apple-darwin" && make loadable
cd dist; zip crsqlite.zip ${{ matrix.library_name }}
- name: Upload macos dylib to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: core/dist/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
- name: Build all ios dynamic
run: |
cd core
./all-ios-loadable.sh
- name: Upload framework to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: core/dist/crsqlite-ios-dylib.xcframework.tar.gz
asset_name: crsqlite-ios-dylib.xcframework.tar.gz
tag: ${{ github.ref }}
prebuild-linux-arm:
name: Prebuild for linux arm
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
library_name: crsqlite.so
artifact_name: crsqlite.zip
asset_name: crsqlite-linux-aarch64.zip
steps:
- name: Install toolchain
run: |
sudo apt update && sudo apt install -y gcc make gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
- uses: actions/checkout@v3
with:
submodules: true
- name: Rust Nightly
run: |
rustup toolchain install nightly-2023-10-05
rustup target add aarch64-unknown-linux-gnu --toolchain nightly-2023-10-05
rustup component add rust-src --toolchain nightly-2023-10-05-x86_64-unknown-linux-gnu
- name: Build
run: |
cd core
export CI_MAYBE_TARGET="aarch64-unknown-linux-gnu" && export CI_GCC="aarch64-linux-gnu-gcc" && make loadable
cd dist; zip crsqlite.zip ${{ matrix.library_name }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: core/dist/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
prebuild-windows-x86_64:
name: Prebuild for Windows x86_64
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
library_name: crsqlite.dll
artifact_name: crsqlite.zip
asset_name: crsqlite-win-x86_64.zip
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Rust Nightly
run: |
rustup toolchain install nightly-2023-10-05
rustup target add x86_64-pc-windows-gnu --toolchain nightly-2023-10-05
rustup component add rust-src --toolchain nightly-2023-10-05-x86_64-unknown-linux-gnu
- name: mingw-w64
run: |
sudo apt update && sudo apt install -y mingw-w64
- name: Build
run: |
cd core
export CI_MAYBE_TARGET="x86_64-pc-windows-gnu" && export CI_GCC="x86_64-w64-mingw32-gcc" && make loadable
cd dist; zip crsqlite.zip ${{ matrix.library_name }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: core/dist/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
prebuild-windows-i686:
name: Prebuild for Windows i686
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
library_name: crsqlite.dll
artifact_name: crsqlite.zip
asset_name: crsqlite-win-i686.zip
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Rust Nightly
run: |
rustup toolchain install nightly-2023-10-05
rustup target add i686-pc-windows-gnu --toolchain nightly-2023-10-05
rustup component add rust-src --toolchain nightly-2023-10-05-x86_64-unknown-linux-gnu
- name: mingw-w64
run: |
sudo apt update && sudo apt install -y mingw-w64
- name: Build
run: |
cd core
export CI_MAYBE_TARGET="i686-pc-windows-gnu" && export CI_GCC="i686-w64-mingw32-gcc" && make loadable
cd dist; zip crsqlite.zip ${{ matrix.library_name }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: core/dist/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
prebuild-android:
name: Prebuild for android
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
library_name: crsqlite.so
artifact_name: crsqlite.zip
asset_name: crsqlite-aarch64-linux-android.zip
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Rust Nightly
run: |
rustup toolchain install nightly-2023-10-05
rustup target add aarch64-linux-android --toolchain nightly-2023-10-05
rustup component add rust-src --toolchain nightly-2023-10-05-x86_64-unknown-linux-gnu
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25c
local-cache: true
add-to-path: false
- name: Cargo NDK
run: cargo install cargo-ndk
- name: Build
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
cd core
export ANDROID_TARGET=aarch64-linux-android; make loadable
cd dist; zip crsqlite.zip ${{ matrix.library_name }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: core/dist/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}