Release v0.0.1 #19
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: Release | |
run-name: Release ${{ github.ref_name }} | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
build-wheels: | |
name: Build wheels for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-13, macos-14] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v3 | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.17.0 | |
- name: Build wheels | |
run: python -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
build-sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-sdist | |
path: dist/*.tar.gz | |
publish-to-pypi: | |
name: Publish to PyPI | |
runs-on: ubuntu-latest | |
needs: [build-wheels, build-sdist] | |
environment: | |
name: pypi | |
url: https://pypi.org/p/xsuite-kernels | |
permissions: | |
id-token: write | |
steps: | |
- name: Check tag is a public release | |
id: check-tag | |
run: | | |
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
echo "match=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Download all the dists | |
if: steps.check-tag.outputs.match == 'true' | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: dist-* | |
path: dist | |
merge-multiple: true | |
- name: Publish to PyPI | |
if: steps.check-tag.outputs.match == 'true' | |
uses: pypa/gh-action-pypi-publish@release/v1 |