v0.1.0 #12
Workflow file for this run
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: Publish on PyPI | |
on: | |
push: | |
branches: | |
- "main" | |
release: | |
types: [created] | |
permissions: | |
contents: read | |
jobs: | |
test: | |
name: Tests Python ${{ matrix.python-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13-dev"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
allow-prereleases: true | |
cache: pip | |
cache-dependency-path: | | |
**/setup.py | |
**/requirements*.txt | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt -r requirements-dev.txt | |
- name: Run Testsuite | |
run: | | |
pytest | |
build: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: pip | |
cache-dependency-path: | | |
**/setup.py | |
**/requirements*.txt | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt -r requirements-dev.txt | |
- name: Build wheel | |
run: | | |
python setup.py sdist bdist_wheel | |
twine check dist/* | |
- name: Upload build for publishing | |
uses: actions/upload-artifact@v4 | |
with: | |
name: parse_model_release | |
if-no-files-found: error | |
retention-days: 1 | |
path: dist/* | |
pypi-publish: | |
name: Upload release to PyPI | |
runs-on: ubuntu-latest | |
needs: build | |
environment: release | |
permissions: | |
id-token: write | |
steps: | |
- name: Download math result for job 1 | |
uses: actions/download-artifact@v4 | |
with: | |
name: parse_model_release | |
path: dist | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
if: github.event_name == 'release' | |
with: | |
print-hash: true |