|
11 | 11 |
|
12 | 12 | jobs:
|
13 | 13 | build:
|
14 |
| - |
15 | 14 | runs-on: ubuntu-latest
|
16 | 15 | strategy:
|
17 | 16 | matrix:
|
18 | 17 | python-version: [3.13]
|
19 |
| - |
20 | 18 | steps:
|
21 | 19 | - uses: actions/checkout@v3
|
22 | 20 | - name: Set up Python ${{ matrix.python-version }}
|
23 | 21 | uses: actions/setup-python@v4
|
24 | 22 | with:
|
25 | 23 | python-version: ${{ matrix.python-version }}
|
26 | 24 | - name: Install dependencies
|
27 |
| - run: | |
28 |
| - python -m pip install --upgrade build twine |
| 25 | + run: python -m pip install --upgrade build |
29 | 26 | - name: Create packages
|
30 | 27 | run: python -m build
|
31 |
| - - name: Run twine check |
32 |
| - run: twine check dist/* |
33 | 28 | - uses: actions/upload-artifact@v4
|
34 | 29 | with:
|
35 | 30 | name: tox-gh-actions-dist
|
36 | 31 | path: dist
|
| 32 | + |
| 33 | + pypi-publish: |
| 34 | + needs: |
| 35 | + - build |
| 36 | + runs-on: ubuntu-latest |
| 37 | + if: github.event_name == 'release' |
| 38 | + environment: pypi |
| 39 | + permissions: |
| 40 | + id-token: write # Required for using pypa/gh-actions-pypi-publish |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@v4 |
| 43 | + - uses: actions/download-artifact@v4 |
| 44 | + with: |
| 45 | + name: tox-gh-actions-dist |
| 46 | + path: dist |
| 47 | + - name: Publish package distributions to PyPI |
| 48 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 49 | + |
| 50 | + github-release: |
| 51 | + needs: |
| 52 | + - build |
| 53 | + runs-on: ubuntu-latest |
| 54 | + if: github.event_name == 'release' |
| 55 | + environment: release |
| 56 | + permissions: |
| 57 | + contents: write # Required for uploading artifacts to GitHub release |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v4 |
| 60 | + - uses: actions/download-artifact@v4 |
| 61 | + with: |
| 62 | + name: tox-gh-actions-dist |
| 63 | + path: dist |
| 64 | + - name: Upload artifacts to GitHub release |
| 65 | + working-directory: ./dist |
| 66 | + env: |
| 67 | + GH_TOKEN: ${{ github.token }} |
| 68 | + run: gh release upload "${{ github.event.release.tag_name }}" ./* |
0 commit comments