Skip to content

Commit 599d132

Browse files
authored
Update zip-and-release.yml
1 parent 5f4c6e1 commit 599d132

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/zip-and-release.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
name: Auto Zip and Release
22

33
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
47
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
512

613
jobs:
714
zip-and-release:
@@ -22,16 +29,17 @@ jobs:
2229
zip -r "package/$name.zip" "$name" -x "$name/README.md"
2330
done
2431
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 != '' }}
2835
uses: softprops/action-gh-release@v2
2936
with:
37+
tag_name: ${{ github.event.inputs.release_tag }}
3038
files: package/*.zip
3139
env:
3240
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3341

34-
# Also upload as artifacts (optional: for non-tagged runs)
42+
# Upload as artifacts (in all cases)
3543
- name: Upload zip files as artifact
3644
uses: actions/upload-artifact@v4
3745
with:

0 commit comments

Comments
 (0)