Publish on PyPI - fe0581bddb969704db57076d233f3543fd3fc475 #1
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 PyPI | |
run-name: Publish on PyPI - ${{ github.sha }} | |
on: | |
release: | |
types: [published, edited] | |
jobs: | |
publish_on_pypi: | |
name: Publish on PyPI | |
strategy: | |
matrix: | |
artifact: | |
- [build_wheels, windows, AMD64] | |
- [build_wheels, windows, x86] | |
- [build_wheels, macos, x86_64] | |
- [macos_arm64_wheels, macos, arm64] | |
- [build_wheels, linux, x86_64] | |
- [build_wheels, linux, aarch64] | |
runs-on: ubuntu-20.04 | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
steps: | |
- name: Download wheels | |
uses: dawidd6/[email protected] | |
with: | |
workflow: ${{ matrix.artifact[0] }}.yml | |
workflow_conclusion: success | |
commit: ${{github.event.pull_request.head.sha}} | |
name: wheels_${{ matrix.artifact[1] }}_${{ matrix.artifact[2] }} | |
path: dist | |
search_artifacts: true | |
- name: Download source distribution | |
uses: dawidd6/[email protected] | |
with: | |
workflow: build_wheels.yml | |
workflow_conclusion: success | |
commit: ${{github.event.pull_request.head.sha}} | |
name: sdist | |
path: dist | |
search_artifacts: true | |
- name: Publish on PyPI Test | |
if: github.event.release.prerelease == true && contains(github.event.release.tag_name, 'rc') | |
uses: pypa/[email protected] | |
with: | |
repository_url: https://test.pypi.org/legacy/ | |
skip_existing: true | |
verbose: true | |
print-hash: true | |
- name: Publish on PyPI | |
if: github.event.release.prerelease == false | |
uses: pypa/[email protected] | |
with: | |
skip_existing: true | |
verbose: true | |
print-hash: true |