Skip to content

Workflow file for this run

name: Publish Python 🐍 distributions πŸ“¦ to PyPI
on:
release:
types: [published]
jobs:
pypi-publish:
name: Build and publish Python 🐍 distributions πŸ“¦ to ${{ matrix.environment.name }}
runs-on: ubuntu-latest
strategy:
matrix:
environment:
- name: testpypi
url: https://test.pypi.org/project/behave-cucumber-matcher
token: TEST_PYPI_API_TOKEN
repository-url: https://test.pypi.org/legacy/
- name: pypi
url: https://pypi.org/project/behave-cucumber-matcher
token: PYPI_API_TOKEN
repository-url: https://upload.pypi.org/legacy/
environment:
name: ${{ matrix.environment.name }}
url: ${{ matrix.environment.url }}
permissions:
id-token: write
steps:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.12"
- uses: actions/checkout@v3
- name: Build package
run: make build
- name: Publish distribution πŸ“¦ to ${{ matrix.environment.name }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets[matrix.environment.token] }}
repository-url: ${{ matrix.environment.repository-url }}