| 1 |
name: Publish |
| 2 |
on: |
| 3 |
push: |
| 4 |
tags: |
| 5 |
- '*' |
| 6 |
jobs: |
| 7 |
build: |
| 8 |
runs-on: ubuntu-latest |
| 9 |
steps: |
| 10 |
- uses: actions/checkout@v3 |
| 11 |
|
| 12 |
- uses: actions/setup-python@v3 |
| 13 |
with: |
| 14 |
python-version: 3.12 |
| 15 |
|
| 16 |
- run: | |
| 17 |
pip install poetry |
| 18 |
poetry build |
| 19 |
- uses: actions/upload-artifact@v3 |
| 20 |
with: |
| 21 |
path: ./dist |
| 22 |
|
| 23 |
pypi-publish: |
| 24 |
needs: ['build'] |
| 25 |
environment: 'publish' |
| 26 |
|
| 27 |
name: upload release to PyPI |
| 28 |
runs-on: ubuntu-latest |
| 29 |
permissions: |
| 30 |
# IMPORTANT: this permission is mandatory for trusted publishing |
| 31 |
id-token: write |
| 32 |
steps: |
| 33 |
- uses: actions/download-artifact@v3 |
| 34 |
|
| 35 |
- name: Publish package distributions to PyPI |
| 36 |
uses: pypa/gh-action-pypi-publish@release/v1 |
| 37 |
with: |
| 38 |
packages_dir: artifact/ |