| 1 |
|
| 2 |
name: Semantic Release |
| 3 |
|
| 4 |
on: |
| 5 |
push: |
| 6 |
branches: |
| 7 |
- master |
| 8 |
|
| 9 |
jobs: |
| 10 |
release: |
| 11 |
runs-on: ubuntu-latest |
| 12 |
permissions: |
| 13 |
id-token: write |
| 14 |
contents: write |
| 15 |
|
| 16 |
steps: |
| 17 |
- uses: actions/checkout@v6 |
| 18 |
with: |
| 19 |
fetch-depth: 0 |
| 20 |
|
| 21 |
- name: Set up Python |
| 22 |
uses: actions/setup-python@v6 |
| 23 |
with: |
| 24 |
python-version: "3.x" |
| 25 |
|
| 26 |
- name: Python Semantic Release |
| 27 |
id: release |
| 28 |
uses: python-semantic-release/python-semantic-release@v10 |
| 29 |
with: |
| 30 |
github_token: ${{ secrets.GITHUB_TOKEN }} |
| 31 |
|
| 32 |
- name: Install pypa/build |
| 33 |
run: >- |
| 34 |
python3 -m |
| 35 |
pip install |
| 36 |
build |
| 37 |
--user |
| 38 |
- name: Build a binary wheel and a source tarball |
| 39 |
run: python3 -m build |
| 40 |
- name: Store the distribution packages |
| 41 |
uses: actions/upload-artifact@v7 |
| 42 |
with: |
| 43 |
name: python-package-distributions |
| 44 |
path: dist/ |
| 45 |
|
| 46 |
- run: python3 -m pip install --upgrade build && python3 -m build |
| 47 |
|
| 48 |
- name: Publish package distributions to PyPI |
| 49 |
uses: pypa/gh-action-pypi-publish@release/v1 |
| 50 |
if: steps.release.outputs.released == 'true' |
| 51 |
|
| 52 |
- name: Publish package distributions to GitHub Releases |
| 53 |
uses: python-semantic-release/publish-action@v10 |
| 54 |
if: steps.release.outputs.released == 'true' |
| 55 |
with: |
| 56 |
github_token: ${{ secrets.GITHUB_TOKEN }} |