1+ name : Release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*' # Trigger on version tags (v0.1.0, v1.0.0, etc.)
7+
8+ permissions :
9+ contents : write # Required to create releases
10+
11+ jobs :
12+ release :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Checkout repository
17+ uses : actions/checkout@v4
18+ with :
19+ fetch-depth : 0 # Fetch full history for tags
20+
21+ - name : Install uv
22+ uses : astral-sh/setup-uv@v5
23+ with :
24+ enable-cache : true
25+
26+ - name : Set up Python
27+ uses : actions/setup-python@v5
28+ with :
29+ python-version-file : " pyproject.toml"
30+
31+ - name : Install dependencies
32+ run : |
33+ uv sync --all-extras --dev
34+
35+ - name : Install GitHub CLI
36+ run : |
37+ type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
38+ curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
39+ && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
40+ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
41+ && sudo apt update \
42+ && sudo apt install gh -y
43+
44+ - name : Build package
45+ run : |
46+ uv run invoke build
47+
48+ - name : Create GitHub Release and Upload Assets
49+ env :
50+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
51+ run : |
52+ # Extract tag name
53+ TAG_NAME=${GITHUB_REF#refs/tags/}
54+ echo "Creating release for tag: $TAG_NAME"
55+
56+ # Use the existing gh_release task from tasks.py
57+ uv run invoke gh_release
58+
59+ # Upload built packages to the release
60+ gh release upload "$TAG_NAME" dist/*.whl dist/*.tar.gz --clobber
0 commit comments