symlink readme because python packaging does not like ../
#3
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: python release | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
permissions: | |
contents: write | |
jobs: | |
create-release: | |
name: create-release | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get the release version from the tag | |
if: env.VERSION == '' | |
run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | |
outputs: | |
version: ${{ env.VERSION }} | |
linux: | |
runs-on: ubuntu-22.04 | |
needs: ["create-release"] | |
strategy: | |
matrix: | |
target: [x86_64, aarch64] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --manifest-path pywellen/Cargo.toml --out dist --find-interpreter | |
sccache: "true" | |
manylinux: auto | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-linux-${{ matrix.target }} | |
path: dist | |
macos: | |
runs-on: macos-latest | |
needs: ["create-release"] | |
strategy: | |
matrix: | |
target: [x86_64, aarch64] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --manifest-path pywellen/Cargo.toml --out dist --find-interpreter | |
sccache: "true" | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-macos-${{ matrix.target }} | |
path: dist | |
sdist: | |
# switch back to ubuntu-22.04 once this issue is resolved: | |
# https://github.com/PyO3/maturin-action/issues/291 | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
uses: PyO3/maturin-action@v1 | |
with: | |
command: sdist | |
args: --manifest-path pywellen/Cargo.toml --out dist | |
- name: Upload sdist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-sdist | |
path: dist | |
release: | |
name: Release | |
runs-on: ubuntu-22.04 | |
if: "startsWith(github.ref, 'refs/tags/')" | |
needs: [linux, macos, sdist] | |
steps: | |
- uses: actions/download-artifact@v4 | |
- name: Publish to PyPI | |
uses: PyO3/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
with: | |
command: upload | |
args: --non-interactive --skip-existing wheels-*/* |