Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve release workflow + update dependencies. #252

Merged
merged 78 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
db04504
Fix release workflow.
benjaminrwilson Feb 27, 2024
e73ba3c
Remove test release conditional.
benjaminrwilson Feb 27, 2024
a72c57c
Add non-interactive flag.
benjaminrwilson Feb 27, 2024
9d65c69
Update upload command.
benjaminrwilson Feb 27, 2024
69dc758
Update workflow.
benjaminrwilson Feb 28, 2024
30a912e
Update workflow.
benjaminrwilson Feb 28, 2024
89cd07d
Revert to token based authentication since OIDC fails with no informa…
benjaminrwilson Feb 28, 2024
cf3af79
Remove windows.
benjaminrwilson Feb 28, 2024
5d436de
Update release.
benjaminrwilson Feb 28, 2024
ebcd5ea
Update release.
benjaminrwilson Feb 28, 2024
24c284b
Update release.
benjaminrwilson Feb 28, 2024
36db926
Update release.
benjaminrwilson Feb 28, 2024
72eb8a8
Update pyproject.toml.
benjaminrwilson Feb 28, 2024
e63feea
Update version for testing.
benjaminrwilson Feb 28, 2024
c24a10b
Update lockfile + Cargo.
benjaminrwilson Feb 28, 2024
01bd4ce
Format tutorials.
benjaminrwilson Jan 21, 2025
008cdda
Fix linting + compile issues.
benjaminrwilson Jan 21, 2025
230f5b8
Upgrade deps.
benjaminrwilson Jan 21, 2025
049123a
Fix clippy.
benjaminrwilson Jan 21, 2025
ed9f55b
Update CI.
benjaminrwilson Jan 21, 2025
8a4dae6
Fix tests.
benjaminrwilson Jan 22, 2025
6760713
Fix ruff.
benjaminrwilson Jan 22, 2025
1eaa2c3
Fix mypy.
benjaminrwilson Jan 22, 2025
a398f95
Sync numpy version with env.
benjaminrwilson Jan 22, 2025
381361b
Add python versions + make mypy available.
benjaminrwilson Jan 22, 2025
8bd3d2c
Remove 3.14.
benjaminrwilson Jan 22, 2025
ca07b89
Fix typing.
benjaminrwilson Jan 22, 2025
8940c8f
Change sort to stable.
benjaminrwilson Jan 23, 2025
77c4a06
Update GH actions.
benjaminrwilson Jan 23, 2025
649410e
Test new release.
benjaminrwilson Jan 23, 2025
09b76ca
Test new release.
benjaminrwilson Jan 23, 2025
9ffebb1
Test new release.
benjaminrwilson Jan 23, 2025
5d551d1
Test new release.
benjaminrwilson Jan 23, 2025
62b7187
Test new release.
benjaminrwilson Jan 23, 2025
624407a
Test new release.
benjaminrwilson Jan 23, 2025
5c69d8c
Test new release.
benjaminrwilson Jan 23, 2025
98f07ad
Add test release.
benjaminrwilson Jan 23, 2025
84030c5
Update release.
benjaminrwilson Jan 24, 2025
b8fdc2a
Update release.
benjaminrwilson Jan 24, 2025
465067c
Update release.
benjaminrwilson Jan 24, 2025
02491c9
Update release.
benjaminrwilson Jan 24, 2025
98f43b5
Update release.
benjaminrwilson Jan 24, 2025
c77fb00
Update release.
benjaminrwilson Jan 24, 2025
13e5591
Update release.
benjaminrwilson Jan 24, 2025
9550fbf
Update release.
benjaminrwilson Jan 24, 2025
29f60a5
Update release.
benjaminrwilson Jan 24, 2025
b4090f6
Update release.
benjaminrwilson Jan 24, 2025
03f9e3e
Test generated file.
benjaminrwilson Jan 24, 2025
f7a212d
Test generated file.
benjaminrwilson Jan 24, 2025
45f936a
Test generated file.
benjaminrwilson Jan 24, 2025
285716b
Test generated file.
benjaminrwilson Jan 24, 2025
28c489d
Test generated file.
benjaminrwilson Jan 24, 2025
215c6db
Test generated file.
benjaminrwilson Jan 25, 2025
4a0c15e
Test generated file.
benjaminrwilson Jan 25, 2025
52f5061
Test generated file.
benjaminrwilson Jan 25, 2025
5bdaa97
Test generated file.
benjaminrwilson Jan 25, 2025
b301544
Update release.
benjaminrwilson Jan 25, 2025
3c2cd36
Update release.
benjaminrwilson Jan 25, 2025
f2ee0c4
Update release.
benjaminrwilson Jan 25, 2025
40b747d
Update release.
benjaminrwilson Jan 25, 2025
622686b
Update release.
benjaminrwilson Jan 25, 2025
9a270f4
Update release.
benjaminrwilson Jan 25, 2025
9843b55
Update release.
benjaminrwilson Jan 25, 2025
3146a08
Update release.
benjaminrwilson Jan 25, 2025
8465449
Update release.
benjaminrwilson Jan 25, 2025
ea590a5
Update release.
benjaminrwilson Jan 25, 2025
23d5ab4
Update release.
benjaminrwilson Jan 25, 2025
f9df811
Update release.
benjaminrwilson Jan 25, 2025
3924456
Update release.
benjaminrwilson Jan 27, 2025
142710d
Update ci.
benjaminrwilson Jan 27, 2025
d3e164d
Update ci.
benjaminrwilson Jan 27, 2025
29364f3
Update ci.
benjaminrwilson Jan 27, 2025
60d3af3
Update ci.
benjaminrwilson Jan 27, 2025
361238a
Update ci.
benjaminrwilson Jan 27, 2025
3863f9c
Update ci.
benjaminrwilson Jan 27, 2025
b781096
Update release.
benjaminrwilson Jan 27, 2025
4e2ca8d
Update release.
benjaminrwilson Jan 27, 2025
5f7aa4f
Change version.
benjaminrwilson Jan 27, 2025
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
9 changes: 5 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
os: [macos-latest, ubuntu-latest, windows-latest]
python_version:
["3.9", "3.10", "3.11"]
["3.9", "3.10", "3.11", "3.12"]
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: av2
conda-remove-defaults: true
environment-file: conda/environment.yml
mamba-version: "*"
miniforge-version: latest
Expand Down
34 changes: 18 additions & 16 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: cargo fmt
Expand All @@ -24,8 +24,8 @@ jobs:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: cargo clippy
Expand All @@ -35,7 +35,7 @@ jobs:
name: Black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.x'
Expand All @@ -45,27 +45,29 @@ jobs:
name: Ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- run: pip install ruff
- run: ruff .
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3

mypy:
name: Mypy
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: '3.x'
- run: pip install mypy numpy
activate-environment: av2
environment-file: conda/environment.yml
mamba-version: "*"
miniforge-version: latest
- run: mamba install mypy -y
- run: mypy .

# spell_check:
# name: Spellcheck
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/checkout@v4
# - uses: codespell-project/actions-codespell@master
207 changes: 147 additions & 60 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,130 +1,217 @@
name: "[av2] Release"
name: release

on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read

jobs:
linux:
runs-on: ubuntu-latest
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
target: [x86_64, x86, aarch64]
platform:
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-22.04
target: x86
- runner: ubuntu-22.04
target: aarch64
# - runner: ubuntu-22.04
# target: armv7
# - runner: ubuntu-22.04
# target: ppc64le
python_version:
["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: ${{ matrix.python_version }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: "true"
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-${{ matrix.python_version }}-linux-${{ matrix.platform.target }}
path: dist

# windows:
# runs-on: windows-latest
# musllinux:
# runs-on: ${{ matrix.platform.runner }}
# strategy:
# matrix:
# target: [x64, x86]
# platform:
# - runner: ubuntu-22.04
# target: x86_64
# - runner: ubuntu-22.04
# target: x86
# - runner: ubuntu-22.04
# target: aarch64
# - runner: ubuntu-22.04
# target: armv7
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: "3.10"
# architecture: ${{ matrix.target }}
# python-version: 3.x
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.target }}
# target: ${{ matrix.platform.target }}
# args: --release --out dist --find-interpreter
# sccache: "true"
# sccache: 'true'
# manylinux: musllinux_1_2
# - name: Upload wheels
# uses: actions/upload-artifact@v3
# uses: actions/upload-artifact@v4
# with:
# name: wheels
# name: wheels-musllinux-${{ matrix.platform.target }}
# path: dist

windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: windows-latest
target: x64
- runner: windows-latest
target: x86
python_version:
["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.python_version }}-windows-${{ matrix.platform.target }}
path: dist

macos:
runs-on: macos-latest
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
target: [x86_64, aarch64]
platform:
- runner: macos-13
target: x86_64
- runner: macos-14
target: aarch64
python_version:
["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: ${{ matrix.python_version }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: "true"
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-${{ matrix.python_version }}-macos-${{ matrix.platform.target }}
path: dist

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-sdist
path: dist

# test_release:
# name: Test release.
# needs: [linux, windows, macos, sdist]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: wheels
# path: dist
# - name: Publish distribution 📦 to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
test_release:
name: Test Release
runs-on: ubuntu-latest
environment: release
needs: [linux, macos, windows, sdist]
permissions:
# Use to sign the release artifacts
id-token: write
# Used to upload release artifacts
contents: write
# Used to generate artifact attestation
attestations: write
steps:
- uses: actions/download-artifact@v4
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: 'wheels-*/*'
# - name: Display structure of downloaded files
# run: ls -R
- name: Create 'wheels' directory
run: mkdir -p wheels
- name: Copy wheels artifacts
run: |
find wheels-* -type f -name "*.whl" -exec cp {} wheels/ \;
- name: Publish package distributions to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: wheels/
skip-existing: true
verbose: true

release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, macos, sdist]
environment: release
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
needs: [linux, macos, windows, sdist]
permissions:
# Use to sign the release artifacts
id-token: write
# Used to upload release artifacts
contents: write
# Used to generate artifact attestation
attestations: write
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
name: wheels
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
subject-path: 'wheels-*/*'
- name: Create 'wheels' directory
run: mkdir -p wheels
- name: Copy wheels artifacts
run: |
find wheels-* -type f -name "*.whl" -exec cp {} wheels/ \;
- name: Publish package distributions to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
command: upload
args: --skip-existing *
packages-dir: wheels/
verbose: true
Loading
Loading