File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 1
1
name : Auto Zip and Release
2
2
3
3
on :
4
+ push :
5
+ tags :
6
+ - ' v*.*.*'
4
7
workflow_dispatch :
8
+ inputs :
9
+ release_tag :
10
+ description : ' Tag cho release (ví dụ: v1.0.0). Để trống nếu không tạo release.'
11
+ required : false
5
12
6
13
jobs :
7
14
zip-and-release :
@@ -22,16 +29,17 @@ jobs:
22
29
zip -r "package/$name.zip" "$name" -x "$name/README.md"
23
30
done
24
31
25
- # Upload zip files to GitHub Release if a tag is pushed
26
- - name : Upload to GitHub Release
27
- if : startsWith( github.ref, 'refs/tags/')
32
+ # Upload to GitHub Release if tag is provided (manual trigger)
33
+ - name : Upload to GitHub Release (manual input)
34
+ if : ${{ github.event.inputs.release_tag != '' }}
28
35
uses : softprops/action-gh-release@v2
29
36
with :
37
+ tag_name : ${{ github.event.inputs.release_tag }}
30
38
files : package/*.zip
31
39
env :
32
40
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
33
41
34
- # Also upload as artifacts (optional: for non-tagged runs )
42
+ # Upload as artifacts (in all cases )
35
43
- name : Upload zip files as artifact
36
44
uses : actions/upload-artifact@v4
37
45
with :
You can’t perform that action at this time.
0 commit comments