PIP Release #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is autogenerated by maturin v1.7.0 | |
# To update, run | |
# | |
# maturin generate-ci github | |
# | |
name: PIP Release | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
linux: | |
runs-on: ${{ matrix.runner }} | |
if: github.actor == 'gnpaone' | |
strategy: | |
matrix: | |
runner: [ubuntu-latest] | |
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Copy README.md and LICENSE | |
run: | | |
cp README.md pypi/ | |
cp LICENSE pypi/ | |
rm -f README.md | |
rm -f LICENSE | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
working-directory: pypi | |
target: ${{ matrix.target }} | |
args: --release --out dist | |
sccache: 'true' | |
manylinux: auto | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "wheels-linux-${{ matrix.target }}" | |
path: pypi/dist | |
musllinux: | |
runs-on: ${{ matrix.runner }} | |
if: github.actor == 'gnpaone' | |
strategy: | |
matrix: | |
runner: [ubuntu-latest] | |
target: [x86_64, x86, aarch64, armv7] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Copy README.md and LICENSE | |
run: | | |
cp README.md pypi/ | |
cp LICENSE pypi/ | |
rm -f README.md | |
rm -f LICENSE | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
working-directory: pypi | |
target: ${{ matrix.target }} | |
args: --release --out dist | |
sccache: 'true' | |
manylinux: musllinux_1_2 | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "wheels-musllinux-${{ matrix.target }}" | |
path: pypi/dist | |
windows: | |
runs-on: ${{ matrix.runner }} | |
if: github.actor == 'gnpaone' | |
strategy: | |
matrix: | |
runner: [windows-latest] | |
target: [x64, x86] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Copy README.md and LICENSE | |
run: | | |
cp README.md pypi/ | |
cp LICENSE pypi/ | |
del README.md | |
del LICENSE | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
working-directory: pypi | |
target: ${{ matrix.target }} | |
args: --release --out dist | |
sccache: 'true' | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "wheels-windows-${{ matrix.target }}" | |
path: pypi/dist | |
macos: | |
runs-on: ${{ matrix.runner }} | |
if: github.actor == 'gnpaone' | |
strategy: | |
matrix: | |
runner: [macos-14] | |
target: [x86_64, aarch64] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Copy README.md and LICENSE | |
run: | | |
cp README.md pypi/ | |
cp LICENSE pypi/ | |
rm -f README.md | |
rm -f LICENSE | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
working-directory: pypi | |
target: ${{ matrix.target }} | |
args: --release --out dist | |
sccache: 'true' | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "wheels-macos-${{ matrix.target }}" | |
path: pypi/dist | |
sdist: | |
runs-on: ubuntu-latest | |
if: github.actor == 'gnpaone' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Copy README.md and LICENSE | |
run: | | |
cp README.md pypi/ | |
cp LICENSE pypi/ | |
rm -f README.md | |
rm -f LICENSE | |
- name: Build sdist | |
uses: PyO3/maturin-action@v1 | |
with: | |
working-directory: pypi | |
command: sdist | |
args: --out dist | |
- name: Upload sdist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "wheels-sdist" | |
path: pypi/dist | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
# if: startsWith(github.ref, 'refs/tags/') && github.actor == 'gnpaone' | |
if: github.actor == 'gnpaone' | |
needs: [linux, musllinux, windows, macos, sdist] | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: pypi/dist | |
pattern: wheels-* | |
merge-multiple: true | |
# - name: Check if version tag | |
# id: check-tag | |
# run: | | |
# if [[ ${{ github.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
# echo "is_version=true" >> $GITHUB_ENV | |
# else | |
# echo "is_version=false" >> $GITHUB_ENV | |
# fi | |
- name: Publish to PyPI | |
# if: env.is_version == 'true' | |
uses: PyO3/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ vars.USE_TESTPYPI == 'true' && secrets.TESTPYPI_API_TOKEN || secrets.PYPI_API_TOKEN }} | |
MATURIN_REPOSITORY: ${{ vars.USE_TESTPYPI == 'true' && 'testpypi' || 'pypi' }} | |
with: | |
command: upload | |
args: --non-interactive --skip-existing pypi/dist/* |