Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions .bumpversion.cfg

This file was deleted.

310 changes: 310 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,310 @@
# This file is autogenerated by maturin v1.13.3
# To update, run
#
# maturin generate-ci github --pytest -o .github/workflows/release.yml
#
# Builds + tests wheels on every push/PR; publishes to PyPI on tag push.
name: Release

on:
push:
branches:
- main
- master
pull_request:
# Publishing a GitHub Release is the single source of truth for a release:
# the version is taken from the release tag and the wheels go to PyPI.
release:
types: [published]
workflow_dispatch:

permissions:
contents: read

jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
# Mainstream glibc targets with working test emulation. Other arches
# (s390x/ppc64le/32-bit) install from the sdist.
platform:
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-22.04
target: aarch64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.8"
- name: Set version from release tag
if: github.event_name == 'release'
shell: bash
env:
TAG: ${{ github.event.release.tag_name }}
run: |
V="${TAG#v}" # strip an optional leading "v"
sed -i.bak "s/^version = .*/version = \"$V\"/" Cargo.toml && rm -f Cargo.toml.bak
echo "building seqfold $V"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: wheels-linux-${{ matrix.platform.target }}
path: dist
- uses: astral-sh/setup-uv@v7
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
- name: pytest
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
shell: bash
run: |
set -e
uv venv .venv
source .venv/bin/activate
uv pip install seqfold --no-index --no-deps --find-links dist --reinstall
uv pip install seqfold pytest
pytest
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.platform.target }}
# run-on-arch-action@v2 ships no ubuntu24.04 image; ubuntu22.04 has
# the aarch64 image needed to run the emulated test step.
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-venv
run: |
set -e
python3 -m venv .venv
source .venv/bin/activate
pip install pytest
pip install seqfold --no-index --no-deps --find-links dist --force-reinstall
pip install seqfold
pytest

musllinux:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-22.04
target: aarch64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.8"
- name: Set version from release tag
if: github.event_name == 'release'
shell: bash
env:
TAG: ${{ github.event.release.tag_name }}
run: |
V="${TAG#v}" # strip an optional leading "v"
sed -i.bak "s/^version = .*/version = \"$V\"/" Cargo.toml && rm -f Cargo.toml.bak
echo "building seqfold $V"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: musllinux_1_2
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: wheels-musllinux-${{ matrix.platform.target }}
path: dist
- name: pytest
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
run: |
set -e
docker run --rm -v ${{ github.workspace }}:/io -w /io alpine:latest sh -c '
apk add py3-pip py3-virtualenv
python3 -m virtualenv .venv
source .venv/bin/activate
pip install seqfold --no-index --no-deps --find-links dist --force-reinstall
pip install seqfold pytest
pytest
'
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'x86') }}
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.platform.target }}
distro: alpine_latest
githubToken: ${{ github.token }}
install: |
apk add py3-virtualenv
run: |
set -e
python3 -m virtualenv .venv
source .venv/bin/activate
pip install seqfold --no-index --no-deps --find-links dist --force-reinstall
pip install seqfold pytest
pytest

windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
# 32-bit Windows (x86) is dropped: setup-python can't reliably provide
# 32-bit CPython 3.13, and it's a legacy target with ~no users. Those
# install from the sdist.
platform:
- runner: windows-latest
target: x64
python_arch: x64
- runner: windows-11-arm
target: aarch64
python_arch: arm64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.13"
architecture: ${{ matrix.platform.python_arch }}
- name: Set version from release tag
if: github.event_name == 'release'
shell: bash
env:
TAG: ${{ github.event.release.tag_name }}
run: |
V="${TAG#v}" # strip an optional leading "v"
sed -i.bak "s/^version = .*/version = \"$V\"/" Cargo.toml && rm -f Cargo.toml.bak
echo "building seqfold $V"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: wheels-windows-${{ matrix.platform.target }}
path: dist
- uses: astral-sh/setup-uv@v7
- name: pytest
shell: bash
run: |
set -e
uv venv .venv
source .venv/Scripts/activate
uv pip install seqfold --no-index --no-deps --find-links dist --reinstall
uv pip install seqfold pytest
pytest

macos:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: macos-15-intel
target: x86_64
- runner: macos-latest
target: aarch64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.8"
- name: Set version from release tag
if: github.event_name == 'release'
shell: bash
env:
TAG: ${{ github.event.release.tag_name }}
run: |
V="${TAG#v}" # strip an optional leading "v"
sed -i.bak "s/^version = .*/version = \"$V\"/" Cargo.toml && rm -f Cargo.toml.bak
echo "building seqfold $V"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: wheels-macos-${{ matrix.platform.target }}
path: dist
- uses: astral-sh/setup-uv@v7
- name: pytest
run: |
set -e
uv venv .venv
source .venv/bin/activate
uv pip install seqfold --no-index --no-deps --find-links dist --reinstall
uv pip install seqfold pytest
pytest

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set version from release tag
if: github.event_name == 'release'
shell: bash
env:
TAG: ${{ github.event.release.tag_name }}
run: |
V="${TAG#v}" # strip an optional leading "v"
sed -i.bak "s/^version = .*/version = \"$V\"/" Cargo.toml && rm -f Cargo.toml.bak
echo "building seqfold $V"
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v6
with:
name: wheels-sdist
path: dist

release:
name: Release
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' || github.event_name == 'workflow_dispatch' }}
needs: [linux, musllinux, windows, macos, sdist]
# Dedicated publishing environment. Configure it under repo Settings ->
# Environments (and name it as the PyPI trusted publisher's "Environment").
# Add required reviewers there to gate who can actually publish to PyPI.
environment: pypi
permissions:
# Mint the OIDC token PyPI trusted publishing exchanges (no API token).
id-token: write
# Used to upload release artifacts
contents: write
# Used to generate artifact attestation
attestations: write
steps:
- uses: actions/download-artifact@v7
- name: Generate artifact attestation
uses: actions/attest@v4
with:
subject-path: 'wheels-*/*'
- name: Install uv
if: ${{ github.event_name == 'release' }}
uses: astral-sh/setup-uv@v7
# No token: uv uses GitHub OIDC trusted publishing (id-token: write above).
- name: Publish to PyPI
if: ${{ github.event_name == 'release' }}
run: uv publish --trusted-publishing always 'wheels-*/*'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ dmypy.json
seqfold/*.c
seqfold/*.html

# Rust / maturin build artifacts
/target
.venv/

# development/test files
/data/dna
*.stats
Expand Down
Loading
Loading