1
- name : Build Wheel
1
+ name : Build and Release Wheel
2
2
3
3
on :
4
4
workflow_dispatch :
7
7
description : ' Python version to use for the build'
8
8
required : true
9
9
default : ' 3.10'
10
- branch :
11
- description : ' Branch to checkout '
10
+ tag_name :
11
+ description : ' Release tag (e.g., v0.1.0) '
12
12
required : true
13
- default : ' main '
13
+ default : ' v0.1.0 '
14
14
15
15
jobs :
16
- build_wheel :
16
+ build_and_release :
17
17
runs-on : ubuntu-latest
18
-
19
18
steps :
20
19
- name : Checkout repository
21
20
uses : actions/checkout@v4
22
- with :
23
- ref : ${{ github.event.inputs.branch }}
24
21
25
22
- name : Set up Python
26
23
uses : actions/setup-python@v5
@@ -42,10 +39,20 @@ jobs:
42
39
whl_name=$(basename "$whl_file")
43
40
echo "whl_file=$whl_file" >> $GITHUB_OUTPUT
44
41
echo "whl_name=$whl_name" >> $GITHUB_OUTPUT
45
-
46
- - name : Upload wheel artifact
47
- uses : actions/upload-artifact@v4
42
+
43
+ - name : Create and push tag
44
+ run : |
45
+ git config user.name "${{ github.actor }}"
46
+ git config user.email "${{ github.actor }}@users.noreply.github.com"
47
+ git tag ${{ github.event.inputs.tag_name }}
48
+ git push origin ${{ github.event.inputs.tag_name }}
49
+
50
+ - name : Create GitHub Release
51
+ uses : softprops/action-gh-release@v2
48
52
with :
49
- name : ${{ steps.get_filename.outputs.whl_name }}
50
- path : ${{ steps.get_filename.outputs.whl_file }}
51
- if-no-files-found : error
53
+ tag_name : ${{ github.event.inputs.tag_name }}
54
+ name : Release ${{ github.event.inputs.tag_name }}
55
+ files : ${{ steps.get_filename.outputs.whl_file }}
56
+ env :
57
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
58
+
0 commit comments