|
1 | | -name: Publish to TestPyPI and PyPI |
| 1 | +name: Publish to PyPI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | # Triggers the workflow when a release is created or edited. |
5 | 5 | release: |
6 | 6 | types: [created] |
7 | 7 |
|
8 | 8 | jobs: |
9 | | - build-n-publish: |
10 | | - name: Publish to TestPyPI and PyPI |
| 9 | + build: |
| 10 | + name: Build distribution |
11 | 11 | runs-on: ubuntu-latest |
12 | | - permissions: |
13 | | - id-token: write # For pypi trusted publishing |
14 | | - |
15 | 12 | steps: |
16 | 13 | - uses: actions/checkout@v4 |
17 | | - |
18 | 14 | - name: Set up Python |
19 | 15 | uses: actions/setup-python@v5 |
20 | 16 | with: |
21 | 17 | python-version: "3.x" |
22 | 18 |
|
23 | 19 | - name: Install pypa/build |
24 | | - run: python -m pip install build --user |
25 | | - |
| 20 | + run: python3 -m pip install build --user |
26 | 21 | - name: Build a binary wheel and a source tarball |
27 | | - run: python -m build --sdist --wheel --outdir dist/ |
28 | | - |
29 | | - - name: Publish distribution to Test PyPI |
30 | | - uses: pypa/gh-action-pypi-publish@release/v1 |
| 22 | + run: python3 -m build |
| 23 | + - name: Store the distribution packages |
| 24 | + uses: actions/upload-artifact@v4 |
31 | 25 | with: |
32 | | - repository-url: https://test.pypi.org/legacy/ |
| 26 | + name: python-package-distributions |
| 27 | + path: dist/ |
33 | 28 |
|
34 | | - - name: Publish distribution to PyPI |
| 29 | + publish-to-pypi: |
| 30 | + name: Publish to PyPI |
| 31 | + needs: |
| 32 | + - build |
| 33 | + runs-on: ubuntu-latest |
| 34 | + |
| 35 | + environment: |
| 36 | + name: pypi |
| 37 | + url: https://pypi.org/p/paramax |
| 38 | + |
| 39 | + permissions: |
| 40 | + id-token: write # Mandatory for trusted publishing |
| 41 | + |
| 42 | + steps: |
| 43 | + - name: Download all the dists |
| 44 | + uses: actions/download-artifact@v4 |
| 45 | + with: |
| 46 | + name: python-package-distributions |
| 47 | + path: dist/ |
| 48 | + - name: Publish distribution 📦 to PyPI |
35 | 49 | uses: pypa/gh-action-pypi-publish@release/v1 |
0 commit comments