|
1 | 1 | name: Release |
| 2 | + |
2 | 3 | on: |
3 | 4 | workflow_dispatch: |
4 | 5 | push: |
5 | 6 | tags: ["v*"] |
6 | 7 |
|
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
7 | 11 | jobs: |
8 | | - bundle: |
| 12 | + source-assets: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + - uses: actions/setup-python@v5 |
| 17 | + with: {python-version: "3.11", cache: pip} |
| 18 | + - run: python -m pip install -e ".[dev]" build |
| 19 | + - run: ruff format --check . |
| 20 | + - run: ruff check . |
| 21 | + - run: python -m pytest tests/unit -q |
| 22 | + - run: python scripts/validate_schemas.py |
| 23 | + - run: python scripts/validate_skill.py . |
| 24 | + - run: python scripts/security_scan.py . |
| 25 | + - run: python -m build |
| 26 | + - run: python scripts/generate_supply_chain_docs.py |
| 27 | + - uses: actions/upload-artifact@v4 |
| 28 | + with: |
| 29 | + name: release-source-assets |
| 30 | + path: | |
| 31 | + dist/multi_api_test_executor-*.whl |
| 32 | + dist/multi_api_test_executor-*.tar.gz |
| 33 | + build/release/sbom.cdx.json |
| 34 | + build/release/THIRD_PARTY_LICENSES.txt |
| 35 | +
|
| 36 | + native-bundles: |
9 | 37 | strategy: |
10 | 38 | fail-fast: false |
11 | 39 | matrix: |
12 | 40 | include: |
13 | | - - {os: windows-latest, artifact: windows-x64} |
14 | | - - {os: ubuntu-latest, artifact: linux-x64} |
15 | | - - {os: macos-15-intel, artifact: macos-x64} |
16 | | - - {os: macos-14, artifact: macos-arm64} |
| 41 | + - {os: windows-latest, platform: windows-x64} |
| 42 | + - {os: ubuntu-latest, platform: linux-x64} |
| 43 | + - {os: macos-15-intel, platform: macos-x64} |
17 | 44 | runs-on: ${{ matrix.os }} |
18 | 45 | steps: |
19 | 46 | - uses: actions/checkout@v4 |
20 | 47 | - uses: actions/setup-python@v5 |
21 | 48 | with: {python-version: "3.11", cache: pip} |
22 | 49 | - run: python -m pip install -e ".[dev]" build pyinstaller |
23 | | - - run: ruff check . |
24 | | - - run: python -m pytest --cov --cov-branch -q |
25 | | - - run: python scripts/validate_schemas.py |
26 | | - - run: python scripts/validate_skill.py . |
27 | 50 | - run: python -m build |
28 | | - - run: python -m pip download --dest wheelhouse dist/*.whl |
| 51 | + - run: python -m pip download --dest wheelhouse . |
29 | 52 | - run: python scripts/build_binary.py |
30 | 53 | - run: python scripts/generate_supply_chain_docs.py |
31 | | - - run: python scripts/build_skill_bundle.py --platform ${{ matrix.artifact }} |
| 54 | + - run: python scripts/build_skill_bundle.py --platform ${{ matrix.platform }} |
| 55 | + - run: python scripts/verify_checksums.py build/release/SHA256SUMS.txt build/release |
| 56 | + - if: runner.os == 'Windows' |
| 57 | + run: powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/ci_bundle_smoke.ps1 -BundleZip build/release/multi-api-test-executor-0.1.0-${{ matrix.platform }}.zip |
| 58 | + - if: runner.os != 'Windows' |
| 59 | + run: sh scripts/ci_bundle_smoke.sh build/release/multi-api-test-executor-0.1.0-${{ matrix.platform }}.zip |
| 60 | + - run: python scripts/package_release_asset.py --bundle build/release/multi-api-test-executor-0.1.0-${{ matrix.platform }}.zip --platform ${{ matrix.platform }} --tag ${{ github.ref_name }} |
32 | 61 | - uses: actions/upload-artifact@v4 |
33 | 62 | with: |
34 | | - name: multi-api-test-executor-${{ matrix.artifact }} |
35 | | - path: build/release/* |
| 63 | + name: release-${{ matrix.platform }} |
| 64 | + path: build/release-assets/* |
36 | 65 |
|
37 | 66 | publish: |
38 | 67 | if: startsWith(github.ref, 'refs/tags/') |
39 | | - needs: bundle |
| 68 | + needs: [source-assets, native-bundles] |
40 | 69 | runs-on: ubuntu-latest |
41 | | - permissions: {contents: write} |
| 70 | + permissions: |
| 71 | + contents: write |
42 | 72 | steps: |
| 73 | + - uses: actions/checkout@v4 |
43 | 74 | - uses: actions/download-artifact@v4 |
44 | 75 | with: {path: artifacts, merge-multiple: true} |
45 | | - - run: sha256sum artifacts/* > artifacts/SHA256SUMS.txt |
| 76 | + - name: Write aggregate checksums |
| 77 | + run: | |
| 78 | + python - <<'PY' |
| 79 | + from hashlib import sha256 |
| 80 | + from pathlib import Path |
| 81 | + root = Path("artifacts") |
| 82 | + files = sorted(path for path in root.iterdir() if path.is_file()) |
| 83 | + (root / "SHA256SUMS.txt").write_text( |
| 84 | + "\n".join(f"{sha256(path.read_bytes()).hexdigest()} {path.name}" for path in files) + "\n", |
| 85 | + encoding="utf-8", |
| 86 | + ) |
| 87 | + PY |
46 | 88 | - uses: softprops/action-gh-release@v2 |
47 | 89 | with: |
48 | 90 | files: artifacts/* |
49 | | - generate_release_notes: true |
| 91 | + body_path: docs/release-notes-v0.1.0.md |
| 92 | + prerelease: ${{ contains(github.ref_name, '-') }} |
| 93 | + fail_on_unmatched_files: true |
0 commit comments