Skip to content

Deploy

Deploy #2

Workflow file for this run

name: Deploy
on:
release:
types: [created]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-wheels:
name: Build wheels
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, macos-14]
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Build wheels
run: |
python -m pip install pipx
pipx run cibuildwheel
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels_${{ github.event.release.tag_name }}_${{ matrix.os }}
retention-days: 1
path: ./wheelhouse/*.whl
deploy:
name: Publish to Crates.io and PyPI
runs-on: ubuntu-latest
needs: [build-wheels]
environment:
name: pypi
url: https://pypi.org/p/cygv
permissions:
id-token: write
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Download wheels
uses: actions/download-artifact@v4
with:
pattern: wheels_${{ github.event.release.tag_name }}_*
merge-multiple: true
- name: Publish to Crates.io
run: |
cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1