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
149 changes: 4 additions & 145 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,150 +5,9 @@ permissions:
on:
workflow_dispatch:
pull_request:
release:
types: [published, released]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Run tests
run: |
set -euo pipefail
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
maturin develop
python -m unittest

linux:
needs: [ tests ]
strategy:
fail-fast: true
matrix:
platform:
- target: x86_64
manylinux: auto
- target: aarch64
manylinux: auto
- target: x86_64-unknown-linux-musl
manylinux: musllinux_1_2
container: quay.io/pypa/musllinux_1_2_x86_64
- target: aarch64-unknown-linux-musl
manylinux: musllinux_1_2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
command: build
rust-toolchain: stable
manylinux: ${{ matrix.platform.manylinux }}
target: ${{ matrix.platform.target }}
container: ${{ matrix.platform.container }}
args: --release -o dist --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: wheel-linux-${{ matrix.platform.target }}
path: dist/*
retention-days: 1

windows:
needs: [ tests ]
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
command: build
rust-toolchain: stable
args: --release -o dist --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: wheel-windows
path: dist/*
retention-days: 1

macos:
needs: [ tests ]
strategy:
fail-fast: true
matrix:
target:
- aarch64-apple-darwin
- x86_64-apple-darwin
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
command: build
rust-toolchain: stable
args: --release -o dist --find-interpreter --target ${{ matrix.target }}
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: wheel-macos-${{ matrix.target }}
path: dist/*
retention-days: 1

sdist:
needs: [ tests ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Build source distribution
uses: PyO3/maturin-action@v1
with:
command: sdist
rust-toolchain: stable
args: -o dist
- name: Upload source distribution
uses: actions/upload-artifact@v6
with:
name: sdist
path: dist/*
retention-days: 1

publish_testpypi:
name: Publish to test.pypi.org
runs-on: ubuntu-latest
if: >
github.event_name == 'release' && github.event.action == 'published' && github.event.release.prerelease == true
needs: [ macos, windows, linux, sdist ]
permissions:
id-token: write
environment: testpypi
steps:
- uses: actions/download-artifact@v7
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip_existing: true

publish_pypi:
name: Publish to pypi.org
runs-on: ubuntu-latest
if: >
github.event_name == 'release' &&
(github.event.action == 'published' || github.event.action == 'released') &&
github.event.release.prerelease == false
needs: [ macos, windows, linux, sdist ]
permissions:
id-token: write
environment: pypi
steps:
- uses: actions/download-artifact@v7
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
build:
uses: ./.github/workflows/_build-wheels.yml
with:
upload_artifacts: false
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
61 changes: 61 additions & 0 deletions .github/workflows/Publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Publish
permissions:
contents: read

on:
workflow_dispatch:

jobs:
build:
uses: ./.github/workflows/_build-wheels.yml
with:
upload_artifacts: true

sdist:
needs: [ build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Build source distribution
uses: PyO3/maturin-action@v1
with:
command: sdist
rust-toolchain: stable
args: -o dist
- name: Upload source distribution
uses: actions/upload-artifact@v6
with:
name: sdist
path: dist/*
retention-days: 1

publish_testpypi:
name: Publish to test.pypi.org
runs-on: ubuntu-latest
needs: [ build, sdist ]
permissions:
id-token: write
environment: testpypi
steps:
- uses: actions/download-artifact@v7
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true

publish_pypi:
name: Publish to pypi.org
runs-on: ubuntu-latest
needs: [ build, sdist ]
permissions:
id-token: write
environment: pypi
steps:
- uses: actions/download-artifact@v7
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
104 changes: 104 additions & 0 deletions .github/workflows/_build-wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Build Wheels
permissions:
contents: read

on:
workflow_call:
inputs:
upload_artifacts:
required: false
default: false
type: boolean

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Run tests
run: |
set -euo pipefail
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
maturin develop
python -m unittest

linux:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: [ tests ]
strategy:
fail-fast: true
matrix:
platform:
- target: x86_64
manylinux: auto
- target: aarch64
manylinux: auto
- target: x86_64-unknown-linux-musl
manylinux: musllinux_1_2
container: quay.io/pypa/musllinux_1_2_x86_64
- target: aarch64-unknown-linux-musl
manylinux: musllinux_1_2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
command: build
rust-toolchain: stable
manylinux: ${{ matrix.platform.manylinux }}
target: ${{ matrix.platform.target }}
container: ${{ matrix.platform.container }}
args: --release -o dist --find-interpreter
- name: Upload wheels
if: ${{ inputs.upload_artifacts }}
uses: actions/upload-artifact@v6
with:
name: wheel-linux-${{ matrix.platform.target }}
path: dist/*
retention-days: 1

windows:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: [ tests ]
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
command: build
rust-toolchain: stable
args: --release -o dist --find-interpreter
- name: Upload wheels
if: ${{ inputs.upload_artifacts }}
uses: actions/upload-artifact@v6
with:
name: wheel-windows
path: dist/*
retention-days: 1

macos:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: [ tests ]
strategy:
fail-fast: true
matrix:
target:
- aarch64-apple-darwin
- x86_64-apple-darwin
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
command: build
rust-toolchain: stable
args: --release -o dist --find-interpreter --target ${{ matrix.target }}
- name: Upload wheels
if: ${{ inputs.upload_artifacts }}
uses: actions/upload-artifact@v6
with:
name: wheel-macos-${{ matrix.target }}
path: dist/*
retention-days: 1
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Loading