Merge pull request #58 from aeturrell/v1.0.5 #15
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 | |
| permissions: | |
| contents: write | |
| pages: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Set up Python | |
| run: uv python install | |
| - name: Install dependencies | |
| run: uv sync --all-extras --dev | |
| - name: Install Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| with: | |
| version: "1.5.57" | |
| - name: Check if there is a parent commit | |
| id: check-parent-commit | |
| run: | | |
| echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)" | |
| - name: check toml file working | |
| run: | | |
| echo uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version | |
| - name: Detect and tag new version | |
| id: check-version | |
| if: steps.check-parent-commit.outputs.sha | |
| uses: salsify/action-detect-and-tag-new-version@v2.0.3 | |
| with: | |
| version-command: | | |
| uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version | |
| - name: Bump version for developmental release | |
| if: "! steps.check-version.outputs.tag" | |
| run: | | |
| uv run version_bumper.py && | |
| version=$(uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version) && | |
| uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version $version.dev.$(date +%s) | |
| - name: set timezone | |
| run: | | |
| TZ="Europe/London" && | |
| sudo ln -snf /usr/share/zoneinfo/$TZ /etc/localtime | |
| - name: install linux deps | |
| run: | | |
| sudo apt-get -y install openssl graphviz nano texlive graphviz-dev unzip build-essential | |
| - name: build the book | |
| run: | | |
| uv run quarto render --execute | |
| env: | |
| # This forces Quarto to use the Python inside your uv venv | |
| QUARTO_PYTHON: ${{ github.workspace }}/.venv/bin/python | |
| - name: Publish | |
| if: steps.check-version.outputs.tag | |
| run: uv run quarto publish gh-pages --no-render --no-browser | |
| - name: Publish the release notes | |
| uses: release-drafter/release-drafter@v6.0.0 | |
| with: | |
| publish: ${{ steps.check-version.outputs.tag != '' }} | |
| tag: ${{ steps.check-version.outputs.tag }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |