Merge pull request #698 from maresb/isolate-integration-test #84
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 | |
on: | |
release: | |
types: | |
- published | |
push: | |
branches: [master, main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: build | |
run: | | |
python -m pip install wheel twine build | |
python -m build | |
- name: Check files | |
run: | | |
ls dist | |
shell: bash | |
- name: Test wheels | |
run: | | |
python -m twine check --strict dist/* | |
shell: bash | |
- name: Upload dist files for publication | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-files | |
path: dist | |
publish: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'release' }} | |
needs: build | |
# Run this job in an isolated GHA environment containing the OIDC credentials. | |
environment: release | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: dist-files | |
path: dist | |
- name: Publish a Python distribution to PyPI | |
uses: pypa/[email protected] |