ci update #21
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: Python | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
tags: | ||
- '*' | ||
pull_request: | ||
branches: [ "main" ] | ||
env: | ||
PACKAGE_NAME: rocraters | ||
PYTHON_VERSION: "3.7" # to build abi3 wheels | ||
# Modified slightly from crfs-rs Python.yml | ||
jobs: | ||
linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: [x86_64, i686] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
architecture: x64 | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
manylinux: auto | ||
args: --release --out dist -m python/Cargo.toml | ||
- name: Install built wheel | ||
if: matrix.target == 'x86_64' | ||
run: | | ||
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --no-index --find-links dist --force-reinstall | ||
python -c "import rocraters" | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
if: "startsWith(github.ref, 'refs/tags/')" | ||
needs: [linux, windows, macos] | ||
Check failure on line 50 in .github/workflows/python.yml GitHub Actions / PythonInvalid workflow file
|
||
env: | ||
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
- name: Publish to PyPI | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: upload | ||
args: --repository=testpypi --non-interactive --skip-existing * | ||