Skip to content

Commit 25ced68

Browse files
committed
feat: different actions for master and tag commits
1 parent ac8b92b commit 25ced68

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

.github/workflows/build_and_release.yaml .github/workflows/auto_build.yaml

+14-11
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Build and Release
22

33
on:
44
push:
5-
tags:
6-
- "v*"
5+
branches: [ master ]
6+
tags: [ "v*" ]
77

88
jobs:
99
build:
@@ -43,18 +43,21 @@ jobs:
4343
cd build/Release
4444
zip -r NetSpeedMonitor.zip NetSpeedMonitor.app
4545
46-
- name: Get Release Notes
47-
id: get_notes
48-
run: |
49-
TAG_NAME=${GITHUB_REF#refs/tags/}
50-
NOTES=$(awk "/## $TAG_NAME/{flag=1;next}/## /{flag=0}flag" RELEASE_NOTES.md)
51-
echo "notes=$NOTES" >> $GITHUB_OUTPUT
46+
- name: Upload Artifacts (Master)
47+
if: github.ref == 'refs/heads/master'
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: build-${{ github.sha }}
51+
path: build/
5252

53-
- name: Create GitHub Release
54-
uses: softprops/action-gh-release@v1
53+
- name: Create Release Draft
54+
if: startsWith(github.ref, 'refs/tags/v')
55+
uses: softprops/action-gh-release@v2
5556
with:
56-
body: ${{ steps.get_notes.outputs.notes }}
57+
draft: true
58+
body_path: RELEASE_NOTES.MD
5759
files: |
5860
build/Release/NetSpeedMonitor.zip
61+
build/Release/NetSpeedMonitor.app
5962
env:
6063
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)