update release process #96
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 on GitHub & PyPI | |
on: | |
push: | |
tags: | |
- "v*" | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
CMEEL_LOG_LEVEL: DEBUG | |
jobs: | |
wheel: | |
name: "Build ${{ matrix.python }} ${{ matrix.os }}" | |
runs-on: "${{ matrix.os }}" | |
strategy: | |
matrix: | |
os: ["ubuntu-24.04", "ubuntu-24.04-arm", "macos-13", "macos-14"] | |
python: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313"] | |
exclude: | |
- os: "macos-14" | |
python: "cp38" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- run: pipx install cibuildwheel | |
- run: cibuildwheel | |
env: | |
CIBW_BUILD: "${{ matrix.python }}-*" | |
CIBW_SKIP: "*-musllinux_aarch64" | |
CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux_2_28_x86_64" | |
CIBW_MANYLINUX_AARCH64_IMAGE: "quay.io/pypa/manylinux_2_28_aarch64" | |
CIBW_REPAIR_WHEEL_COMMAND: "" | |
CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL="DEBUG" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: "artifact-${{ matrix.os }}-${{ matrix.python }}" | |
path: wheelhouse | |
test: | |
needs: ["wheel"] | |
name: "Test ${{ matrix.python }} ${{ matrix.os }}" | |
runs-on: "${{ matrix.os }}" | |
strategy: | |
matrix: | |
os: ["ubuntu-24.04", "ubuntu-24.04-arm", "macos-13", "macos-14"] | |
python: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313"] | |
exclude: | |
- os: "macos-14" | |
python: "cp38" | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: "artifact-${{ matrix.os }}-${{ matrix.python }}" | |
path: wheelhouse | |
- run: echo "${{ matrix.python }}" | sed "s/cp3/PYTHON_VERSION=3./" >> "${GITHUB_ENV}" | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: index | |
run: | | |
python -m pip install -U pip | |
python -m pip install wheel simple503 | |
python -m simple503 --base-url ${{ github.workspace }}/wheelhouse ${{ github.workspace }}/wheelhouse | |
- name: install deps | |
run: python -m pip install cmeel numpy | |
- name: install wheel | |
run: python -m pip install -i "file://${{ github.workspace }}/wheelhouse" cmeel-boost | |
sdist: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.13 | |
- name: setup | |
run: | | |
python -m pip install -U pip | |
python -m pip install build cmeel[build] numpy | |
- name: build sdist | |
run: python -m build -nso dist . | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-sdist | |
path: dist | |
release: | |
needs: ["wheel", "sdist"] | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
runs-on: ubuntu-24.04 | |
environment: release | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref_name }} | |
- run: curl https://github.com/nim65s.gpg | gpg --import | |
- name: validate signature | |
run: > | |
git verify-tag --raw ${{ github.ref_name }} 2>&1 | |
| grep -q 'VALIDSIG 9B1A79065D2F2B806C8A5A1C7D2ACDAF4653CF28' | |
- uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
path: dist | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true |