Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 139 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: Release wheels

# Builds wheels for Linux / macOS / Windows × Python 3.10–3.13 and
# publishes them to PyPI on a tag push. Trigger:
# git tag v0.1.1 && git push --tags
# Or manually via the Actions tab → "Run workflow".

on:
push:
tags:
- "v*"
workflow_dispatch:

permissions:
contents: read

jobs:
linux:
name: build linux ${{ matrix.target }} py${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [x86_64, aarch64]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: build wheel
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist -i python${{ matrix.python-version }}
manylinux: auto

- uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.target }}-py${{ matrix.python-version }}
path: dist

macos:
name: build macos ${{ matrix.target }} py${{ matrix.python-version }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
target: [x86_64, aarch64]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: build wheel
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist -i python${{ matrix.python-version }}

- uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.target }}-py${{ matrix.python-version }}
path: dist

windows:
name: build windows x86_64 py${{ matrix.python-version }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: build wheel
uses: PyO3/maturin-action@v1
with:
target: x86_64
args: --release --out dist -i python${{ matrix.python-version }}

- uses: actions/upload-artifact@v4
with:
name: wheels-windows-x86_64-py${{ matrix.python-version }}
path: dist

sdist:
name: build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist

- uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist

publish:
name: publish to PyPI
needs: [linux, macos, windows, sdist]
runs-on: ubuntu-latest
# Only run on tag push, not on manual dispatch (use dispatch for build-only dry runs).
if: startsWith(github.ref, 'refs/tags/v')
# Trusted Publishing (OIDC). Configure at:
# https://pypi.org/manage/account/publishing/
# with: project=hebb-py, owner=hebb-project, repo=hebb,
# workflow=release.yml, environment=pypi
environment:
name: pypi
url: https://pypi.org/p/hebb-py
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist

- name: publish to PyPI
uses: PyO3/maturin-action@v1
with:
command: upload
args: --non-interactive --skip-existing dist/*
Loading