|
11 | 11 | pull_request: |
12 | 12 |
|
13 | 13 | jobs: |
14 | | - deploy: |
| 14 | + build: |
15 | 15 | runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: Checkout source |
| 18 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 |
| 19 | + |
| 20 | + - name: Set up Python |
| 21 | + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5 |
| 22 | + with: |
| 23 | + python-version: "3.13" |
| 24 | + cache: pip |
| 25 | + cache-dependency-path: pyproject.toml |
| 26 | + |
| 27 | + - name: Install dependencies |
| 28 | + shell: bash |
| 29 | + run: python -m pip install build |
| 30 | + |
| 31 | + - name: Build distributions |
| 32 | + shell: bash |
| 33 | + run: python -m build |
| 34 | + |
| 35 | + - name: Upload distribution |
| 36 | + # yamllint disable-line rule:line-length |
| 37 | + uses: hynek/build-and-inspect-python-package@b5076c307dc91924a82ad150cdd1533b444d3310 # v2 |
| 38 | + |
| 39 | + deploy-test-pypi: |
| 40 | + if: startsWith(github.ref, 'refs/tags/') |
| 41 | + needs: build |
16 | 42 | permissions: |
17 | 43 | id-token: write |
| 44 | + runs-on: ubuntu-latest |
18 | 45 | steps: |
19 | | - # yamllint disable-line rule:line-length |
20 | | - - uses: paddyroddy/.github/actions/python/deployment@b9cde8bcbbce838802ecd0aba2c3a7f8b82f519c # v0 |
| 46 | + - name: Download distributions |
| 47 | + # yamllint disable-line rule:line-length |
| 48 | + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4 |
21 | 49 | with: |
22 | | - pyproject-toml: ./pyproject.toml |
23 | | - python-version: "3.13" |
| 50 | + name: Packages |
| 51 | + path: dist |
| 52 | + |
| 53 | + - name: Publish package to TestPyPI |
| 54 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 55 | + with: |
| 56 | + repository-url: https://test.pypi.org/legacy/ |
| 57 | + verbose: true |
| 58 | + |
| 59 | + deploy-pypi: |
| 60 | + if: startsWith(github.ref, 'refs/tags/') |
| 61 | + needs: build |
| 62 | + permissions: |
| 63 | + id-token: write |
| 64 | + runs-on: ubuntu-latest |
| 65 | + steps: |
| 66 | + - name: Download distributions |
| 67 | + # yamllint disable-line rule:line-length |
| 68 | + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4 |
| 69 | + with: |
| 70 | + name: Packages |
| 71 | + path: dist |
| 72 | + |
| 73 | + - name: Publish package to PyPI |
| 74 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 75 | + with: |
| 76 | + verbose: true |
0 commit comments