-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.46 KB
/
release.yml
File metadata and controls
61 lines (52 loc) · 1.46 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
name: Release
on:
push:
branches: [main, next, beta]
workflow_dispatch:
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
jobs:
release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v5
with:
version: "latest"
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv sync --all-groups
- name: Test before release
run: |
uv run pytest
- name: Bootstrap initial semantic-release tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if ! git tag -l "v*" | grep -q .; then
echo "No semantic-release tags found. Bootstrapping v0.0.0"
git tag v0.0.0
git push origin v0.0.0
else
echo "Existing semantic-release tags found. Skipping bootstrap."
fi
- name: Semantic release version
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: uv run semantic-release version
- name: Publish to PyPI
env:
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
if ls dist/*.whl >/dev/null 2>&1; then
uv publish --token "$PYPI_TOKEN" dist/*
else
echo "No new release artifacts produced; skipping PyPI publish."
fi