-
Notifications
You must be signed in to change notification settings - Fork 24
52 lines (41 loc) · 1.16 KB
/
build.yml
File metadata and controls
52 lines (41 loc) · 1.16 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
name: Reusable Build Workflow
on:
workflow_call:
secrets:
token:
required: true
jobs:
build:
name: Build and publish
runs-on: "ubuntu-24.04"
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Setup venv
run: |
uv venv
uv sync --all-extras
- name: Build
run: |
uv build
- name: Check if version in pyproject.toml was modified
id: check_version
run: |
if git diff --name-only ${{ github.sha }} ${{ github.event.before }} | grep -q 'pyproject.toml'; then
echo "modified=true" >> $GITHUB_OUTPUT
else
echo "modified=false" >> $GITHUB_OUTPUT
fi
- name: Publish
if: ${{ steps.check_version.outputs.modified }} == 'true'
run: |
uv publish
env:
UV_PUBLISH_TOKEN: ${{ secrets.token }}
- name: Publish Docs
if: ${{ steps.check_version.outputs.modified }} == 'true'
run: |
uv run mkdocs gh-deploy --force