Merge pull request #34 from ouspg/dev #8
This file contains hidden or 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 to PyPI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: ['**'] | |
| jobs: | |
| pypi-build: | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| name: Build package distributions | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Build distributions | |
| run: | | |
| python -m pip install build | |
| python -m build | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-build | |
| path: dist/ | |
| retention-days: 3 | |
| pypi-publish: | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| needs: pypi-build | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/avise | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist-build | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@v1.14.0 | |
| with: | |
| verbose: true |