Skip to content

Commit

Permalink
👷 Update Python CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bash committed Dec 11, 2024
1 parent 581424e commit 9e0ef11
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 12 deletions.
36 changes: 24 additions & 12 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is autogenerated by maturin v1.7.1 (and modified)
# This file is autogenerated by maturin v1.7.8
# To update, run
#
# maturin generate-ci github
Expand All @@ -23,17 +23,17 @@ jobs:
strategy:
matrix:
platform:
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: x86
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: aarch64
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: armv7
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: s390x
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: ppc64le
steps:
- uses: actions/checkout@v4
Expand All @@ -58,13 +58,13 @@ jobs:
strategy:
matrix:
platform:
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: x86
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: aarch64
- runner: ubuntu-latest
- runner: ubuntu-22.04
target: armv7
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
strategy:
matrix:
platform:
- runner: macos-12
- runner: macos-13
target: x86_64
- runner: macos-14
target: aarch64
Expand Down Expand Up @@ -159,9 +159,21 @@ jobs:
needs: [linux, musllinux, windows, macos, sdist]
environment: PyPi
concurrency: PyPi
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: Publish to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/python.yml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
index b4f6ef6..4c7203a 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/python.yml
@@ -3,15 +3,14 @@
#
# maturin generate-ci github
#
-name: CI
+name: Python

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

@@ -45,7 +44,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
- args: --release --out dist --find-interpreter
+ args: --release --out dist --find-interpreter --manifest-path crates/pycolorsaurus/Cargo.toml
sccache: 'true'
manylinux: auto
- name: Upload wheels
@@ -76,7 +75,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
- args: --release --out dist --find-interpreter
+ args: --release --out dist --find-interpreter --manifest-path crates/pycolorsaurus/Cargo.toml
sccache: 'true'
manylinux: musllinux_1_2
- name: Upload wheels
@@ -104,7 +103,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
- args: --release --out dist --find-interpreter
+ args: --release --out dist --find-interpreter --manifest-path crates/pycolorsaurus/Cargo.toml
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
@@ -130,7 +129,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
- args: --release --out dist --find-interpreter
+ args: --release --out dist --find-interpreter --manifest-path crates/pycolorsaurus/Cargo.toml
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
@@ -146,7 +145,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
command: sdist
- args: --out dist
+ args: --out dist --manifest-path crates/pycolorsaurus/Cargo.toml
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
@@ -156,8 +155,10 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
- if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
+ if: "startsWith(github.ref, 'refs/tags/pycolorsaurus-')"
needs: [linux, musllinux, windows, macos, sdist]
+ environment: PyPi
+ concurrency: PyPi
permissions:
# Use to sign the release artifacts
id-token: write
@@ -175,7 +176,7 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: PyO3/maturin-action@v1
env:
- MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
4 changes: 4 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ doc:

update-locked-deps:
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=fallback cargo +nightly -Zmsrv-policy generate-lockfile

update-python-ci:
(cd crates/pycolorsaurus && maturin generate-ci github > ../../.github/workflows/python.yml)
git apply .github/workflows/python.yml.patch

0 comments on commit 9e0ef11

Please sign in to comment.