Replace ruff with something callable #285
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: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*.*.*' | |
| pull_request: | |
| jobs: | |
| build: | |
| name: Build Package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout branch | |
| uses: actions/checkout@v4 | |
| - name: Set up pixi | |
| uses: prefix-dev/setup-pixi@v0.8.14 | |
| with: | |
| environments: release | |
| - name: Ensure tag matches version | |
| if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | |
| run: | | |
| version="$(pixi exec -s go-yq -- yq .project.version pyproject.toml)" | |
| tag="${{ github.ref_name }}" | |
| if [ "$version" != "$tag" ]; then | |
| echo "Tag $tag does not match version $version" | |
| exit 1 | |
| fi | |
| - name: Build | |
| run: pixi run -e release hatch build | |
| - name: Check build | |
| run: pixi run -e release twine check dist/* | |
| - name: List files | |
| run: ls -l dist/ | |
| - name: Upload package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact | |
| path: dist/* | |
| release: | |
| name: Publish Package | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| environment: pypi | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: artifact | |
| path: dist | |
| - name: Publish package on PyPi | |
| uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc |