Repository navigation
676 lines (613 loc) · 26.1 KB
/
Copy pathrelease.yml
File metadata and controls
676 lines (613 loc) · 26.1 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
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
name: Release
on:
push:
tags:
- 'morphir-v*'
- 'python-v*'
- 'native-v*'
- 'extension/python/v*'
# Qualification only, including every native wheel platform. Publishing
# requires a tag push.
workflow_dispatch:
inputs:
mck-diagnostic:
description: Build only the shared MCK on Windows; never stage or publish a release
type: boolean
default: false
permissions:
contents: read
concurrency:
group: ${{ inputs.mck-diagnostic && 'mck-diagnostic' || 'release' }}-${{ github.ref }}
cancel-in-progress: false
jobs:
mck-diagnostic:
name: Diagnose Windows shared MCK build
if: github.event_name == 'workflow_dispatch' && inputs.mck-diagnostic
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
- uses: jdx/mise-action@v5
with:
install_args: rust python
- uses: actions/cache@v6
with:
path: |
.dev/mep-tool/
${{ runner.temp }}/mck
key: mep-${{ runner.os }}-${{ runner.arch }}-rust-1.98.1-${{ hashFiles('rust/extension.toml', 'scripts/mep_tool.py') }}
restore-keys: mep-${{ runner.os }}-${{ runner.arch }}-rust-1.98.1-
- name: Build the pinned canonical checker
env:
MORPHIR_MCK_CARGO_HOME: ${{ runner.temp }}/mck
run: python -m scripts.mep_tool --output .dev/qualification/mep-tool.json
- name: Inspect checkout changes after the Windows build
if: always()
shell: pwsh
run: |
Get-Item .dev/mep-tool/*/source | ForEach-Object {
$source = $_.FullName
Write-Output "Pinned MCK source: $source"
git -C $source status --short
git -C $source diff --stat
git -C $source diff --ignore-space-at-eol --stat
git -C $source submodule foreach --recursive 'git status --short'
git -C $source submodule foreach --recursive 'git diff --stat'
}
- name: Retain checker setup diagnostics
if: always()
uses: actions/upload-artifact@v7
with:
name: windows-mck-build-diagnostic
path: |
.dev/mep-tool/*/build.log
.dev/qualification/mep-tool.json
include-hidden-files: true
if-no-files-found: warn
qualify:
name: Qualify release
if: inputs.mck-diagnostic != true
uses: ./.github/workflows/ci.yml
with:
release-tag: ${{ github.ref_type == 'tag' && github.ref_name || '' }}
qualify-mep: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/extension/python/v') }}
# Every advertised platform builds its own wheel once; the same job installs
# that exact wheel, with the qualified core and tools wheels, into a clean
# environment without Rust before uploading it.
native-wheels:
name: Native wheel (${{ matrix.platform }})
needs: qualify
if: >-
github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/native-v') ||
startsWith(github.ref, 'refs/tags/python-v') ||
startsWith(github.ref, 'refs/tags/extension/python/v')
strategy:
fail-fast: false
matrix:
include:
# Qualification already built and tested this wheel; reuse its bytes.
- platform: manylinux_2_28_x86_64
runner: ubuntu-latest
target: x86_64-unknown-linux-gnu
manylinux: '2_28'
reuse: native-linux-x86_64
- platform: manylinux_2_28_aarch64
runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
manylinux: '2_28'
- platform: macosx_11_0_arm64
runner: macos-latest
target: aarch64-apple-darwin
manylinux: ''
- platform: macosx_10_12_x86_64
runner: macos-15-intel
target: x86_64-apple-darwin
manylinux: ''
- platform: win_amd64
runner: windows-latest
target: x86_64-pc-windows-msvc
manylinux: ''
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Reuse the qualification wheel
if: matrix.reuse && !startsWith(github.ref, 'refs/tags/python-v')
uses: actions/download-artifact@v8
with:
name: ${{ matrix.reuse }}
path: dist/reused/
- name: Keep only the reused wheel
if: matrix.reuse && !startsWith(github.ref, 'refs/tags/python-v')
shell: bash
run: mkdir -p dist/native && cp dist/reused/*.whl dist/native/
- name: Build the wheel
if: ${{ !matrix.reuse && !startsWith(github.ref, 'refs/tags/python-v') }}
uses: PyO3/maturin-action@v1
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.target == 'aarch64-apple-darwin' && '11.0' || '10.12' }}
CARGO_TARGET_DIR: ${{ github.workspace }}/rust/target
with:
working-directory: packages/morphir-python-native
maturin-version: '1.15.0'
rust-toolchain: '1.98.1'
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux || 'off' }}
# Process guests share the wheel's Linux baseline and compiled core.
before-script-linux: >-
${{ (github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/extension/python/v')) &&
format('cargo build --manifest-path ../../rust/Cargo.toml --locked --release -p morphir-python-extension --target {0}', matrix.target) || '' }}
args: --release --locked --out ../../dist/native
- name: Set up Python 3.15
uses: actions/setup-python@v7
with:
python-version: '3.15'
- name: Set up uv
uses: astral-sh/setup-uv@v10.3.3
- name: Download the pinned published native wheel for a CLI release
if: startsWith(github.ref, 'refs/tags/python-v')
shell: bash
run: |
pin="$(python -c 'from scripts.qualify_native import tools_pin; print(tools_pin())')"
uvx --from pip==26.2.2 pip download --no-deps --only-binary=:all: \
--dest dist/native "morphir-python-native==$pin"
- name: Audit the Linux baseline and bundled libraries
if: matrix.manylinux != ''
shell: bash
run: |
# The build container writes dist/ as root.
sudo chown -R "$(id -u):$(id -g)" dist
pipx run --spec 'auditwheel==6.8.2' auditwheel show dist/native/*.whl | tee audit.txt
# The report starts with the file name, so match auditwheel's own verdict.
tr '\n' ' ' < audit.txt | tr -s ' ' \
| grep -q 'consistent with the following platform tag: "${{ matrix.platform }}"'
- name: Download the qualified core and tools wheels
uses: actions/download-artifact@v8
with:
pattern: morphir*-dist
path: dist/pure/
merge-multiple: true
- name: Install the exact wheels without Rust and exercise them
shell: bash
run: |
wheel="$(ls dist/native/*.whl)"
[[ "$wheel" == *"-cp314-abi3-${{ matrix.platform }}.whl" ]]
python scripts/qualify_native.py wheel "$wheel"
python scripts/qualify_native.py install \
dist/pure/morphir-*.whl "$wheel" dist/pure/morphir_python-*.whl
# The Linux reuse already passed this in qualify. Other platforms and
# CLI releases exercise the package-manager path with their exact wheels.
- name: Set up mise without installing development toolchains
if: ${{ !matrix.reuse || startsWith(github.ref, 'refs/tags/python-v') }}
uses: jdx/mise-action@v5
with:
version: '2026.10.25'
install: false
- name: Qualify mise uv and actual pipx installs
if: ${{ !matrix.reuse || startsWith(github.ref, 'refs/tags/python-v') }}
shell: bash
run: |
python -m scripts.qualify_mise \
dist/pure/morphir-*.whl dist/native/morphir_python_native-*.whl \
dist/pure/morphir_python-*.whl --report dist/mise-install.json
- name: Upload mise qualification evidence
if: ${{ !matrix.reuse || startsWith(github.ref, 'refs/tags/python-v') }}
uses: actions/upload-artifact@v7
with:
name: mise-install-${{ matrix.platform }}
path: dist/mise-install.json
if-no-files-found: error
# Linux x86_64 already produced and qualified this exact guest in qualify.
# The other producers use their matching native wheel for API comparison.
- name: Build the process executable on macOS and Windows
if: >-
matrix.manylinux == '' &&
(github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/extension/python/v'))
shell: bash
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.target == 'aarch64-apple-darwin' && '11.0' || '10.12' }}
# The standalone guest must not require the VC redistributable.
# This setting is confined to the executable, not the Python wheel.
RUSTFLAGS: ${{ runner.os == 'Windows' && '-C target-feature=+crt-static' || '' }}
run: >-
cargo +1.98.1 build --manifest-path rust/Cargo.toml --locked --release
-p morphir-python-extension --target '${{ matrix.target }}'
- name: Refuse external VC and Python runtime dependencies
if: >-
runner.os == 'Windows' &&
(github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/extension/python/v'))
shell: pwsh
run: |
./.github/scripts/check_process_windows.ps1 `
-Executable rust/target/x86_64-pc-windows-msvc/release/morphir-python-extension.exe `
-Report .dev/qualification/windows-process-imports.json
- name: Qualify the process bundle against the matching Python API
if: >-
!matrix.reuse &&
(github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/extension/python/v'))
shell: bash
run: |
uv venv .dev/process-check --python 3.14
qualifier=.dev/process-check/bin/python
executable=rust/target/${{ matrix.target }}/release/morphir-python-extension
if [[ "${{ runner.os }}" == Windows ]]; then
qualifier=.dev/process-check/Scripts/python.exe
executable="$executable.exe"
fi
uv pip install --python "$qualifier" dist/pure/*.whl dist/native/*.whl
mkdir -p .morphir/build/extensions .dev/qualification
"$qualifier" -m scripts.process_extension \
--executable "$executable" \
--output .morphir/build/extensions/python-process \
--commit "$GITHUB_SHA" \
--report .dev/qualification/process-${{ matrix.target }}.json \
--host-check
- name: Set up the canonical MCK toolchain
if: >-
!matrix.reuse &&
(github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/extension/python/v'))
uses: jdx/mise-action@v5
with:
install_args: rust python
- name: Cache the source-pinned canonical MCK build
if: >-
!matrix.reuse &&
(github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/extension/python/v'))
uses: actions/cache@v6
with:
path: |
.dev/mep-tool/
${{ runner.os == 'Windows' && format('{0}/mck', runner.temp) || '' }}
key: mep-${{ runner.os }}-${{ runner.arch }}-rust-1.98.1-${{ hashFiles('rust/extension.toml', 'scripts/mep_tool.py') }}
restore-keys: mep-${{ runner.os }}-${{ runner.arch }}-rust-1.98.1-
- name: Build the shared checker and qualify process MEP
if: >-
!matrix.reuse &&
(github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/extension/python/v'))
shell: bash
env:
MORPHIR_MCK_CARGO_HOME: ${{ runner.os == 'Windows' && format('{0}/mck', runner.temp) || '' }}
run: |
python -m scripts.mep_tool --output .dev/qualification/mep-tool.json
python -m scripts.qualify_mep \
--bundle .morphir/build/extensions/python-process --runtime process \
--tool .dev/qualification/mep-tool.json --commit "$GITHUB_SHA" \
--report .dev/qualification/mep-${{ matrix.target }}-report.json \
--receipt .dev/qualification/mep-${{ matrix.target }}-recheck.json
- name: Retain failed checker build diagnostics
if: failure() && hashFiles('.dev/mep-tool/*/build.log') != ''
uses: actions/upload-artifact@v7
with:
name: mep-build-log-${{ matrix.target }}
path: .dev/mep-tool/*/build.log
include-hidden-files: true
- name: Upload the qualified process bundle and receipt
if: >-
!matrix.reuse &&
(github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/extension/python/v'))
uses: actions/upload-artifact@v7
with:
name: morphir-python-process-${{ matrix.target }}
path: |
.morphir/build/extensions/python-process/
.dev/qualification/process-${{ matrix.target }}.json
.dev/qualification/mep-${{ matrix.target }}-*.json
.dev/qualification/*-process-imports.json
include-hidden-files: true
if-no-files-found: error
- name: Upload the qualified wheel
uses: actions/upload-artifact@v7
with:
name: native-wheel-${{ matrix.platform }}
path: dist/native/*.whl
if-no-files-found: error
native-candidates:
name: Verify native release candidates
needs: [qualify, native-wheels]
if: >-
needs.native-wheels.result == 'success' &&
!startsWith(github.ref, 'refs/tags/python-v')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Download the qualified platform wheels
uses: actions/download-artifact@v8
with:
pattern: native-wheel-*
path: dist/candidates/
merge-multiple: true
- name: Download the qualified source archive
uses: actions/download-artifact@v8
with:
name: native-linux-x86_64
path: dist/ci-native/
- name: Add the source archive
run: cp dist/ci-native/*.tar.gz dist/candidates/
- name: Refuse missing, extra or mismatched candidates
run: |
tag=""
if [[ "$GITHUB_REF" == refs/tags/native-v* ]]; then
tag="$GITHUB_REF_NAME"
fi
if [[ -z "$tag" ]]; then
tag="native-v$(python3 -c 'import tomllib; print(tomllib.load(open("rust/crates/morphir-python-native/Cargo.toml","rb"))["package"]["version"])')"
fi
python3 scripts/release_candidates.py native dist/candidates --tag "$tag"
- name: Upload the release set
uses: actions/upload-artifact@v7
with:
name: native-release
path: dist/candidates/
if-no-files-found: error
# Assembly requires all five process and the portable WASM producer's
# canonical MCK run plus saved-report recheck for these exact artifact bytes.
process-candidates:
name: Verify the process release candidate set
needs: [qualify, native-wheels]
if: >-
github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/extension/python/v')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Python 3.15
uses: actions/setup-python@v7
with:
python-version: '3.15'
- name: Download each qualified process platform
uses: actions/download-artifact@v8
with:
pattern: morphir-python-process-*
path: dist/process-inputs/
- name: Download the qualified WASM reference
uses: actions/download-artifact@v8
with:
name: morphir-python-extension-bundle
path: dist/wasm-check/
- name: Require canonical MEP rechecks and matching installed results
run: |
python -m scripts.process_release \
--inputs dist/process-inputs \
--output dist/process-release \
--commit "$GITHUB_SHA" \
--wasm-bundle dist/wasm-check/.morphir/build/extensions/python \
--wasm-report dist/wasm-check/.dev/qualification/bundle-host.json \
--report dist/process-assembly.json \
--assets-output dist/process-assets
- name: Verify runtime switching, installed integrity and platform refusal
run: |
(cd dist/process-assets && sha256sum --strict --check SHA256SUMS)
mkdir -p .dev/process-archive
tar -xzf dist/process-assets/morphir-python-extension-*.tar.gz -C .dev/process-archive
python -m scripts.qualify_runtime \
--wasm dist/wasm-check/.morphir/build/extensions/python \
--process .dev/process-archive \
--report dist/runtime-choice.json
# Source-pinned host assurance belongs to the existing manual/release
# candidate consumer. Build once; exercise the downloaded guest bytes.
- name: Set up the pinned Rust host toolchain
uses: jdx/mise-action@v5
with:
install_args: rust python
- name: Cache the independent Rust host build
uses: Swatinem/rust-cache@v2
with:
workspaces: tools/extension-qualification -> ../../.dev/host-qualification-target
- name: Build and check the source-pinned Rust host qualifier
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/.dev/host-qualification-target
run: |
manifest=tools/extension-qualification/Cargo.toml
cargo fmt --manifest-path "$manifest" --check
cargo clippy --locked --release --manifest-path "$manifest" --all-targets --no-deps -- -D warnings
cargo test --locked --release --manifest-path "$manifest"
cargo build --locked --release --manifest-path "$manifest"
- name: Qualify real host channels and retain repeated timing samples
run: |
wasm=dist/wasm-check/.morphir/build/extensions/python
version="$(python -c 'from scripts.extension_bundle import crate_version; print(crate_version())')"
python -m scripts.benchmark_extension \
--checker .dev/host-qualification-target/release/morphir-python-host-qualification \
--wasm "$wasm/morphir-python-binding-$version.wasm" \
--process ".dev/process-archive/morphir-python-extension-$version-x86_64-unknown-linux-gnu" \
--output dist/host-qualification --samples 5
- name: Upload the process candidate and its release evidence
uses: actions/upload-artifact@v7
with:
name: process-release-candidate
path: |
dist/process-release/
dist/process-assets/
dist/process-assembly.json
dist/runtime-choice.json
dist/host-qualification/
dist/process-inputs/*/.dev/qualification/*.json
dist/wasm-check/.dev/qualification/bundle-mep-*.json
include-hidden-files: true
if-no-files-found: error
publish-native:
name: Publish morphir-python-native to PyPI
if: >-
github.event_name == 'push' &&
github.repository == 'finos/morphir-python' &&
startsWith(github.ref, 'refs/tags/native-v')
needs: native-candidates
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/project/morphir-python-native/
steps:
- name: Download the verified release set
uses: actions/download-artifact@v8
with:
name: native-release
path: dist/
- name: Check the bytes against the receipt
run: |
cd dist
sha256sum --check SHA256SUMS
rm SHA256SUMS
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
extension-candidate:
name: Verify the extension bundle candidate
needs: [qualify, native-wheels, process-candidates]
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/extension/python/v')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Download the qualified bundle
uses: actions/download-artifact@v8
with:
name: morphir-python-extension-bundle
path: dist/bundle-check/
- name: Refuse a bundle that is not from this tag's commit
run: |
bundle=dist/bundle-check/.morphir/build/extensions/python
version="$(python3 -c 'from scripts.extension_bundle import crate_version; print(crate_version())')"
tag="extension/python/v$version"
if [[ "${{ github.ref_type }}" == tag ]]; then tag="$GITHUB_REF_NAME"; fi
python3 scripts/release_candidates.py bundle "$bundle" \
--tag "$tag" --commit "$GITHUB_SHA"
mkdir -p dist/bundle
# Release assets keep morphir-rust's descriptor name.
cp "$bundle/morphir-python-binding-$version.wasm" \
"$bundle/morphir-python-binding-$version.wasm.sha256" dist/bundle/
cp "$bundle/release.json" "dist/bundle/morphir-python-binding-$version.release.json"
cp dist/bundle-check/.dev/qualification/bundle*.json dist/bundle/
- name: Download the qualified process assets and producer evidence
uses: actions/download-artifact@v8
with:
name: process-release-candidate
path: dist/process-check/
- name: Stage both runtimes with their exact qualification evidence
run: |
(cd dist/process-check/process-assets && sha256sum --strict --check SHA256SUMS)
cp dist/process-check/process-assets/morphir-python-extension-* dist/bundle/
cp dist/process-check/process-assets/process-assets.json dist/bundle/
cp dist/process-check/process-assembly.json dist/process-check/runtime-choice.json dist/bundle/
cp dist/process-check/process-inputs/*/.dev/qualification/*.json dist/bundle/
version="$(python3 -c 'from scripts.extension_bundle import crate_version; print(crate_version())')"
tar -czf "dist/bundle/extension-host-qualification-$version.tar.gz" -C dist/process-check host-qualification
# Seal the final asset names, including both renamed descriptors.
(cd dist/bundle && sha256sum -- * > SHA256SUMS)
- name: Upload the release set
uses: actions/upload-artifact@v7
with:
name: extension-release
path: dist/bundle/
if-no-files-found: error
publish-extension:
name: Publish the morphir-python extension bundle
if: >-
github.event_name == 'push' &&
github.repository == 'finos/morphir-python' &&
startsWith(github.ref, 'refs/tags/extension/python/v')
needs: extension-candidate
runs-on: ubuntu-latest
permissions:
contents: write
environment:
name: extension-release
url: https://github.com/finos/morphir-python/releases
steps:
- name: Download the verified bundle
uses: actions/download-artifact@v8
with:
name: extension-release
path: dist/
- name: Verify the final release assets
run: |
cd dist
sha256sum --strict --check SHA256SUMS
- name: Create the GitHub release
uses: softprops/action-gh-release@v3
with:
files: dist/*
fail_on_unmatched_files: true
generate_release_notes: true
prerelease: true
publish-morphir:
name: Publish morphir library and SDK to PyPI
if: >-
github.event_name == 'push' &&
github.repository == 'finos/morphir-python' &&
startsWith(github.ref, 'refs/tags/morphir-v')
needs: qualify
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/project/morphir/
steps:
- name: Download qualified morphir distributions
uses: actions/download-artifact@v8
with:
name: morphir-dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# Qualification refuses a python-v tag until the pinned native release is on PyPI.
publish-morphir-python:
name: Publish morphir-python to PyPI
if: >-
github.event_name == 'push' &&
github.repository == 'finos/morphir-python' &&
startsWith(github.ref, 'refs/tags/python-v')
needs: [qualify, native-wheels]
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/project/morphir-python/
steps:
- name: Download morphir-python dist
uses: actions/download-artifact@v8
with:
name: morphir-python-dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
github-release:
name: Create GitHub Release
needs: [publish-morphir, publish-morphir-python]
if: >-
always() && !cancelled() &&
(needs.publish-morphir.result == 'success' ||
needs.publish-morphir-python.result == 'success') &&
!contains(needs.*.result, 'failure')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Download the published package artifacts
uses: actions/download-artifact@v8
with:
name: ${{ startsWith(github.ref, 'refs/tags/morphir-v') && 'morphir-dist' || 'morphir-python-dist' }}
path: dist/
merge-multiple: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
files: dist/*
fail_on_unmatched_files: true
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}