👷 ci: fix artifact name repeat (#7) #3
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | |
| workflow_dispatch: | |
| jobs: | |
| release-build: | |
| runs-on: ${{ matrix.platform.runner }} | |
| strategy: | |
| matrix: | |
| platform: | |
| - {"runner": "ubuntu-latest", "os": "linux", "target": "x86_64"} | |
| - {"runner": "ubuntu-latest", "os": "linux", "target": "aarch64"} | |
| - {"runner": "ubuntu-latest", "os": "linux", "target": "i386"} | |
| - {"runner": "windows-latest", "os": "win", "target": "amd64"} | |
| - {"runner": "windows-latest", "os": "win", "target": "arm64"} | |
| - {"runner": "windows-latest", "os": "win", "target": "i386"} | |
| - {"runner": "macos-latest", "os": "mac", "target": "x86_64"} | |
| - {"runner": "macos-latest", "os": "mac", "target": "arm64"} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: build release distributions | |
| run: | | |
| uv build | |
| - name: upload dists | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.platform.os }}-${{ matrix.platform.target }} | |
| path: dist/ | |
| publish-pypi: | |
| runs-on: ubuntu-latest | |
| name: Publish to PyPI | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: | |
| - release-build | |
| permissions: | |
| id-token: write | |
| strategy: | |
| matrix: | |
| platform: | |
| - {"runner": "ubuntu-latest", "os": "linux", "target": "x86_64"} | |
| - {"runner": "ubuntu-latest", "os": "linux", "target": "aarch64"} | |
| - {"runner": "ubuntu-latest", "os": "linux", "target": "i386"} | |
| - {"runner": "windows-latest", "os": "win", "target": "amd64"} | |
| - {"runner": "windows-latest", "os": "win", "target": "arm64"} | |
| - {"runner": "windows-latest", "os": "win", "target": "i386"} | |
| - {"runner": "macos-latest", "os": "mac", "target": "x86_64"} | |
| - {"runner": "macos-latest", "os": "mac", "target": "arm64"} | |
| steps: | |
| - name: Retrieve release distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ matrix.platform.os }}-${{ matrix.platform.target }} | |
| path: dist/ | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Publish release distributions to PyPI | |
| run: uv publish -v | |
| publish-release: | |
| runs-on: ubuntu-latest | |
| name: Publish to GitHub | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: | |
| - release-build | |
| permissions: | |
| contents: write | |
| strategy: | |
| matrix: | |
| platform: | |
| - {"runner": "ubuntu-latest", "os": "linux", "target": "x86_64"} | |
| - {"runner": "ubuntu-latest", "os": "linux", "target": "aarch64"} | |
| - {"runner": "ubuntu-latest", "os": "linux", "target": "i386"} | |
| - {"runner": "windows-latest", "os": "win", "target": "amd64"} | |
| - {"runner": "windows-latest", "os": "win", "target": "arm64"} | |
| - {"runner": "windows-latest", "os": "win", "target": "i386"} | |
| - {"runner": "macos-latest", "os": "mac", "target": "x86_64"} | |
| - {"runner": "macos-latest", "os": "mac", "target": "arm64"} | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ matrix.platform.os }}-${{ matrix.platform.target }} | |
| path: dist/ | |
| - name: Get tag name | |
| run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
| - name: Publish to GitHub | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| files: dist/* | |
| tag_name: ${{ env.RELEASE_VERSION }} |