-
Notifications
You must be signed in to change notification settings - Fork 1
664 lines (645 loc) · 26.5 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
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
name: Tag and Release
on:
push:
branches: [ "release" ]
workflow_dispatch:
inputs:
skip_checks:
type: boolean
default: false
skip_tests:
type: boolean
default: false
cancel_tag:
type: boolean
default: false
skip_tag:
type: boolean
default: false
skip_release:
type: boolean
default: false
skip_doc:
type: boolean
default: false
skip_crates:
type: boolean
default: false
env:
RUST_BACKTRACE: 1
RUSTFLAGS: '--codegen=debuginfo=0 --deny=warnings'
RUSTDOCFLAGS: '--deny=warnings'
CARGO_TERM_COLOR: always
ZNG_TP_LICENSES: false
NEXTEST_RETRIES: 3
jobs:
check-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_checks != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: sudo apt install libfontconfig1-dev
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do version --verbose
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do fmt --check
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do check
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo clean # to print size
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo check --workspace --examples --tests --release
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do l10n --all --check
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_checks != 'true' }}
check-windows:
runs-on: windows-latest
env:
CC: 'clang-cl'
CXX: 'clang-cl'
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_checks != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do version --verbose
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do fmt --check
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do check
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do clean
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo check --workspace --examples --tests --release
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_checks != 'true' }}
check-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_checks != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do version --verbose
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do fmt --check
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do check
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do clean
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo check --workspace --examples --tests --release
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_checks != 'true' }}
check-android:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: windows-latest
- os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_checks != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_checks != 'true' }}
with:
targets: aarch64-linux-android, armv7-linux-androideabi
- name: install cargo-ndk
if: ${{ github.event.inputs.skip_checks != 'true' }}
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-ndk
- run: cargo do build-apk multi
if: ${{ github.event.inputs.skip_checks != 'true' }}
prebuild-ubuntu:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
features: --features avif
# - target: aarch64-unknown-linux-gnu
runs-on: ubuntu-latest
needs: [check-ubuntu]
env:
ZNG_TP_LICENSES: true
PIP_BREAK_SYSTEM_PACKAGES: 1
steps:
- name: install cargo-about
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-about
- name: install dav1d dep nasm
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: ilammy/setup-nasm@v1
- name: install dav1d python deps
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-unknown-linux-gnu' }}
run: |
pip install -U pip
pip install -U wheel setuptools
pip install -U meson ninja
- name: build dav1d
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-unknown-linux-gnu' }}
env:
DAV1D_DIR: dav1d_dir
LIB_PATH: lib/x86_64-linux-gnu
# dav1d version must be set in crates/zng-view/build.rs too.
run: |
git clone --branch 1.3.0 --depth 1 https://github.com/videolan/dav1d.git
cd dav1d
meson build -Dprefix=$HOME/$DAV1D_DIR -Denable_tools=false -Denable_examples=false -Ddefault_library=static --buildtype release
ninja -C build
ninja -C build install
echo "PKG_CONFIG_PATH=$HOME/$DAV1D_DIR/$LIB_PATH/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/$DAV1D_DIR/$LIB_PATH" >> $GITHUB_ENV
- name: install aarch64 deps
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
run: sudo apt-get install g++-aarch64-linux-gnu
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
with:
target: ${{ matrix.target }}
- run: cargo do comment_feature -u "crates/zng-view/Cargo.toml" avif
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-unknown-linux-gnu' }}
- name: cargo do prebuild ${{ matrix.features }}
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
env:
SYSTEM_DEPS_LINK: static
run: cargo do prebuild --target ${{ matrix.target }} ${{ matrix.features }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- name: upload prebuilt
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: actions/upload-artifact@v4
with:
name: libzng_view.${{ matrix.target }}.so
path: crates/zng-view-prebuilt/lib/libzng_view.${{ matrix.target }}.so
if-no-files-found: error
prebuild-windows:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-msvc
features: --features avif
- target: aarch64-pc-windows-msvc
runs-on: windows-latest
needs: [check-windows]
env:
ZNG_TP_LICENSES: true
PIP_BREAK_SYSTEM_PACKAGES: 1
steps:
- name: install cargo-about
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-about
- name: config msvc for dav1d
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-pc-windows-msvc' }}
uses: ilammy/msvc-dev-cmd@v1
- name: install dav1d dep nasm
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-pc-windows-msvc' }}
uses: ilammy/setup-nasm@v1
- name: install dav1d python deps
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-pc-windows-msvc' }}
run: |
pip install -U pip
pip install -U wheel setuptools
pip install -U meson ninja
- name: setup dav1d env
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-pc-windows-msvc' }}
shell: bash
run: |
echo "PKG_CONFIG=c:\build\bin\pkg-config.exe" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=C:\build\lib\pkgconfig" >> $GITHUB_ENV
echo "C:\build\bin" >> $GITHUB_PATH
- name: build dav1d dep pkg-config
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-pc-windows-msvc' }}
run: |
git clone --branch meson-glib-subproject --depth 1 https://gitlab.freedesktop.org/tpm/pkg-config.git
cd pkg-config
meson build -Dprefix=C:\build --buildtype release
ninja -C build
ninja -C build install
- name: build dav1d
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-pc-windows-msvc' }}
run: |
git clone --branch 1.3.0 --depth 1 https://github.com/videolan/dav1d.git
cd dav1d
meson build -Dprefix=C:\build -Denable_tools=false -Denable_examples=false -Ddefault_library=static --buildtype release
ninja -C build
ninja -C build install
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
with:
target: ${{ matrix.target }}
- run: cargo do comment_feature -u "crates/zng-view/Cargo.toml" avif
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-pc-windows-msvc' }}
- name: cargo do prebuild --target ${{ matrix.target }} ${{ matrix.features }}
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
env:
CC: clang-cl
CXX: clang-cl
SYSTEM_DEPS_LINK: static
run: cargo do prebuild --target ${{ matrix.target }} ${{ matrix.features }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- name: upload prebuilt
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: actions/upload-artifact@v4
with:
name: zng_view.${{ matrix.target }}.dll
path: crates/zng-view-prebuilt/lib/zng_view.${{ matrix.target }}.dll
if-no-files-found: error
prebuild-macos:
strategy:
fail-fast: false
matrix:
include:
- os: macOS-13
target: x86_64-apple-darwin
- os: macOS-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
needs: [check-macos]
env:
ZNG_TP_LICENSES: true
PIP_BREAK_SYSTEM_PACKAGES: 1
steps:
- name: install cargo-about
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-about
- name: install dav1d dep nasm
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: ilammy/setup-nasm@v1
- name: install dav1d python deps
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
run: |
pip install -U pip
pip install -U wheel setuptools
pip install -U meson ninja
- name: build dav1d
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
env:
DAV1D_DIR: dav1d_dir
LIB_PATH: lib
run: |
git clone --branch 1.3.0 --depth 1 https://github.com/videolan/dav1d.git
cd dav1d
meson build -Dprefix=$HOME/$DAV1D_DIR -Denable_tools=false -Denable_examples=false -Ddefault_library=static --buildtype release
ninja -C build
ninja -C build install
echo "PKG_CONFIG_PATH=$HOME/$DAV1D_DIR/$LIB_PATH/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/$DAV1D_DIR/$LIB_PATH" >> $GITHUB_ENV
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- run: cargo do comment_feature -u "crates/zng-view/Cargo.toml" avif
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- name: cargo do prebuild --features avif
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
env:
SYSTEM_DEPS_LINK: static
run: cargo do prebuild --features avif
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- name: upload prebuilt
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: actions/upload-artifact@v4
with:
name: libzng_view.${{ matrix.target }}.dylib
path: crates/zng-view-prebuilt/lib/libzng_view.${{ matrix.target }}.dylib
if-no-files-found: error
doc-ubuntu:
runs-on: ubuntu-latest
needs: [check-ubuntu]
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_doc != 'true' }}
- run: sudo apt install libfontconfig1-dev
if: ${{ github.event.inputs.skip_doc != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_doc != 'true' }}
- run: cargo do latest_release_changes release-changes.md
if: ${{ github.event.inputs.skip_doc != 'true' }}
- uses: actions/upload-artifact@v4
if: ${{ github.event.inputs.skip_doc != 'true' }}
with:
name: release-changes.md
path: release-changes.md
if-no-files-found: error
- run: cargo do doc
if: ${{ github.event.inputs.skip_doc != 'true' }}
- uses: actions/upload-artifact@v4
if: ${{ github.event.inputs.skip_doc != 'true' }}
with:
name: doc
path: target/doc
if-no-files-found: error
- run: cargo clean
if: ${{ github.event.inputs.skip_doc != 'true' }}
test-ubuntu:
runs-on: ubuntu-latest
needs: [prebuild-ubuntu]
steps:
- name: install cargo-nextest
if: ${{ github.event.inputs.skip_tests != 'true' }}
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: sudo apt install libfontconfig1-dev
if: ${{ github.event.inputs.skip_tests != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_tests != 'true' }}
with:
components: rust-src
- name: install prebuilt
if: ${{ github.event.inputs.skip_tests != 'true' }}
uses: actions/download-artifact@v4
with:
name: libzng_view.x86_64-unknown-linux-gnu.so
path: crates/zng-view-prebuilt/lib
- run: cargo do test --nextest
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --doc
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --macro --all
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- name: install winit deps
if: ${{ github.event.inputs.skip_tests != 'true' }}
run: |
sudo apt-get update
sudo apt install libxkbcommon-x11-0
- name: cargo do test --render
if: ${{ github.event.inputs.skip_tests != 'true' }}
uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a
with:
run: cargo do test --render
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
test-windows:
runs-on: windows-latest
needs: [prebuild-windows]
env:
CC: 'clang-cl'
CXX: 'clang-cl'
steps:
- name: install cargo-nextest
if: ${{ github.event.inputs.skip_tests != 'true' }}
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tests != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_tests != 'true' }}
with:
components: rust-src
- name: install prebuilt
if: ${{ github.event.inputs.skip_tests != 'true' }}
uses: actions/download-artifact@v4
with:
name: zng_view.x86_64-pc-windows-msvc.dll
path: crates/zng-view-prebuilt/lib
- run: cargo do test --nextest
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --doc
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --macro --all
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --render
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
test-macos:
strategy:
fail-fast: false
matrix:
include:
- os: macOS-13
target: x86_64-apple-darwin
- os: macOS-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
needs: [prebuild-macos]
steps:
- name: install cargo-nextest
if: ${{ github.event.inputs.skip_tests != 'true' }}
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tests != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_tests != 'true' }}
with:
components: rust-src
- name: install prebuilt
if: ${{ github.event.inputs.skip_tests != 'true' }}
uses: actions/download-artifact@v4
with:
name: libzng_view.${{ matrix.target }}.dylib
path: crates/zng-view-prebuilt/lib
- run: cargo do test --nextest
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --doc
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --macro --all
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --render
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
test-cargo-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: sudo apt install libfontconfig1-dev
if: ${{ github.event.inputs.skip_tests != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do publish --test
if: ${{ github.event.inputs.skip_tests != 'true' }}
tag:
runs-on: ubuntu-latest
needs: [test-ubuntu, test-windows, test-macos, test-cargo-publish, doc-ubuntu, check-android]
if: ${{ github.event.inputs.cancel_tag != 'true' && github.event.ref == 'refs/heads/release' }}
permissions:
contents: write
outputs:
tag_name: ${{ steps.publish_version_tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tag != 'true' }}
with:
fetch-depth: 0
- id: publish_version_tag
if: ${{ github.event.inputs.skip_tag != 'true' }}
run: cargo do publish_version_tag --execute | tail -n 1 >> "$GITHUB_OUTPUT"
publish-release:
runs-on: ubuntu-latest
needs: [tag]
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
if: ${{ github.event.inputs.skip_release != 'true' }}
with:
name: release-changes.md
- uses: actions/download-artifact@v4
if: ${{ github.event.inputs.skip_release != 'true' }}
with:
name: libzng_view.x86_64-unknown-linux-gnu.so
path: prebuilt-ubuntu-x64
# - uses: actions/download-artifact@v4
# if: ${{ github.event.inputs.skip_release != 'true' }}
# with:
# name: libzng_view.aarch64-unknown-linux-gnu.so
# path: prebuilt-ubuntu-arm
- uses: actions/download-artifact@v4
if: ${{ github.event.inputs.skip_release != 'true' }}
with:
name: zng_view.x86_64-pc-windows-msvc.dll
path: prebuilt-windows-x64
- uses: actions/download-artifact@v4
if: ${{ github.event.inputs.skip_release != 'true' }}
with:
name: zng_view.aarch64-pc-windows-msvc.dll
path: prebuilt-windows-arm
- uses: actions/download-artifact@v4
if: ${{ github.event.inputs.skip_release != 'true' }}
with:
name: libzng_view.aarch64-apple-darwin.dylib
path: prebuilt-macos-arm
- uses: actions/download-artifact@v4
if: ${{ github.event.inputs.skip_release != 'true' }}
with:
name: libzng_view.x86_64-apple-darwin.dylib
path: prebuilt-macos-x64
- name: compress
if: ${{ github.event.inputs.skip_release != 'true' }}
run: |
mkdir prebuilt
tar -czf "prebuilt/libzng_view.x86_64-unknown-linux-gnu.so.tar.gz" -C "prebuilt-ubuntu-x64/" .
tar -czf "prebuilt/zng_view.x86_64-pc-windows-msvc.dll.tar.gz" -C "prebuilt-windows-x64/" .
tar -czf "prebuilt/zng_view.aarch64-pc-windows-msvc.dll.tar.gz" -C "prebuilt-windows-arm/" .
tar -czf "prebuilt/libzng_view.x86_64-apple-darwin.dylib.tar.gz" -C "prebuilt-macos-x64/" .
tar -czf "prebuilt/libzng_view.aarch64-apple-darwin.dylib.tar.gz" -C "prebuilt-macos-arm/" .
- run: ls --all ./prebuilt
if: ${{ github.event.inputs.skip_release != 'true' }}
- name: publish release
if: ${{ github.event.inputs.skip_release != 'true' }}
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.tag.outputs.tag_name }}
artifacts: "prebuilt/*"
bodyFile: release-changes.md
publish-doc:
runs-on: ubuntu-latest
needs: [tag]
permissions:
contents: write
env:
HAS_CHANGES: 0
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_doc != 'true' }}
with:
repository: zng-ui/zng-ui.github.io
ref: main
token: ${{ secrets.PAGES_DOC_PUSH_TOKEN }}
- run: rm -rf doc
if: ${{ github.event.inputs.skip_doc != 'true' }}
- uses: actions/download-artifact@v4
if: ${{ github.event.inputs.skip_doc != 'true' }}
name: push
with:
name: doc
path: doc
- run: |
set +e
git diff --cached --quiet
echo "HAS_CHANGES=$?" >> $GITHUB_ENV
- run: |
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
git add -A
git commit -m ${{ needs.tag.outputs.tag_name }} --quiet
git push
if: ${{ env.HAS_CHANGES && github.event.inputs.skip_doc != 'true' }}
publish-crates:
runs-on: ubuntu-latest
needs: [publish-release, publish-doc]
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
steps:
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_crates != 'true' }}
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_crates != 'true' }}
- run: sudo apt install libfontconfig1-dev
if: ${{ github.event.inputs.skip_crates != 'true' }}
- run: cargo do publish --execute ${{ github.run_attempt > 1 && '--no-burst' || '' }}
if: ${{ github.event.inputs.skip_crates != 'true' }}
test-previous:
runs-on: ubuntu-latest
needs: [publish-crates]
steps:
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_crates != 'true' }}
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_crates != 'true' }}
- run: sudo apt install libfontconfig1-dev
if: ${{ github.event.inputs.skip_crates != 'true' }}
- run: cargo do test --published
if: ${{ github.event.inputs.skip_crates != 'true' }}
cleanup:
runs-on: ubuntu-latest
if: always()
needs: [publish-release, publish-doc]
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: |
*zng_view*
doc
release-changes.md
failOnError: false