|
5 | 5 | - '*.*.*' |
6 | 6 | workflow_dispatch: |
7 | 7 | jobs: |
8 | | - build-and-publish: |
9 | | - name: Build and publish Kanboard's Python package |
| 8 | + build: |
| 9 | + name: Build distribution package |
10 | 10 | runs-on: ubuntu-latest |
11 | 11 | steps: |
12 | | - - uses: actions/checkout@v4 |
13 | | - - uses: actions/setup-python@v5 |
14 | | - with: |
15 | | - python-version: '3.x' |
16 | | - - name: Install pypa/build |
17 | | - run: >- |
18 | | - python -m pip install build --user |
19 | | - - name: Build a binary wheel and a source tarball |
20 | | - run: >- |
21 | | - python -m build --sdist --wheel --outdir dist/ . |
22 | | - - name: Publish to PyPI |
23 | | - uses: pypa/gh-action-pypi-publish@release/v1 |
24 | | - with: |
25 | | - password: ${{ secrets.PYPI_API_TOKEN }} |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + - name: Set up Python |
| 14 | + uses: actions/setup-python@v5 |
| 15 | + with: |
| 16 | + python-version: "3.x" |
| 17 | + - name: Install pypa/build |
| 18 | + run: >- |
| 19 | + python3 -m |
| 20 | + pip install |
| 21 | + build |
| 22 | + --user |
| 23 | + - name: Build a binary wheel and a source tarball |
| 24 | + run: python3 -m build |
| 25 | + - name: Store the distribution packages |
| 26 | + uses: actions/upload-artifact@v4 |
| 27 | + with: |
| 28 | + name: python-package-distributions |
| 29 | + path: dist/ |
| 30 | + |
| 31 | + publish-to-pypi: |
| 32 | + name: Publish to PyPI |
| 33 | + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes |
| 34 | + needs: |
| 35 | + - build |
| 36 | + runs-on: ubuntu-latest |
| 37 | + environment: |
| 38 | + name: pypi |
| 39 | + url: https://pypi.org/p/kanboard |
| 40 | + permissions: |
| 41 | + id-token: write # IMPORTANT: mandatory for trusted publishing |
| 42 | + |
| 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 PyPI |
| 50 | + uses: pypa/gh-action-pypi-publish@release/v1 |
0 commit comments