wheels #2
This file contains hidden or 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: wheels | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Git tag to publish wheels for" | |
| required: true | |
| release: | |
| types: | |
| - published | |
| permissions: {} # No permissions are granted at the workflow level | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| FORCE_COLOR: 3 | |
| jobs: | |
| upload_all: | |
| environment: pypi | |
| permissions: | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set TAG_NAME | |
| id: vars | |
| run: | | |
| echo "TAG_NAME=${{ github.event.release.tag_name || inputs.tag }}" >> $GITHUB_OUTPUT | |
| - name: Checkout repo | |
| uses: actions/[email protected] | |
| with: | |
| fetch-depth: 0 # Required to resolve tag commits | |
| - name: Resolve commit SHA for tag | |
| id: resolve_sha | |
| run: | | |
| COMMIT_SHA=$(git rev-list -n 1 $TAG_NAME) | |
| echo "COMMIT_SHA [$COMMIT_SHA]" | |
| echo "commit-sha=$COMMIT_SHA" >> $GITHUB_OUTPUT | |
| env: | |
| TAG_NAME: ${{ steps.vars.outputs.TAG_NAME }} | |
| - name: Download artifact | |
| id: download-artifact | |
| uses: dawidd6/action-download-artifact@v11 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| workflow: ci.yml | |
| workflow_conclusion: success | |
| commit: ${{ steps.resolve_sha.outputs.commit-sha }} | |
| repo: ${{ github.repository }} | |
| name: "cibw-wheels-.+" | |
| name_is_regexp: true | |
| path: dist | |
| - name: Move all downloaded wheels to top-level dist | |
| run: | | |
| # Move any wheels from nested cibw dirs into dist/ | |
| find dist -mindepth 2 -type f -name '*.whl' -exec mv -n {} dist/ \; | |
| - name: List downloaded wheels | |
| run: ls -1 dist/ | |
| - uses: pypa/gh-action-pypi-publish@release/v1 |