bump version for release 0.7.5 #43
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: Publish on PyPI | |
| on: | |
| push: | |
| tags: | |
| # After vMajor.Minor.Patch _anything_ is allowed (without "/") ! | |
| - v[0-9]+.[0-9]+.[0-9]+* | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'stfc/janus-core' && startsWith(github.ref, 'refs/tags/v') | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: True | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pandoc | |
| uses: pandoc/actions/setup@v1 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "0.6.2" | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: uv sync --extra all | |
| - name: Build docs with tutorials | |
| run: cd docs && uv run make all | |
| - name: Upload | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| # Upload entire repository | |
| path: './docs/build/html/.' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| publish: | |
| needs: build-docs | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'stfc/janus-core' && startsWith(github.ref, 'refs/tags/v') | |
| environment: | |
| name: release | |
| permissions: | |
| # For PyPI's trusted publishing. | |
| id-token: write | |
| # For release. | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "0.6.2" | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Build | |
| run: uv build | |
| - name: Get version from pyproject.toml | |
| run: echo "VERSION=$(uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version)" >> $GITHUB_ENV | |
| - name: Check version matches tag | |
| if: ${{ ! contains(github.ref, env.VERSION) }} | |
| run: | | |
| echo "Git tag does not match version in pyproject.toml" | |
| exit 1 | |
| - name: Create Release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "dist/*" | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| draft: false | |
| prerelease: steps.check-prerelease.outputs.prerelease == 'true' | |
| skipIfReleaseExists: true | |
| - name: Publish to PyPI | |
| run: uv publish |