Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [published]

jobs:
build:

test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -34,3 +35,23 @@ jobs:
- name: Test with pytest
run: |
pytest

publish:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'release'
permissions:
id-token: write # Required for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Build package
run: |
python -m pip install --upgrade pip
python -m pip install build
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1