-
Notifications
You must be signed in to change notification settings - Fork 232
687 lines (586 loc) · 20.7 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
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
# This is triggered when a new release is created (using the GitHub UI)
name: New Release
on:
release:
types: [released]
# Keep this in sync with the other *.yml files
env:
CI_REQ_DOTNET_SDK_VER: '8.0.x'
CI_NODE_MIN_VER: 'latest'
RUSTFLAGS: '-D warnings'
MACOSX_DEPLOYMENT_TARGET: '10.12'
JAVA_DISTRIBUTION: 'temurin'
JAVA_VERSION: '8'
jobs:
#############################################################################
#############################################################################
#############################################################################
build-dotnet:
name: C# (${{matrix.os}})
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.CI_REQ_DOTNET_SDK_VER}}
- name: Build and test
shell: bash
run: |
extra_args=
if [[ "$OSTYPE" != "linux-gnu"* ]]; then
extra_args=--quick-check
fi
./build/build-dotnet $extra_args
- uses: actions/upload-artifact@v4
if: startsWith(matrix.os, 'ubuntu-')
with:
name: nupkg
path: src/csharp/Intel/Iced/bin/Release/*.*nupkg
if-no-files-found: error
#############################################################################
#############################################################################
#############################################################################
build-java:
name: Java (${{matrix.os}})
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: ${{env.JAVA_DISTRIBUTION}}
java-version: ${{env.JAVA_VERSION}}
- name: Build and test
shell: bash
run: |
extra_args=
if [[ "$OSTYPE" != "linux-gnu"* ]]; then
extra_args=--quick-check
fi
./build/build-java $extra_args
- uses: actions/upload-artifact@v4
if: startsWith(matrix.os, 'ubuntu-')
with:
name: java
path: src/java/iced-x86/target/iced-x86*
if-no-files-found: error
#############################################################################
#############################################################################
#############################################################################
build-rust:
name: Rust (${{matrix.os}})
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust
shell: bash
run: bash build/ci-install-rust.sh
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.CI_REQ_DOTNET_SDK_VER}}
- name: Build and test
shell: bash
run: |
extra_args=
if [[ "$OSTYPE" != "linux-gnu"* ]]; then
extra_args=--quick-check
fi
./build/build-rust --no-set-rustflags $extra_args
#############################################################################
#############################################################################
#############################################################################
build-rust-js-wasm:
name: JavaScript (${{matrix.os}})
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust
shell: bash
run: bash build/ci-install-rust.sh
- uses: actions/setup-node@v4
with:
node-version: ${{env.CI_NODE_MIN_VER}}
- name: Install wasm-pack
shell: bash
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build and test
shell: bash
run: |
extra_args=
if [[ "$OSTYPE" != "linux-gnu"* ]]; then
extra_args=--quick-check
fi
./build/build-js --no-set-rustflags $extra_args
- uses: actions/upload-artifact@v4
if: startsWith(matrix.os, 'ubuntu-')
with:
name: npm
path: src/rust/iced-x86-js/pkg/release/iced-x86-*.tgz
if-no-files-found: error
#############################################################################
#############################################################################
#############################################################################
# If the supported Python versions get updated (added/removed), do:
# - Update .github/workflows/*.yml
# - Search for 3.8, 3\.8, 38, py38
# - Update build/ci-py-build-wheels.sh (update cp38)
# - Update src/rust/iced-x86-py/Cargo.toml (update "abi3-py38" to min supported version)
# - Update src/rust/iced-x86-py/README.md (py min ver: 'Python >= 3.8')
# - Update src/rust/iced-x86-py/build-wheels.sh (search for eg. 38)
# - Update src/rust/iced-x86-py/setup.py (Python versions)
# - Update src/rust/iced-x86-py/tox.ini
build-rust-python-linux-aarch64:
name: Python (${{matrix.os}}) aarch64
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
# TODO: this fails in GitHub Actions, but works locally, so disable for now.
# - name: Build manylinux aarch64
# shell: bash
# run: |
# sudo apt-get update
# sudo apt-get install qemu-user-static
# git clean -xdf
# ./build/py-build-wheels-linux.sh "quay.io/pypa/manylinux2014_aarch64"
#
# - uses: actions/upload-artifact@v4
# with:
# name: py-dist-${{matrix.os}}-aarch64
# path: /tmp/py-dist
# if-no-files-found: error
#############################################################################
#############################################################################
#############################################################################
build-rust-python-linux-x64:
name: Python (${{matrix.os}}) x64
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust
shell: bash
run: bash build/ci-install-rust.sh
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install Python tools
shell: bash
run: |
python --version 2>&1 | grep 'Python 3\.8'
python -m pip install -r src/rust/iced-x86-py/requirements-dev.txt
- name: Build and test
shell: bash
run: |
./build/build-python --no-set-rustflags --python python
git clean -xdf
- name: Create the sdist
shell: bash
run: |
git reset .
git checkout .
git clean -xdf
./build/build-python --sdist-only
mkdir -p /tmp/py-dist
cp src/rust/iced-x86-py/dist/* /tmp/py-dist
git clean -xdf
- name: Build manylinux x86_64
shell: bash
run: |
git clean -xdf
./build/py-build-wheels-linux.sh "quay.io/pypa/manylinux2014_x86_64" --pypy
- uses: actions/upload-artifact@v4
with:
name: py-dist-${{matrix.os}}-x64
path: /tmp/py-dist
if-no-files-found: error
#############################################################################
#############################################################################
#############################################################################
build-rust-python-linux-x86:
name: Python (${{matrix.os}}) x86
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Build manylinux i686
shell: bash
run: |
git clean -xdf
./build/py-build-wheels-linux.sh "quay.io/pypa/manylinux2014_i686"
- uses: actions/upload-artifact@v4
with:
name: py-dist-${{matrix.os}}-x86
path: /tmp/py-dist
if-no-files-found: error
#############################################################################
#############################################################################
#############################################################################
build-rust-python-musllinux-x64:
name: Python (${{matrix.os}}) x64 (musllinux)
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Build musllinux x86_64
shell: bash
run: |
git clean -xdf
./build/py-build-wheels-linux.sh "quay.io/pypa/musllinux_1_1_x86_64"
- uses: actions/upload-artifact@v4
with:
name: py-dist-${{matrix.os}}-x86_64-musllinux
path: /tmp/py-dist
if-no-files-found: error
#############################################################################
#############################################################################
#############################################################################
build-rust-python-macos-x64:
name: Python (${{matrix.os}}) x64
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [macos-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust
shell: bash
run: bash build/ci-install-rust.sh
# NOTE: We use setup-miniconda and not setup-python because setup-python's
# binaries target a later macos version and will produce warnings
# when building wheels on macos.
# https://github.com/actions/setup-python/issues/26
# This also means that all bash shells (that use Python) must
# use the -le options:
# shell: bash -le {0}
# setup-python is faster to install than setup-miniconda so we only
# use setup-miniconda if this is a macos image.
- uses: conda-incubator/[email protected]
with:
python-version: '3.8'
- name: Install Python tools
shell: bash -le {0}
run: |
python --version 2>&1 | grep 'Python 3\.8'
python -m pip install -r src/rust/iced-x86-py/requirements-dev.txt
- name: Build and test
shell: bash -le {0}
run: |
./build/build-python --no-set-rustflags --python python --quick-check
git clean -xdf
- uses: conda-incubator/[email protected]
with:
python-version: '3.8'
- name: Build and test the wheel
shell: bash -le {0}
run: |
python --version 2>&1 | grep 'Python 3\.8'
bash build/ci-py-build-wheels.sh --build
- uses: conda-incubator/[email protected]
with:
python-version: '3.9'
- name: Build and test the wheel
shell: bash -le {0}
run: |
python --version 2>&1 | grep 'Python 3\.9'
bash build/ci-py-build-wheels.sh
- uses: conda-incubator/[email protected]
with:
python-version: '3.10'
- name: Build and test the wheel
shell: bash -le {0}
run: |
python --version 2>&1 | grep 'Python 3\.10'
bash build/ci-py-build-wheels.sh
- uses: conda-incubator/[email protected]
with:
python-version: '3.11'
- name: Build and test the wheel
shell: bash -le {0}
run: |
python --version 2>&1 | grep 'Python 3\.11'
bash build/ci-py-build-wheels.sh
- uses: actions/upload-artifact@v4
with:
name: py-dist-${{matrix.os}}-x64
path: /tmp/py-dist
if-no-files-found: error
#############################################################################
#############################################################################
#############################################################################
build-rust-python-windows-x64:
name: Python (${{matrix.os}}) x64
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [windows-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust
shell: bash
run: bash build/ci-install-rust.sh
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install Python tools
shell: bash
run: |
python --version 2>&1 | grep 'Python 3\.8'
python -m pip install -r src/rust/iced-x86-py/requirements-dev.txt
- name: Build and test
shell: bash
run: |
./build/build-python --no-set-rustflags --python python --quick-check
git clean -xdf
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Build and test the wheel
shell: bash
run: |
python --version 2>&1 | grep 'Python 3\.8'
bash build/ci-py-build-wheels.sh --build
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Build and test the wheel
shell: bash
run: |
python --version 2>&1 | grep 'Python 3\.9'
bash build/ci-py-build-wheels.sh
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build and test the wheel
shell: bash
run: |
python --version 2>&1 | grep 'Python 3\.10'
bash build/ci-py-build-wheels.sh
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build and test the wheel
shell: bash
run: |
python --version 2>&1 | grep 'Python 3\.11'
bash build/ci-py-build-wheels.sh
- uses: actions/setup-python@v5
with:
python-version: 'pypy-3.8'
- name: Build and test the wheel
shell: bash
run: |
python --version
python --version 2>&1 | grep 'Python 3\.8'
bash build/ci-py-build-wheels.sh --build --py-kind pypy
- name: Fix upload path
shell: bash
run: |
git clean -xdf
cp -r /tmp/py-dist .
- uses: actions/upload-artifact@v4
with:
name: py-dist-${{matrix.os}}-x64
path: py-dist
if-no-files-found: error
#############################################################################
#############################################################################
#############################################################################
build-rust-python-windows-x86:
name: Python (${{matrix.os}}) x86
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [windows-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust
shell: bash
run: bash build/ci-install-rust.sh
- name: Install 32-bit Rust
shell: bash
run: |
rustup install stable-i686-pc-windows-msvc --no-self-update
rustup default stable-i686-pc-windows-msvc
rustup show
- uses: actions/setup-python@v5
with:
python-version: '3.8'
architecture: x86
- name: Build and test the wheel
shell: bash
run: |
python --version 2>&1 | grep 'Python 3\.8'
bash build/ci-py-build-wheels.sh --build
- uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: x86
- name: Build and test the wheel
shell: bash
run: |
python --version 2>&1 | grep 'Python 3\.9'
bash build/ci-py-build-wheels.sh
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: x86
- name: Build and test the wheel
shell: bash
run: |
python --version 2>&1 | grep 'Python 3\.10'
bash build/ci-py-build-wheels.sh
- uses: actions/setup-python@v5
with:
python-version: '3.11'
architecture: x86
- name: Build and test the wheel
shell: bash
run: |
python --version 2>&1 | grep 'Python 3\.11'
bash build/ci-py-build-wheels.sh
- name: Fix upload path
shell: bash
run: |
git clean -xdf
cp -r /tmp/py-dist .
- uses: actions/upload-artifact@v4
with:
name: py-dist-${{matrix.os}}-x86
path: py-dist
if-no-files-found: error
#############################################################################
#############################################################################
#############################################################################
upload-files:
runs-on: ubuntu-latest
name: Upload files
needs:
- build-dotnet
- build-java
- build-rust
- build-rust-js-wasm
- build-rust-python-linux-aarch64
- build-rust-python-linux-x64
- build-rust-python-linux-x86
- build-rust-python-musllinux-x64
- build-rust-python-macos-x64
- build-rust-python-windows-x64
- build-rust-python-windows-x86
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.CI_REQ_DOTNET_SDK_VER}}
- uses: actions/setup-java@v4
with:
distribution: ${{env.JAVA_DISTRIBUTION}}
java-version: ${{env.JAVA_VERSION}}
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: actions/setup-node@v4
with:
node-version: ${{env.CI_NODE_MIN_VER}}
registry-url: "https://registry.npmjs.org"
- uses: actions/download-artifact@v4
with:
path: /tmp/artifacts
- name: Verify downloads
shell: bash
run: |
if [ -z "$(ls -A /tmp/artifacts/nupkg/Iced.*.nupkg)" ]; then
echo "Missing nupkg files"
exit 1
fi
if [ -z "$(ls -A /tmp/artifacts/npm/iced-x86-*.tgz)" ]; then
echo "Missing npm files"
exit 1
fi
mkdir /tmp/py-dist-tmp
mkdir /tmp/py-dist
for path in /tmp/artifacts/py-dist-*; do
cp "$path/"* /tmp/py-dist-tmp
done
mv /tmp/py-dist-tmp/iced_x86-*.whl /tmp/py-dist
mv /tmp/py-dist-tmp/iced-x86-*.tar.gz /tmp/py-dist
if [ -n "$(ls -A /tmp/py-dist-tmp/* 2>/dev/null)" ]; then
ls -l /tmp/py-dist-tmp
echo "Unknown files found (see above)"
echo "If it's a new Python version, see Python version comment above (`build-rust-python`)"
exit 1
fi
rmdir /tmp/py-dist-tmp
- name: Upload checks
shell: bash
run: |
python -m pip install -U twine
python -m twine check /tmp/py-dist/*
dotnet nuget push --help
cargo publish --help
npm publish --help
mvn --help
- name: Upload to nuget.org
shell: bash
run: |
for file in /tmp/artifacts/nupkg/Iced.*.nupkg; do
dotnet nuget push "$file" --api-key "${{secrets.NUGET_APIKEY}}" --source https://api.nuget.org/v3/index.json
done
- name: Upload to crates.io
shell: bash
env:
CARGO_REGISTRY_TOKEN: ${{secrets.CRATES_IO_TOKEN}}
run: |
git reset .
git checkout .
git clean -xdf
cd src/rust/iced-x86
# --no-verify: we've tested building everything already
cargo publish --color always --no-verify
- name: Upload to pypi.org
shell: bash
run: |
python -m twine upload --non-interactive -u __token__ -p "${{secrets.PYPI_TOKEN}}" /tmp/py-dist/*
- name: Upload to npmjs.com
shell: bash
run: |
npm publish /tmp/artifacts/npm/iced-x86-*.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Set up Apache Maven Central
uses: actions/setup-java@v4
with:
distribution: ${{env.JAVA_DISTRIBUTION}}
java-version: ${{env.JAVA_VERSION}}
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to Apache Maven Central
run: |
cd src/java/iced-x86
mvn deploy
env:
MAVEN_USERNAME: wtfsck
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}