Skip to content

Commit

Permalink
Update and move Python CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sgreenbury committed Sep 5, 2024
1 parent 93e5a81 commit 7389a05
Showing 1 changed file with 26 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
#
# maturin generate-ci github
#
name: CI
name: python

on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
Expand All @@ -18,6 +17,10 @@ on:
permissions:
contents: read

defaults:
run:
working-directory: popgetter_py

jobs:
linux:
runs-on: ubuntu-latest
Expand All @@ -28,12 +31,13 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
working-directory: popgetter_py
sccache: 'true'
manylinux: auto
- name: Upload wheels
Expand All @@ -51,13 +55,14 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
working-directory: popgetter_py
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
Expand All @@ -74,12 +79,13 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
working-directory: popgetter_py
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
Expand All @@ -102,17 +108,18 @@ jobs:
name: wheels-sdist
path: dist

release:
name: Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [linux, windows, macos, sdist]
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-*/*
# TODO: uncomment for release to PyPI
# release:
# name: Release
# runs-on: ubuntu-latest
# if: startsWith(github.ref, 'refs/tags/')
# needs: [linux, windows, macos, sdist]
# 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-*/*

0 comments on commit 7389a05

Please sign in to comment.