11name : Release Drafter
22
33on :
4+ workflow_dispatch : {}
45 push :
56 branches :
67 - main
@@ -10,86 +11,47 @@ concurrency:
1011 cancel-in-progress : false
1112
1213jobs :
13- update_release_draft :
14- # Only runs on push to main - creates/updates draft release notes
14+ draft_release :
15+ name : Draft Release
1516 permissions :
1617 contents : write
1718 pull-requests : write
1819 runs-on : ubuntu-latest
1920 steps :
20- - uses : aaronsteers/semantic-pr-release-drafter@v0.3.0
21+ - name : Create or update draft release
22+ uses : aaronsteers/semantic-pr-release-drafter@v0.3.1
2123 id : release-drafter
2224 env :
2325 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2426
25- outputs :
26- upload_url : ${{ steps.release-drafter.outputs.upload_url }}
27- tag_name : ${{ steps.release-drafter.outputs.tag_name }}
28- release_id : ${{ steps.release-drafter.outputs.id }}
29-
30- # Build and upload assets to the draft release (only on push to main)
31- upload_release_assets :
32- name : Upload Release Assets
33- needs : [update_release_draft]
34- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
35- runs-on : ubuntu-latest
36- permissions :
37- contents : write
38- steps :
39- - name : Checkout Repo
40- uses : actions/checkout@v4
41- with :
42- fetch-depth : 0
43-
4427 - name : Delete existing release assets
4528 uses : andreaswilli/delete-release-assets-action@v4.0.0
46- # Delete all existing assets to ensure clean replacement
47- # This prevents stale artifacts from accumulating, e.g. if artifact names change
4829 with :
4930 github_token : ${{ secrets.GITHUB_TOKEN }}
50- tag : ${{ needs.update_release_draft .outputs.tag_name }}
31+ tag : ${{ steps.release-drafter .outputs.tag_name }}
5132 deleteOnlyFromDrafts : true
5233
5334 - name : Install uv
5435 uses : astral-sh/setup-uv@v7
5536 with :
5637 version : " latest"
5738
58- - name : Set up Python
59- uses : actions/setup-python@v5
39+ - name : Checkout Repo
40+ uses : actions/checkout@v6
6041 with :
61- python-version : " 3.12"
62-
63- - name : Get version from draft release tag
64- id : version
65- run : |
66- TAG_NAME="${{ needs.update_release_draft.outputs.tag_name }}"
67- # Remove 'v' prefix if present
68- VERSION="${TAG_NAME#v}"
69- echo "version=$VERSION" >> $GITHUB_OUTPUT
70- echo "Building version: $VERSION"
42+ fetch-depth : 0
7143
7244 - name : Build package
7345 env :
74- UV_DYNAMIC_VERSIONING_BYPASS : ${{ steps.version.outputs.version }}
75- run : uv build
76-
77- - name : Upload wheel to draft release
78- uses : svenstaro/upload-release-action@v2
79- with :
80- repo_token : ${{ secrets.GITHUB_TOKEN }}
81- file : dist/*.whl
82- release_id : ${{ needs.update_release_draft.outputs.release_id }}
83- overwrite : true
84- file_glob : true
85- draft : true
46+ TAG_NAME : ${{ steps.release-drafter.outputs.tag_name }}
47+ run : UV_DYNAMIC_VERSIONING_BYPASS="${TAG_NAME#v}" uv build
8648
87- - name : Upload sdist to draft release
49+ - name : Upload assets to draft release
8850 uses : svenstaro/upload-release-action@v2
8951 with :
9052 repo_token : ${{ secrets.GITHUB_TOKEN }}
91- file : dist/*.tar.gz
92- release_id : ${{ needs.update_release_draft .outputs.release_id }}
53+ file : dist/*.{whl, tar.gz}
54+ release_id : ${{ steps.release-drafter .outputs.id }}
9355 overwrite : true
9456 file_glob : true
9557 draft : true
0 commit comments