wheels #3
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: Consolidate artifacts and clean extras | |
| shell: bash | |
| run: | | |
| # Move wheels from nested cibw dirs into top-level dist/ | |
| find dist -mindepth 2 -type f -name '*.whl' -exec mv -n {} dist/ \; | |
| # Remove any .zip files under dist/ (we don't publish zips to PyPI) | |
| find dist -type f -iname '*.zip' -print -delete | |
| # Remove intermediate cibw directories | |
| find dist -mindepth 1 -maxdepth 1 -type d -name 'cibw-wheels-*' -exec rm -rf {} + | |
| - name: List downloaded wheels | |
| run: ls -1 dist/ | |
| - uses: pypa/gh-action-pypi-publish@release/v1 |