1- # Add steps to generate a new tag based on the latest tag, timestamp, and commit hash,
2- # then use that tag for the release.
3-
4- name : Release Build and Publish
1+ name : Development Build and Publish
52
63on :
7- workflow_dispatch :
84 push :
5+ branches : [ master, main ]
96 tags :
107 - ' v*'
8+ pull_request :
9+ branches : [ master, main ]
10+ workflow_dispatch :
1111
1212permissions :
1313 contents : write
3939 - name : Setup .NET Framework Build Tools
4040 uses : microsoft/setup-msbuild@v2
4141
42- # --- Tag Generation Section ---
43- - name : Get latest tag
44- id : get_tag
45- shell : bash
46- run : |
47- latest_tag=$(git describe --tags --abbrev=0)
48- echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV
49-
50- - name : Generate timestamped tag
51- id : gen_tag
52- shell : bash
53- run : |
54- timestamp=$(date -u +"%m%d%H%M")
55- commit=$(git rev-parse --short HEAD)
56- new_tag="${LATEST_TAG}.${timestamp}-${commit}"
57- echo "NEW_TAG=$new_tag" >> $GITHUB_ENV
58-
59- - name : Create and push new tag
60- shell : bash
61- run : |
62- git config user.name "github-actions"
63- git config user.email "github-actions@github.com"
64- git tag $NEW_TAG
65- git push origin $NEW_TAG
66-
67- - name : Set release version
68- run : echo "VERSION=$NEW_TAG" >> $GITHUB_ENV
69- # --- End Tag Generation Section ---
70-
7142 - name : Restore HawkSyncShared dependencies
7243 run : dotnet restore ${{ env.HAWKSYNCSHARED_PROJECT_PATH }}
7344
@@ -139,7 +110,7 @@ jobs:
139110 - name : Create version info
140111 shell : pwsh
141112 run : |
142- $version = "${{ env.VERSION }} "
113+ $version = "dev-$(git rev-parse --short HEAD) "
143114 echo "VERSION=$version" >> $env:GITHUB_ENV
144115
145116 @"
@@ -188,14 +159,15 @@ jobs:
188159 path : ./${{ env.OUTPUT_NAME }}-${{ env.VERSION }}.zip
189160 retention-days : 30
190161
191- - name : Create GitHub Release
162+ - name : Create GitHub Pre-release
192163 uses : softprops/action-gh-release@v2
164+ if : github.event_name != 'pull_request'
193165 with :
194166 tag_name : ${{ env.VERSION }}
195- name : Release ${{ env.VERSION }}
167+ name : Pre-release Development Build ${{ env.VERSION }}
196168 body : |
197- This is an automated release build for ${{ env.VERSION }}.
198- prerelease : false
169+ This is an automated pre- release development build for commit ${{ env.VERSION }}.
170+ prerelease : true
199171 files : ./${{ env.OUTPUT_NAME }}-${{ env.VERSION }}.zip
200172 env :
201173 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments