diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 9856bea2..3d1d9463 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -4,8 +4,11 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] + release: + types: [ published ] jobs: test: + if: github.event_name != 'release' runs-on: ubuntu-latest steps: - name: checkout @@ -15,3 +18,13 @@ jobs: pip install maturin maturin build --features python pip install target/wheels/*.whl + publish: + if: github.event_name == 'release' + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: publish + run: | + pip install maturin + maturin publish -F python -u __token__ -p ${{ secrets.PYPI_TOKEN }}