Skip to content

Commit 1c6c5c1

Browse files
committed
chore: 1st version of release zip on tag in CI
1 parent 2a32034 commit 1c6c5c1

File tree

1 file changed

+56
-10
lines changed

1 file changed

+56
-10
lines changed

.github/workflows/dotnet-desktop.yml

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,69 @@ name: Build .NET Framework Desktop App
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- "**"
7+
tags:
8+
- "*"
69
pull_request:
7-
branches: [ master ]
10+
branches: [master]
811

912
jobs:
1013
build:
1114
runs-on: windows-2022
1215

1316
steps:
14-
- name: Checkout code
15-
uses: actions/checkout@v3
17+
- name: Checkout code
18+
uses: actions/checkout@v3
1619

17-
- name: Setup MSBuild
18-
uses: microsoft/[email protected]
20+
- name: Setup MSBuild
21+
uses: microsoft/[email protected]
1922

20-
- name: Restore NuGet packages
21-
run: nuget restore SA.sln
23+
- name: Restore NuGet packages
24+
run: nuget restore SA.sln
2225

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+
uses: microsoft/[email protected]
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

Comments
 (0)