TST: migrate to official astral-sh/setup-uv action (cd.yml) #102
Workflow file for this run
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: CD | |
on: | |
push: | |
tags: v* | |
pull_request: | |
paths: | |
- .github/workflows/cd.yml | |
workflow_dispatch: | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
os: | |
- ubuntu-20.04 | |
- windows-2019 | |
- macos-13 # x86_64 | |
- macos-14 # amr64 | |
fail-fast: false | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- uses: astral-sh/setup-uv@v2 | |
with: | |
version: 0.2.18 # TODO: upgrade me | |
enable-cache: true | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build wheels for CPython | |
uses: pypa/[email protected] | |
with: | |
output-dir: dist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-${{ matrix.os }} | |
path: dist/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- uses: astral-sh/setup-uv@v2 | |
- name: Build sdist | |
run: uv build --sdist | |
- name: Upload sdist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sdist | |
path: dist/*.tar.gz | |
deploy: | |
name: Publish to PyPI | |
needs: | |
- build_wheels | |
- build_sdist | |
environment: | |
name: pypi | |
url: https://pypi.org/p/gpgi | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | |
steps: | |
- name: Download sdist | |
uses: actions/download-artifact@v4 | |
with: | |
name: sdist | |
path: dist | |
- name: Download wheels | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
pattern: wheels-* | |
merge-multiple: true | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |