Skip to content

Package and Publish

Package and Publish #6

Workflow file for this run

name: Package and Publish
on:
release:
types: [created]
workflow_dispatch:
jobs:
build-windows-linux:
runs-on: ${{ matrix.os }}
env:
working-directory: ./ssbh_data_py
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
custom-target: ['false']
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Build wheel
uses: PyO3/maturin-action@v1
with:
command: build
args: --release --strip --interpreter python${{matrix.python-version}}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: target/wheels/ssbh_data_py*.whl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: PyPi publish
if: github.event_name == 'release' && github.event.action == 'created'
env:
MATURIN_PASSWORD: ${{ secrets.PYPI }}
uses: PyO3/maturin-action@v1
with:
command: publish
container: off
args: --username __token__ --interpreter python${{matrix.python-version}}
build-macos:
runs-on: macos-latest
env:
working-directory: ./ssbh_data_py
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
target: ['x86_64-apple-darwin', 'aarch64-apple-darwin']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{matrix.target}}
- name: Build wheel
uses: PyO3/maturin-action@v1
with:
command: build
args: --release --strip --interpreter python${{matrix.python-version}} --target ${{matrix.target}}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: target/wheels/ssbh_data_py*.whl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: PyPi publish
if: github.event_name == 'release' && github.event.action == 'created'
env:
MATURIN_PASSWORD: ${{ secrets.PYPI }}
uses: PyO3/maturin-action@v1
with:
command: publish
container: off
args: --username __token__ --interpreter python${{matrix.python-version}} --target ${{matrix.target}}