|
8 | 8 | type: choice |
9 | 9 | default: None # no publishing to any Package Index by default |
10 | 10 | options: [None, testpypi, pypi] |
| 11 | + signature-activation: |
| 12 | + type: boolean |
| 13 | + required: true |
| 14 | + default: false |
| 15 | + description: Sign khisto binary |
11 | 16 | push: |
12 | 17 | tags: ['*'] |
13 | 18 | pull_request: |
|
31 | 36 | strategy: |
32 | 37 | matrix: |
33 | 38 | os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2025-vs2026, windows-11-vs2026-arm, macos-15-intel, macos-15] |
| 39 | + env: |
| 40 | + SIGN_WINDOWS_WHEELS: ${{ github.event_name == 'workflow_dispatch' && inputs.signature-activation }} |
34 | 41 | steps: |
35 | 42 | - uses: actions/checkout@v6 |
36 | 43 |
|
|
59 | 66 | uv sync --python .test-env --group dev --no-install-project |
60 | 67 | uv run --python .test-env pytest tests/ --no-cov |
61 | 68 |
|
62 | | - - uses: actions/upload-artifact@v6 |
| 69 | + - name: Install wheel package for signing |
| 70 | + if: runner.os == 'Windows' && env.SIGN_WINDOWS_WHEELS == 'true' |
| 71 | + run: python -m pip install wheel |
| 72 | + - name: Unpack khisto wheel |
| 73 | + if: runner.os == 'Windows' && env.SIGN_WINDOWS_WHEELS == 'true' |
| 74 | + run: | |
| 75 | + mkdir -p wheelhouse/unpacked |
| 76 | + python -m wheel unpack wheelhouse/khisto-*.whl --dest wheelhouse/unpacked |
| 77 | + - name: Setup SM_CLIENT_CERT_FILE from base64 secret data |
| 78 | + if: runner.os == 'Windows' && env.SIGN_WINDOWS_WHEELS == 'true' |
| 79 | + run: | |
| 80 | + echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV" |
| 81 | + echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12 |
| 82 | + - name: Sign unpacked wheel binaries |
| 83 | + if: runner.os == 'Windows' && env.SIGN_WINDOWS_WHEELS == 'true' |
| 84 | + uses: digicert/code-signing-software-trust-action@v1.2.1 |
| 85 | + with: |
| 86 | + input: wheelhouse/unpacked/ |
| 87 | + keypair-alias: ${{ env.KEYPAIR }} |
| 88 | + simple-signing-mode: true |
| 89 | + env: |
| 90 | + SM_HOST: ${{ secrets.SM_HOST }} |
| 91 | + SM_API_KEY: ${{ secrets.SM_API_KEY }} |
| 92 | + SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }} |
| 93 | + - name: Repack signed wheels |
| 94 | + if: runner.os == 'Windows' && env.SIGN_WINDOWS_WHEELS == 'true' |
| 95 | + run: | |
| 96 | + rm wheelhouse/khisto-*.whl |
| 97 | + python -m wheel pack wheelhouse/unpacked/khisto-* --dest-dir wheelhouse |
| 98 | + - uses: actions/upload-artifact@v7 |
63 | 99 | with: |
64 | 100 | name: pkg-wheel-${{ matrix.os }} |
65 | 101 | path: wheelhouse/*.whl |
|
0 commit comments