Repository navigation
447 lines (442 loc) · 18.3 KB
/
Copy pathrelease.yml
File metadata and controls
447 lines (442 loc) · 18.3 KB
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
name: Release
run-name: Release ${{ github.ref == 'refs/heads/main' && 'nightly' || github.ref_name }} by @${{ github.actor }}
permissions:
contents: write
on:
push:
tags:
- nightly
- v[0-9]+.*
workflow_run:
workflows:
- Rust
branches:
- main
types:
- completed
# Run manually
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
CARGO_TERM_COLOR: always
AWS_LC_SYS_PREBUILT_NASM: 1
PLUGIN_REPOSITORY: "std"
PLUGINS: "arithmetic base color comparison connector date-time flow logical metadata numeric random result state string taxonomy trigger value"
jobs:
create-or-update-nightly-tag:
name: Create or Update Nightly Tag
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04
steps:
- name: VCS Checkout
uses: actions/checkout@v6
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Update Tag nightly
continue-on-error: true
run: |
git config user.name "Reactive Graph"
git config user.email "info@reactive-graph.io"
git show nightly || true
git log --oneline
git tag -d nightly || true
git tag --annotate --message "Nightly Release" --sign nightly || true
git push --force origin nightly
git show nightly || true
git log --oneline --decorate
create-release:
name: Create Release
if: startsWith(github.event.ref, 'refs/tags/v')
runs-on: ubuntu-22.04
steps:
- name: VCS Checkout
uses: actions/checkout@v6
- name: Create GitHub Release
uses: taiki-e/create-gh-release-action@v1
with:
changelog: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}
upload-assets:
name: Binary
needs: [ create-or-update-nightly-tag, create-release ]
if: always() && (!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled'))
strategy:
fail-fast: false
matrix:
include:
# Tier 1
# ARM64 Linux (kernel 4.1, glibc 2.17+)
- target: aarch64-unknown-linux-gnu
os: ubuntu-22.04-arm
prefix: lib
extension: .so
archive_format: tar.gz
# ARM64 macOS (11.0+, Big Sur+)
- target: aarch64-apple-darwin
os: macos-latest
prefix: lib
extension: .dylib
archive_format: tar.gz
# 32-bit Linux (kernel 3.2+, glibc 2.17+) 1
- target: i686-unknown-linux-gnu
os: ubuntu-22.04
prefix: lib
extension: .so
archive_format: tar.gz
# 64-bit macOS (10.12+, Sierra+)
- target: x86_64-apple-darwin
os: macos-latest
prefix: lib
extension: .dylib
archive_format: tar.gz
# 64-bit MinGW (Windows 10+, Windows Server 2016+)
- target: x86_64-pc-windows-gnu
os: ubuntu-22.04
prefix: ""
extension: .dll
archive_format: zip
# 64-bit MSVC (Windows 10+, Windows Server 2016+)
- target: x86_64-pc-windows-msvc
os: windows-latest
prefix: ""
extension: .dll
archive_format: zip
# 64-bit Linux (kernel 3.2+, glibc 2.17+)
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
prefix: lib
extension: .so
archive_format: tar.gz
# Universal macOS binary is supported as universal-apple-darwin.
- target: universal-apple-darwin
os: macos-latest
prefix: lib
extension: .dylib
archive_format: tar.gz
# Tier 2
# Armv7-A Linux, hardfloat (kernel 3.2, glibc 2.17)
- target: armv7-unknown-linux-gnueabihf
os: ubuntu-22.04-arm
prefix: lib
extension: .so
archive_format: tar.gz
# PowerPC Linux (kernel 3.2, glibc 2.17)
- target: powerpc-unknown-linux-gnu
os: ubuntu-22.04
prefix: lib
extension: .so
archive_format: tar.gz
# PPC64 Linux (kernel 3.2, glibc 2.17)
- target: powerpc64-unknown-linux-gnu
os: ubuntu-22.04
prefix: lib
extension: .so
archive_format: tar.gz
# PPC64LE Linux (kernel 3.10, glibc 2.17)
- target: powerpc64le-unknown-linux-gnu
os: ubuntu-22.04
prefix: lib
extension: .so
archive_format: tar.gz
# RISC-V Linux (kernel 4.20, glibc 2.29)
- target: riscv64gc-unknown-linux-gnu
os: ubuntu-22.04
prefix: lib
extension: .so
archive_format: tar.gz
runs-on: ${{ matrix.os }}
steps:
- name: VCS Checkout
uses: actions/checkout@v6
- name: Get version number from git tag
id: tag
uses: devops-actions/action-get-tag@v1.0.3
with:
strip_v: true
default: nightly
- name: Install Compiler Tools for Target i686-unknown-linux-gnu
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils-i686-linux-gnu gcc-i686-linux-gnu
version: 1.0
if: matrix.target == 'i686-unknown-linux-gnu'
- name: Install Compiler Tools for Target x86_64-pc-windows-gnu
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils-mingw-w64-x86-64 gcc-mingw-w64-x86-64 nasm
version: 1.0
if: matrix.target == 'x86_64-pc-windows-gnu'
- name: Install Compiler Tools for Target armv7-unknown-linux-gnueabihf
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
version: 1.0
if: |
matrix.target == 'armv7-unknown-linux-gnueabihf'
- name: Install Compiler Tools for Target powerpc-unknown-linux-gnu
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils-powerpc-linux-gnu gcc-powerpc-linux-gnu
version: 1.0
if: matrix.target == 'powerpc-unknown-linux-gnu'
- name: Install Compiler Tools for Target powerpc64-unknown-linux-gnu
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils-powerpc64-linux-gnu gcc-powerpc64-linux-gnu
version: 1.0
if: matrix.target == 'powerpc64-unknown-linux-gnu'
- name: Install Compiler Tools for Target powerpc64le-unknown-linux-gnu
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils-powerpc64le-linux-gnu gcc-powerpc64le-linux-gnu
version: 1.0
if: matrix.target == 'powerpc64le-unknown-linux-gnu'
- name: Install Compiler Tools for Target riscv64gc-unknown-linux-gnu
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils-riscv64-linux-gnu gcc-riscv64-linux-gnu
version: 1.0
if: matrix.target == 'riscv64gc-unknown-linux-gnu'
- name: Set AWS_LC_SYS_CFLAGS on powerpc-unknown-linux-gnu
run: echo 'AWS_LC_SYS_CFLAGS="-Wno-stringop-overflow"' >> "$GITHUB_ENV"
if: matrix.target == 'powerpc-unknown-linux-gnu'
# The flag below is set to avoid the following error with GCC 11.4.0 on the riscv64 platform:
# error: 'strncmp' of strings of length 1 and 9 and bound of 9 evaluates to nonzero [-Werror=string-compare]
- name: Set AWS_LC_SYS_CFLAGS on riscv64gc-unknown-linux-gnu
run: echo 'AWS_LC_SYS_CFLAGS="-Wno-string-compare"' >> "$GITHUB_ENV"
if: matrix.target == 'riscv64gc-unknown-linux-gnu'
- name: Set optimization level 2 for powerpc targets
run: echo 'CARGO_PROFILE_RELEASE_OPT_LEVEL=2' >> "$GITHUB_ENV"
if: |
matrix.target == 'powerpc-unknown-linux-gnu' ||
matrix.target == 'powerpc64-unknown-linux-gnu' ||
matrix.target == 'powerpc64le-unknown-linux-gnu'
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: ${{ matrix.target }}
if: matrix.target != 'universal-apple-darwin'
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: "x86_64-apple-darwin, aarch64-apple-darwin"
if: matrix.target == 'universal-apple-darwin'
- name: Install bindgen-cli
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: bindgen-cli
if: |
matrix.target == 'i686-unknown-linux-gnu' ||
matrix.target == 'x86_64-pc-windows-gnu' ||
matrix.target == 'armv7-unknown-linux-gnueabihf' ||
matrix.target == 'powerpc-unknown-linux-gnu' ||
matrix.target == 'powerpc64-unknown-linux-gnu' ||
matrix.target == 'powerpc64le-unknown-linux-gnu' ||
matrix.target == 'riscv64gc-unknown-linux-gnu'
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
if: |
matrix.target == 'i686-unknown-linux-gnu' ||
matrix.target == 'x86_64-pc-windows-gnu' ||
matrix.target == 'armv7-unknown-linux-gnueabihf' ||
matrix.target == 'powerpc-unknown-linux-gnu' ||
matrix.target == 'powerpc64-unknown-linux-gnu' ||
matrix.target == 'powerpc64le-unknown-linux-gnu' ||
matrix.target == 'riscv64gc-unknown-linux-gnu'
- name: Build Dynamic Link Libraries
run: cargo build --release --target ${{ matrix.target }}
if: matrix.target != 'universal-apple-darwin'
- name: Build Dynamic Link Libraries (universal-apple-darwin)
run: |
cargo build --release --target x86_64-apple-darwin
cargo build --release --target aarch64-apple-darwin
mkdir -p target/universal-apple-darwin/release
for PLUGIN in ${{env.PLUGINS}}; do
lipo \
-create \
target/x86_64-apple-darwin/release/${{matrix.prefix}}reactive_graph_${{env.PLUGIN_REPOSITORY}}_${PLUGIN//-/_}${{matrix.extension}} \
target/aarch64-apple-darwin/release/${{matrix.prefix}}reactive_graph_${{env.PLUGIN_REPOSITORY}}_${PLUGIN//-/_}${{matrix.extension}} \
-output \
target/universal-apple-darwin/release/${{matrix.prefix}}reactive_graph_${{env.PLUGIN_REPOSITORY}}_${PLUGIN//-/_}${{matrix.extension}}
done
if: matrix.target == 'universal-apple-darwin'
- name: Create Release Archive
id: archive
uses: ksm2/archive-action@v1
with:
name: 'reactive-graph-${{env.PLUGIN_REPOSITORY}}_${{steps.tag.outputs.tag}}_${{ matrix.target }}'
format: ${{ matrix.archive_format }}
root-directory: 'target/${{ matrix.target }}/release/'
include: '${{ matrix.prefix }}reactive_graph_${{env.PLUGIN_REPOSITORY}}_*${{ matrix.extension }}'
- name: Upload Regular Release Archive to GitHub Releases
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.archive.outputs.path }}
if: startsWith(github.event.ref, 'refs/tags/v')
- name: Upload Nightly Release Archive to GitHub Releases
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.archive.outputs.path }}
tag_name: nightly
if: github.ref == 'refs/heads/main'
debian-package:
name: Debian package
needs: [ create-or-update-nightly-tag, create-release ]
if: always() && (!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled'))
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
# libc 2.35
os: ubuntu-22.04
- target: aarch64-unknown-linux-gnu
# libc 2.35
os: ubuntu-22.04-arm
- target: i686-unknown-linux-gnu
# libc 2.35
os: ubuntu-22.04
- target: armv7-unknown-linux-gnueabihf
# libc 2.35
os: ubuntu-22.04-arm
- target: powerpc-unknown-linux-gnu
# libc 2.35
os: ubuntu-22.04
- target: powerpc64-unknown-linux-gnu
# libc 2.35
os: ubuntu-22.04
- target: powerpc64le-unknown-linux-gnu
# libc 2.39
os: ubuntu-24.04
- target: riscv64gc-unknown-linux-gnu
# libc 2.35
os: ubuntu-22.04
runs-on: ${{ matrix.os }}
steps:
- name: VCS Checkout
uses: actions/checkout@v6
- name: Get version number from git tag
id: tag
uses: devops-actions/action-get-tag@v1.0.3
with:
strip_v: true
default: nightly
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Install Compiler Tools for Target aarch64
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu
version: 1.0
if: matrix.target == 'aarch64-unknown-linux-gnu'
- name: Install Compiler Tools for Target i686-unknown-linux-gnu
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils-i686-linux-gnu gcc-i686-linux-gnu
version: 1.0
if: matrix.target == 'i686-unknown-linux-gnu'
- name: Install Compiler Tools for Target armv7-unknown-linux-gnueabihf
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
version: 1.0
if: matrix.target == 'armv7-unknown-linux-gnueabihf'
- name: Install Compiler Tools for Target powerpc-unknown-linux-gnu
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils-powerpc-linux-gnu gcc-powerpc-linux-gnu g++-powerpc-linux-gnu
version: 1.0
if: matrix.target == 'powerpc-unknown-linux-gnu'
- name: Install Compiler Tools for Target powerpc64-unknown-linux-gnu
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils-powerpc64-linux-gnu gcc-powerpc64-linux-gnu g++-powerpc64-linux-gnu
version: 1.0
if: matrix.target == 'powerpc64-unknown-linux-gnu'
- name: Install Compiler Tools for Target powerpc64le-unknown-linux-gnu
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils-powerpc64le-linux-gnu gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu
version: 1.0
if: matrix.target == 'powerpc64le-unknown-linux-gnu'
- name: Install Compiler Tools for Target riscv64gc-unknown-linux-gnu
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: binutils-riscv64-linux-gnu gcc-riscv64-linux-gnu
version: 1.0
if: matrix.target == 'riscv64gc-unknown-linux-gnu'
- name: Set AWS_LC_SYS_CFLAGS on powerpc-unknown-linux-gnu
run: echo 'AWS_LC_SYS_CFLAGS="-Wno-stringop-overflow"' >> "$GITHUB_ENV"
if: matrix.target == 'powerpc-unknown-linux-gnu'
# The flag below is set to avoid the following error with GCC 11.4.0 on the riscv64 platform:
# error: 'strncmp' of strings of length 1 and 9 and bound of 9 evaluates to nonzero [-Werror=string-compare]
- name: Set AWS_LC_SYS_CFLAGS on riscv64gc-unknown-linux-gnu
run: echo 'AWS_LC_SYS_CFLAGS="-Wno-string-compare"' >> "$GITHUB_ENV"
if: matrix.target == 'riscv64gc-unknown-linux-gnu'
- name: Set optimization level 2 for powerpc targets
run: echo 'CARGO_PROFILE_RELEASE_OPT_LEVEL=2' >> "$GITHUB_ENV"
if: |
matrix.target == 'powerpc-unknown-linux-gnu' ||
matrix.target == 'powerpc64-unknown-linux-gnu' ||
matrix.target == 'powerpc64le-unknown-linux-gnu'
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Install Cargo Deb
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cargo-deb
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
- name: Create Regular Debian Package
if: startsWith(github.event.ref, 'refs/tags/v')
run: |
for PLUGIN in ${{env.PLUGINS}}; do
# It's important to change into the plugin directory and building each package
cd "${{ github.workspace }}/plugins/$PLUGIN/crates/plugin"
cargo deb -p reactive-graph-${{env.PLUGIN_REPOSITORY}}-$PLUGIN --target=${{ matrix.target }} --deb-revision ${{steps.tag.outputs.tag}}
done
env:
VERGEN_IDEMPOTENT: true
- name: Create Nightly Debian Package
if: github.ref == 'refs/heads/main'
run: |
for PLUGIN in ${{env.PLUGINS}}; do
# It's important to change into the plugin directory and building each package
cd "${{ github.workspace }}/plugins/$PLUGIN/crates/plugin"
cargo deb -p reactive-graph-${{env.PLUGIN_REPOSITORY}}-$PLUGIN --target=${{ matrix.target }} --deb-revision nightly
done
env:
VERGEN_IDEMPOTENT: true
- name: Upload Regular Debian Package
uses: svenstaro/upload-release-action@v2
if: startsWith(github.event.ref, 'refs/tags/v')
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/debian/libreactive-graph-${{env.PLUGIN_REPOSITORY}}-*_*_*.deb
file_glob: true
tag: ${{ github.ref }}
- name: Upload Nightly Debian Package
uses: svenstaro/upload-release-action@v2
if: github.ref == 'refs/heads/main'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/debian/libreactive-graph-${{env.PLUGIN_REPOSITORY}}-*_*_*.deb
file_glob: true
tag: 'nightly'
overwrite: true