11name : Release
22
3+ # Publishes a template release. Copier reads the resulting vX.Y.Z tags as template versions.
4+
35on :
46 workflow_dispatch :
57
@@ -12,62 +14,21 @@ permissions:
1214
1315jobs :
1416 release :
15- runs-on : ubuntu-latest
17+ runs-on : ubuntu-slim
1618 permissions :
1719 contents : write
1820 steps :
19- - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20- with :
21- ref : main
22- persist-credentials : false
23- - name : Install uv
24- uses : astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
25- with :
26- enable-cache : false
27- version : " >=0.13,<0.14"
28-
2921 - name : Refresh draft release
3022 id : drafter
3123 uses : release-drafter/release-drafter@978bb0b30c5ee8cdd332ced253758157150d43f0 # v7.10.0
3224 env :
3325 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3426
35- - name : Bump version
36- env :
37- VERSION : ${{ steps.drafter.outputs.resolved_version }}
38- run : uv version "$VERSION"
39-
40- - name : Update CHANGELOG.md
41- uses : stefanzweifel/changelog-updater-action@a938690fad7edf25368f37e43a1ed1b34303eb36 # v1.12.0
42- with :
43- latest-version : ${{ steps.drafter.outputs.tag_name }}
44- release-notes : ${{ steps.drafter.outputs.body }}
45-
46- - name : Commit and push
47- id : commit
48- env :
49- TAG : ${{ steps.drafter.outputs.tag_name }}
50- run : |
51- git config user.name "github-actions[bot]"
52- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
53- git add pyproject.toml uv.lock CHANGELOG.md
54- git commit -m "Release $TAG"
55- git push origin main
56- echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
57-
27+ # Publishing the draft creates the vX.Y.Z tag at the commit this workflow ran on
5828 - name : Publish release
5929 env :
6030 GH_TOKEN : ${{ github.token }}
6131 RELEASE_ID : ${{ steps.drafter.outputs.id }}
62- SHA : ${{ steps.commit.outputs.sha }}
6332 run : |
6433 gh api -X PATCH "repos/${{ github.repository }}/releases/$RELEASE_ID" \
65- -F draft=false -f target_commitish="$SHA"
66-
67- - name : Build and upload artifacts
68- env :
69- GH_TOKEN : ${{ github.token }}
70- TAG : ${{ steps.drafter.outputs.tag_name }}
71- run : |
72- uv build
73- gh release upload "$TAG" dist/*
34+ -F draft=false -f target_commitish="$GITHUB_SHA"
0 commit comments