File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11on :
2- release :
3- types : [ published ]
42 pull_request :
3+ push :
4+ branches : [ 'master' ]
5+ tags : [ 'v*.*.*' ]
56
67jobs :
78 build :
@@ -19,19 +20,19 @@ jobs:
1920
2021 - name : Build
2122 run : |
22- $ErrorActionPreference = 'Stop'
23-
24- if ('${{ github.event_name }}' -eq 'release') {
25- $ver = '${{ github.event.release.tag_name }}'.TrimStart('v')
23+ if ('${{ github.event_name == 'push' && github.ref_type == 'tag' }}' -eq 'true') {
24+ $ver = $env:GITHUB_REF -replace '^refs/tags/v'
2625 } else {
2726 $ver = '0.0.0'
2827 }
2928
3029 dotnet.exe publish AutoAudioSwitcher -o publish -p:Version="$ver"
3130 & 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' .\Setup\Setup.iss
3231
33- - name : Upload release artifact
34- if : github.event_name == 'release '
32+ - name : Create release draft
33+ if : github.event_name == 'push' && github.ref_type == 'tag '
3534 env :
3635 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
37- run : gh release upload ${{ github.event.release.tag_name }} Setup\Output\AutoAudioSwitcher-Setup.exe
36+ run : |
37+ $tag = $env:GITHUB_REF -replace '^refs/tags/'
38+ gh release create --draft --title $tag $tag Setup\Output\AutoAudioSwitcher-Setup.exe
You can’t perform that action at this time.
0 commit comments