@@ -2,23 +2,69 @@ name: Build .NET Framework Desktop App
2
2
3
3
on :
4
4
push :
5
- branches : [ master ]
5
+ branches :
6
+ - " **"
7
+ tags :
8
+ - " *"
6
9
pull_request :
7
- branches : [ master ]
10
+ branches : [master]
8
11
9
12
jobs :
10
13
build :
11
14
runs-on : windows-2022
12
15
13
16
steps :
14
- - name : Checkout code
15
- uses : actions/checkout@v3
17
+ - name : Checkout code
18
+ uses : actions/checkout@v3
16
19
17
- - name : Setup MSBuild
18
-
20
+ - name : Setup MSBuild
21
+
19
22
20
- - name : Restore NuGet packages
21
- run : nuget restore SA.sln
23
+ - name : Restore NuGet packages
24
+ run : nuget restore SA.sln
22
25
23
- - name : Build with MSBuild
24
- run : msbuild SA.sln /p:Configuration=Release
26
+ - name : Build with MSBuild
27
+ run : msbuild SA.sln /p:Configuration=Release
28
+
29
+ release :
30
+ needs : build
31
+ if : startsWith(github.ref, 'refs/tags/')
32
+ runs-on : windows-2022
33
+
34
+ steps :
35
+ - name : Checkout Code
36
+ uses : actions/checkout@v3
37
+
38
+ - name : Setup MSBuild
39
+
40
+
41
+ - name : Restore NuGet Packages
42
+ run : nuget restore SA.sln
43
+
44
+ - name : Build with MSBuild
45
+ run : msbuild SA.sln /p:Configuration=Release
46
+
47
+ - name : Package Artifacts
48
+ run : |
49
+ $Tag = "${{ github.ref_name }}"
50
+ $ZipName = "SubtitlesAdjuster_$Tag.zip"
51
+ mkdir output
52
+ copy /Y bin\Release\*.exe output\
53
+ powershell Compress-Archive -Path output\* -DestinationPath $ZipName
54
+
55
+ - name : Create GitHub Release
56
+ uses : softprops/action-gh-release@v1
57
+ with :
58
+ tag_name : ${{ github.ref_name }}
59
+ name : Subtitles Adjuster ${{ github.ref_name }}
60
+ draft : false
61
+ prerelease : false
62
+ env :
63
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
64
+
65
+ - name : Upload Release Asset
66
+ uses : softprops/action-gh-release@v1
67
+ with :
68
+ files : SubtitlesAdjuster_${{ github.ref_name }}.zip
69
+ env :
70
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments