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
49 changes: 42 additions & 7 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ name: Release
on:
push:
branches: [main]
workflow_dispatch:
inputs:
force_release:
description: 'Force release build (use existing tag)'
required: false
default: 'false'
type: choice
options:
- 'false'
- 'true'
release_tag:
description: 'Tag to release (e.g., cachekit-v0.1.0)'
required: false
type: string

permissions:
contents: write
Expand Down Expand Up @@ -38,31 +52,51 @@ jobs:
build-wheels:
name: Build wheels (${{ matrix.target }})
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
# Run if: release-please created a release OR manual dispatch with force_release
if: needs.release-please.outputs.release_created == 'true' || github.event.inputs.force_release == 'true'
strategy:
matrix:
include:
# Native builds - maturin auto-discovers Python interpreters
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
# Cross-compilation - must specify Python versions explicitly
# (cross containers don't have discoverable Python interpreters)
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
interpreter: -i python3.9 -i python3.10 -i python3.11 -i python3.12 -i python3.13
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.release-please.outputs.tag_name }}
# Use release-please tag or manual input tag
ref: ${{ needs.release-please.outputs.tag_name || github.event.inputs.release_tag }}

# Python setup required for native builds (macOS/Windows) to discover interpreters
# Linux uses Docker containers which have Python pre-installed
- name: Set up Python
if: matrix.os != 'ubuntu-latest'
uses: actions/setup-python@v5
with:
python-version: |
3.9
3.10
3.11
3.12
3.13

- uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
args: --release --out dist ${{ matrix.interpreter }}
manylinux: auto
rust-toolchain: stable

- uses: actions/upload-artifact@v4
with:
Expand All @@ -72,17 +106,18 @@ jobs:
build-sdist:
name: Build source distribution
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
if: needs.release-please.outputs.release_created == 'true' || github.event.inputs.force_release == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.release-please.outputs.tag_name }}
ref: ${{ needs.release-please.outputs.tag_name || github.event.inputs.release_tag }}

- uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
rust-toolchain: stable

- uses: actions/upload-artifact@v4
with:
Expand Down
Loading