Version 1.0.3 #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to PyPI | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.x"] | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@master | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install poetry | |
python -m poetry update | |
- name: Install Poetry Dependencies | |
run: | | |
python -m poetry update | |
- name: Build package | |
run: | | |
python -m poetry build | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@master | |
with: | |
name: python-package-distributions | |
path: dist/ | |
publish-to-test-pypi: | |
runs-on: ubuntu-latest | |
environment: release | |
needs: | |
- build | |
permissions: | |
id-token: write | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@master | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish distribution to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1.8 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
publish-to-pypi: | |
runs-on: ubuntu-latest | |
environment: release | |
needs: | |
- publish-to-test-pypi | |
permissions: | |
id-token: write | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@master | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1.8 |