-
Notifications
You must be signed in to change notification settings - Fork 34
86 lines (70 loc) · 2.49 KB
/
release.yml
File metadata and controls
86 lines (70 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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 }}