|
7 | 7 | workflow_dispatch: |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - build-n-publish: |
11 | | - name: Publish to TestPyPI and PyPI |
| 10 | + build: |
| 11 | + name: Build distribution |
12 | 12 | runs-on: ubuntu-latest |
13 | | - permissions: |
14 | | - id-token: write # For pypi trusted publishing |
15 | | - |
16 | 13 | steps: |
17 | 14 | - uses: actions/checkout@v4 |
18 | | - |
19 | 15 | - name: Set up Python |
20 | 16 | uses: actions/setup-python@v5 |
21 | 17 | with: |
22 | 18 | python-version: "3.x" |
23 | 19 |
|
24 | 20 | - name: Install pypa/build |
25 | | - run: python -m pip install build --user |
26 | | - |
| 21 | + run: python3 -m pip install build --user |
27 | 22 | - name: Build a binary wheel and a source tarball |
28 | | - run: python -m build --sdist --wheel --outdir dist/ |
| 23 | + run: python3 -m build |
| 24 | + - name: Store the distribution packages |
| 25 | + uses: actions/upload-artifact@v4 |
| 26 | + with: |
| 27 | + name: python-package-distributions |
| 28 | + path: dist/ |
| 29 | + |
| 30 | + publish-to-testpypi: |
| 31 | + name: Publish to TestPyPI |
| 32 | + needs: |
| 33 | + - build |
| 34 | + runs-on: ubuntu-latest |
| 35 | + |
| 36 | + environment: |
| 37 | + name: testpypi |
| 38 | + url: https://test.pypi.org/p/flowjax |
| 39 | + |
| 40 | + permissions: |
| 41 | + id-token: write # IMPORTANT: mandatory for trusted publishing |
29 | 42 |
|
30 | | - - name: Publish distribution to Test PyPI |
| 43 | + steps: |
| 44 | + - name: Download all the dists |
| 45 | + uses: actions/download-artifact@v4 |
| 46 | + with: |
| 47 | + name: python-package-distributions |
| 48 | + path: dist/ |
| 49 | + - name: Publish distribution 📦 to TestPyPI |
31 | 50 | uses: pypa/gh-action-pypi-publish@release/v1 |
32 | 51 | with: |
33 | 52 | repository-url: https://test.pypi.org/legacy/ |
34 | 53 |
|
35 | | - - name: Publish distribution to PyPI |
36 | | - uses: pypa/gh-action-pypi-publish@release/v1 |
| 54 | + publish-to-pypi: |
| 55 | + name: Publish Python distribution to PyPI |
| 56 | + needs: |
| 57 | + - publish-to-testpypi |
| 58 | + runs-on: ubuntu-latest |
| 59 | + |
| 60 | + environment: |
| 61 | + name: pypi |
| 62 | + url: https://pypi.org/p/flowjax |
| 63 | + |
| 64 | + permissions: |
| 65 | + id-token: write # IMPORTANT: mandatory for trusted publishing |
| 66 | + |
| 67 | + steps: |
| 68 | + - name: Download all the dists |
| 69 | + uses: actions/download-artifact@v4 |
37 | 70 | with: |
38 | | - attestations: false # Newly introduced and seems to cause errors |
| 71 | + name: python-package-distributions |
| 72 | + path: dist/ |
| 73 | + - name: Publish distribution 📦 to PyPI |
| 74 | + uses: pypa/gh-action-pypi-publish@release/v1 |
0 commit comments