Skip to content

Release

Release #2

Workflow file for this run

name: Release
on:
push:
tags:
- "v*" # Runs only when a version tag (e.g., v1.0.0) is pushed.
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
build_wheels:
name: Build wheels on ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform: manylinux
- os: macos-latest
platform: mac
- os: windows-latest
platform: windows
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install cibuildwheel
run: pipx install cibuildwheel==2.23.1
- name: Build wheels
run: cibuildwheel --output-dir wheelhouse .
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.platform }}
path: wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build SDist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
publish:
needs: [build_sdist, build_wheels]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/compas_shapeop
permissions:
id-token: write # Required for PyPI trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- name: List files before upload
run: ls -lhR dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1