Release Python Package #18
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
name: Release Python Package | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "common-py/v**" | |
jobs: | |
macos-wheels: | |
name: Build macos wheels | |
runs-on: macos-12 | |
env: | |
CXXFLAGS: "-std=c++11 -stdlib=libc++" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/action-common-python-release | |
with: | |
maturin-target: universal2-apple-darwin | |
linux-wheels: | |
name: Build linux wheels | |
runs-on: ubuntu-latest | |
env: | |
CXXFLAGS: "-std=c++11" | |
strategy: | |
matrix: | |
target: [x86_64, aarch64] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/action-common-python-release | |
with: | |
maturin-target: ${{ matrix.target }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
windows-wheels: | |
name: Build windows wheels | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/action-common-python-release | |
with: | |
python-architecture: x64 | |
rust-target: x86_64-pc-windows-msvc | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
env: | |
CXXFLAGS: "-std=c++11" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/action-common-python-release | |
with: | |
maturin-command: sdist | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
publish-python: | |
name: Publish package to PyPI | |
runs-on: ubuntu-latest | |
needs: [ macos-wheels, linux-wheels, windows-wheels, sdist ] | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
path: wheels | |
- name: List wheels to upload | |
run: ls wheels/ | |
- name: Publish to PyPI | |
uses: messense/maturin-action@v1 | |
with: | |
command: upload | |
args: --skip-existing wheels/* |