Merge pull request #31 from transferwise/minor_fixes #22
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 package to pypi | |
on: | |
pull_request: | |
branches: [pypi-publish] | |
push: | |
branches: [main] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
environment: release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: python -m pip install --upgrade pip twine build poetry | |
- name: Poetry single source of truth tag add on | |
run: poetry self add poetry-version-plugin | |
- name: Setup virtual environment | |
run: poetry install | |
- name: Build distributable package | |
run: poetry build | |
- name: Check distributable | |
run: twine check --strict dist/*.whl | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true | |
password: ${{ secrets.PYPI_API_TOKEN }} |