|
10 | 10 | pull_request: |
11 | 11 | branches: |
12 | 12 | - master |
| 13 | + - develop |
| 14 | + |
| 15 | +permissions: |
| 16 | + id-token: write |
| 17 | + attestations: write |
13 | 18 |
|
14 | 19 | jobs: |
15 | 20 | build_install: |
|
35 | 40 |
|
36 | 41 | package-deploy: |
37 | 42 | name: Build the Python package, and deploy if needed |
38 | | - runs-on: ubuntu-latest |
| 43 | + runs-on: public-ledgerhq-shared-small |
39 | 44 | needs: build_install |
40 | 45 | steps: |
41 | 46 | - name: Clone |
@@ -69,22 +74,43 @@ jobs: |
69 | 74 | fi |
70 | 75 | echo "- Tag version: ${{ env.TAG_VERSION }}"; |
71 | 76 |
|
72 | | - - name: Publish Python package on test.pypi.org |
73 | | - if: success() && github.event_name == 'push' |
74 | | - run: python -m twine upload --repository testpypi dist/* |
| 77 | + - name: Publish Python package on pypi.org |
| 78 | + if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') |
| 79 | + run: python -m twine upload dist/* |
75 | 80 | env: |
76 | 81 | TWINE_USERNAME: __token__ |
77 | | - TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PUBLIC_API_TOKEN }} |
| 82 | + TWINE_PASSWORD: ${{ secrets.PYPI_PUBLIC_API_TOKEN }} |
78 | 83 | TWINE_NON_INTERACTIVE: 1 |
79 | 84 |
|
80 | | - - name: Publish Python package on pypi.org |
| 85 | + - name: Login to Ledger Artifactory |
| 86 | + if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') |
| 87 | + timeout-minutes: 10 |
| 88 | + id: jfrog-login |
| 89 | + uses: LedgerHQ/actions-security/actions/jfrog-login@actions/jfrog-login-1 |
| 90 | + |
| 91 | + - name: Publish Python package on Ledger Artifactory |
81 | 92 | if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') |
82 | 93 | run: python -m twine upload dist/* |
83 | 94 | env: |
84 | | - TWINE_USERNAME: __token__ |
85 | | - TWINE_PASSWORD: ${{ secrets.PYPI_PUBLIC_API_TOKEN }} |
| 95 | + TWINE_REPOSITORY_URL: https://jfrog.ledgerlabs.net/artifactory/api/pypi/embedded-apps-pypi-prod-green |
| 96 | + TWINE_USERNAME: ${{ steps.jfrog-login.outputs.oidc-user }} |
| 97 | + TWINE_PASSWORD: ${{ steps.jfrog-login.outputs.oidc-token }} |
86 | 98 | TWINE_NON_INTERACTIVE: 1 |
87 | 99 |
|
| 100 | + - name: Generate library build attestations |
| 101 | + if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') |
| 102 | + timeout-minutes: 10 |
| 103 | + uses: LedgerHQ/actions-security/actions/attest@actions/attest-1 |
| 104 | + with: |
| 105 | + subject-path: dist/* |
| 106 | + |
| 107 | + - name: Sign library artifacts |
| 108 | + if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') |
| 109 | + timeout-minutes: 10 |
| 110 | + uses: LedgerHQ/actions-security/actions/sign-blob@actions/sign-blob-1 |
| 111 | + with: |
| 112 | + path: dist |
| 113 | + |
88 | 114 | - name: Publish a release on the repo |
89 | 115 | if: | |
90 | 116 | success() && |
|
0 commit comments