RELEASE Updating to v0.8 release #7
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: "Release to PyPI" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.type }} | |
cancel-in-progress: true | |
on: | |
release: | |
types: [published] | |
push: | |
branches: | |
- main | |
workflow_run: | |
workflows: [Build Wheels] | |
branches: [main] | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
check_wheels: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get run ID of "Test" workflow | |
id: get-run-id | |
run: | | |
OTHER_REPO="${{ github.repository }}" | |
WF_NAME="Build Wheels" | |
RUN_ID=`gh run --repo ${OTHER_REPO} list --workflow ${WF_NAME} --json databaseId --jq .[0].databaseId` | |
echo "Detected latest run id of ${RUN_ID} for workflow ${WF_NAME}" | |
echo "run-id=${RUN_ID}" >> "$GITHUB_OUTPUT" | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: Download artifact from "Build Wheels" workflow | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist # Match name used in test.yml upload artifact step | |
github-token: ${{ github.token }} | |
repository: ${{ github.repository }} | |
run-id: ${{ steps.get-run-id.outputs.run-id }} | |
- name: Show downloaded files | |
run: ls -la | |
# PyPI on release | |
pypi: | |
needs: [check_wheels] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |