Merge pull request #695 from BrianPugh/n-token #106
Workflow file for this run
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: Build package and push to PyPi | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| PYTHON: 3.12 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Needed for hatch-vcs to get version from git tags | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Set up python ${{ env.PYTHON }} | |
| id: setup-python | |
| run: uv python install ${{ env.PYTHON }} | |
| - name: Install project | |
| run: uv sync --all-extras | |
| - name: Build package | |
| run: uv build | |
| - name: Publish package | |
| if: github.event_name != 'workflow_dispatch' | |
| run: uv publish --token ${{ secrets.PYPI_TOKEN }} | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: dist | |
| path: dist/ |