-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 1.87 KB
/
publish.yml
File metadata and controls
71 lines (60 loc) · 1.87 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
name: Publish Packages
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: publish-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
name: Build And Publish Workspace
runs-on: ubuntu-latest
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
steps:
- name: Check Out Repository
uses: actions/checkout@v6
- name: Set Up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Set Up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Validate Release
run: |
uv sync --all-extras
make prod
- name: Build And Publish Root, Adapter, And Helper Projects
shell: bash
run: |
project_dirs() {
if [ -d packages/helpers ]; then
find packages/helpers -type f -name pyproject.toml -exec dirname {} \; | sort -u
fi
if [ -d packages/adapters ]; then
find packages/adapters -type f -name pyproject.toml -exec dirname {} \; | sort -u
fi
printf '.\n'
}
sync_project() {
local project_dir="$1"
local pyproject_path="$project_dir/pyproject.toml"
if grep -Eq '^\[project\.optional-dependencies\]' "$pyproject_path"; then
uv sync --project "$project_dir" --all-extras
else
uv sync --project "$project_dir"
fi
}
while IFS= read -r project_dir; do
echo "==> Publishing $project_dir"
sync_project "$project_dir"
rm -rf "$project_dir/dist"
uv build --project "$project_dir" --out-dir "$project_dir/dist"
uv publish "$project_dir"/dist/*
done < <(project_dirs)