Skip to content

Commit

Permalink
Fix Python CI
Browse files Browse the repository at this point in the history
Release job now use PyPI's trusted publishing.
  • Loading branch information
mgautierfr committed Sep 8, 2024
1 parent 3e1c078 commit bb4712d
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
name: Python wrapping

on:
push:
branches:
- main
tags:
- '*'
pull_request:
workflow_dispatch:
release:
types: [released]

permissions:
contents: read
Expand All @@ -25,13 +21,14 @@ jobs:
platform:
- runner: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
sudo apt-get install -y libfuse-dev
- name: Checkout code
uses: actions/checkout@v4
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -42,7 +39,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux
name: wheels-linux-x86_64
path: dist

windows:
Expand All @@ -52,10 +49,11 @@ jobs:
platform:
- runner: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Checkout code
uses: actions/checkout@v4
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -65,7 +63,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows
name: wheels-windows-x64
path: dist

macos:
Expand All @@ -75,13 +73,14 @@ jobs:
platform:
- runner: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
brew install macfuse
- name: Checkout code
uses: actions/checkout@v4
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -91,13 +90,14 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos
name: wheels-macos-x86_64
path: dist

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
Expand All @@ -113,15 +113,14 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [sdist]
if: "github.event_name == 'release'"
needs: [linux, windows, macos, sdist]
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
working-directory: python

0 comments on commit bb4712d

Please sign in to comment.