Skip to content

CD

CD #44

Workflow file for this run

name: CD
on:
schedule:
- cron: "0 0 * * 3"
workflow_dispatch:
jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
secrets: inherit
build_wheels:
name: Build wheels
needs: [ci]
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
runs-on: ${{ matrix.os }}
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v2
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
needs: [ci]
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
release:
name: Release
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
environment: release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Commitizen
uses: commitizen-tools/commitizen-action@master
with:
changelog_increment_filename: _changelog.md
github_token: ${{ github.token }}
no_raise: 3,21
- name: Fetch build artifacts
if: env.PREVIOUS_REVISION != env.REVISION
uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: ./dist
merge-multiple: true
- name: Release
if: env.PREVIOUS_REVISION != env.REVISION
uses: softprops/action-gh-release@v2
with:
body_path: _changelog.md
name: ${{ env.REVISION }}
files: ./dist/*
- name: Publish package to PyPI
if: env.PREVIOUS_REVISION != env.REVISION
uses: pypa/gh-action-pypi-publish@release/v1