Commit 5b3d3eb 1 parent da19223 commit 5b3d3eb Copy full SHA for 5b3d3eb
File tree 2 files changed +27
-3
lines changed
2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 27
27
uses : goreleaser/goreleaser-action@v4
28
28
with :
29
29
version : latest
30
- args : release --snapshot # 快照发布
30
+ args : release --snapshot -clean # 快照发布
31
+ env :
32
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
33
+
34
+ - name : Delete existing prerelease
35
+ if : github.event_name != 'push' || startsWith(github.ref, 'refs/heads/') # 触发条件为手动或非 tag 的 push
36
+ run : |
37
+ RELEASE_ID=$(gh api -X GET repos/${{ github.repository }}/releases --jq '.[] | select(.prerelease) | .id' | head -n 1)
38
+ if [ -n "$RELEASE_ID" ]; then
39
+ gh api -X DELETE repos/${{ github.repository }}/releases/$RELEASE_ID
40
+ fi
41
+ env :
42
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
43
+
44
+ - name : Create new prerelease and upload artifacts
45
+ if : github.event_name != 'push' || startsWith(github.ref, 'refs/heads/') # 触发条件为手动或非 tag 的 push
46
+ run : |
47
+ TAG_NAME="prerelease-$(date +%Y%m%d%H%M%S)"
48
+ gh release create $TAG_NAME --prerelease --title "Nightly Build $(date +'%Y-%m-%d %H:%M:%S')" \
49
+ --notes "This is an automated nightly build." \
50
+ ./dist/*.tar.gz ./dist/*.zip
31
51
env :
32
52
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
33
53
36
56
uses : goreleaser/goreleaser-action@v4
37
57
with :
38
58
version : latest
39
- args : release # 正式发布
59
+ args : release -clean # 正式发布
40
60
env :
41
61
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -44,4 +44,8 @@ archives:
44
44
files :
45
45
- ./README.md
46
46
- ./LICENSE
47
- - ./config/*.yaml
47
+
48
+ release :
49
+ github :
50
+ owner : go-kod
51
+ name : kod
You can’t perform that action at this time.
0 commit comments