Skip to content

Commit

Permalink
modify CI
Browse files Browse the repository at this point in the history
  • Loading branch information
georgypv committed Jul 18, 2024
1 parent 36cc4d1 commit 4e1bd59
Showing 1 changed file with 84 additions and 7 deletions.
91 changes: 84 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is autogenerated by maturin v1.5.1
# This file is autogenerated by maturin v1.7.0
# To update, run
#
# maturin generate-ci -o .github/workflows/CI.yml github
# maturin generate-ci github -m Cargo.toml --platform all -o .github/workflows/CI.yml
#
name: CI

Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -54,6 +54,37 @@ jobs:
name: wheels-linux-${{ matrix.platform.target }}
path: dist

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

windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
Expand All @@ -67,7 +98,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: 3.x
architecture: ${{ matrix.platform.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
Expand All @@ -86,15 +117,15 @@ jobs:
strategy:
matrix:
platform:
- runner: macos-latest
- runner: macos-12
target: x86_64
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -107,6 +138,43 @@ jobs:
name: wheels-macos-${{ matrix.platform.target }}
path: dist

emscripten:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: wasm32-unknown-emscripten
steps:
- uses: actions/checkout@v4
- run: pip install pyodide-build
- name: Get Emscripten and Python version info
shell: bash
run: |
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
echo PYTHON_VERSION=$(pyodide config get python_version | cut -d '.' -f 1-2) >> $GITHUB_ENV
pip uninstall -y pyodide-build
- uses: mymindstorm/setup-emsdk@v12
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
actions-cache-folder: emsdk-cache
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- run: pip install pyodide-build
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist -i ${{ env.PYTHON_VERSION }}
sccache: 'true'
rust-toolchain: nightly
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wasm-wheels
path: dist

sdist:
runs-on: ubuntu-latest
steps:
Expand All @@ -126,7 +194,10 @@ jobs:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
needs: [linux, musllinux, windows, macos, emscripten, sdist]
permissions:
# Used to upload release artifacts
contents: write
steps:
- uses: actions/download-artifact@v4
- name: Publish to PyPI
Expand All @@ -136,3 +207,9 @@ jobs:
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
wasm-wheels/*.whl
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}

0 comments on commit 4e1bd59

Please sign in to comment.