-
-
Notifications
You must be signed in to change notification settings - Fork 191
220 lines (184 loc) · 6.98 KB
/
compile-windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
name: Compile Windows binaries
on:
push:
branches: [ master, project-upgrade ]
pull_request:
branches: [ master ]
release:
types:
- published
- prereleased
workflow_dispatch:
jobs:
build-x64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.101
- name: Restore dependencies
run: dotnet restore -r win-x64 --configfile GalaxyBudsClient/nuget.config GalaxyBudsClient/GalaxyBudsClient.csproj
- name: Build x64
run: dotnet publish -r win-x64 -o bin_win64 -c Release -p:PublishSingleFile=true --self-contained true --no-restore GalaxyBudsClient/GalaxyBudsClient.csproj
#- name: Sign executable
# uses: GabrielAcostaEngler/[email protected]
# with:
# certificate: ${{ secrets.SIGN_CERTIFICATE }}
# cert-password: ${{ secrets.SIGN_PASSWORD }}
# cert-sha1: 048de957759a1837a967e61b8c97c442f7b9ec24
# folder: bin_win64/
# timestamp-server: http://timestamp.digicert.com
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: GalaxyBudsClient_win64_portable
path: bin_win64/
build-x86:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.101
- name: Restore dependencies
run: dotnet restore -r win-x86 --configfile GalaxyBudsClient/nuget.config GalaxyBudsClient/GalaxyBudsClient.csproj
- name: Build x86
run: dotnet publish -r win-x86 -o bin_win32 -c Release -p:PublishSingleFile=true --self-contained true --no-restore GalaxyBudsClient/GalaxyBudsClient.csproj
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: GalaxyBudsClient_win32_portable
path: bin_win32/
make-nsis-installer:
runs-on: windows-latest
needs: [build-x64, build-x86]
steps:
- uses: actions/checkout@v4
- name: Prepare version information (1/3)
uses: oprypin/[email protected]
with:
repository: timschneeb/GalaxyBudsClient
releases-only: true
id: last_release
- name: Prepare version information (2/3)
uses: benjlevesque/[email protected]
id: short-sha
with:
length: 6
- name: Prepare version information (3/3)
shell: bash
run: echo 'version=${{steps.last_release.outputs.tag}}-${{steps.short-sha.outputs.sha}}' >> $GITHUB_OUTPUT
id: version
# Make x64 installer
- name: Download artifact (x64)
uses: actions/download-artifact@v4
with:
name: GalaxyBudsClient_win64_portable
- name: Rename artifact (x64)
run: ren GalaxyBudsClient.exe "Galaxy Buds Client.exe"
- name: Create nsis installer (x64)
uses: joncloud/[email protected]
with:
script-file: "install.nsi"
arguments: "-DBASE_DIR=\"D:\\a\\GalaxyBudsClient\\GalaxyBudsClient\" -DPRODUCT_VERSION=\"${{steps.version.outputs.version}}\" -DPRODUCT_ARCH=\"64bit\""
#- name: Sign installer
# uses: GabrielAcostaEngler/[email protected]
# with:
# certificate: ${{ secrets.SIGN_CERTIFICATE }}
# cert-password: ${{ secrets.SIGN_PASSWORD }}
# cert-sha1: 048de957759a1837a967e61b8c97c442f7b9ec24
# folder: .
# timestamp-server: http://timestamp.digicert.com
- name: Upload artifact (x64)
uses: actions/upload-artifact@v4
with:
name: GalaxyBudsClient_Setup_64bit_${{steps.version.outputs.version}}.exe
path: GalaxyBudsClient_Setup_64bit_${{steps.version.outputs.version}}.exe
- name: Clean artifacts
run: del "Galaxy Buds Client.exe"
# Make x86 installer
- name: Download artifact (x86)
uses: actions/download-artifact@v4
with:
name: GalaxyBudsClient_win32_portable
- name: Rename artifact (x86)
run: ren GalaxyBudsClient.exe "Galaxy Buds Client.exe"
- name: Create nsis installer (x86)
uses: joncloud/[email protected]
with:
script-file: "install.nsi"
arguments: "-DBASE_DIR=\"D:\\a\\GalaxyBudsClient\\GalaxyBudsClient\" -DPRODUCT_VERSION=\"${{steps.version.outputs.version}}\" -DPRODUCT_ARCH=\"32bit\""
#- name: Sign installer
# uses: GabrielAcostaEngler/[email protected]
# with:
# certificate: ${{ secrets.SIGN_CERTIFICATE }}
# cert-password: ${{ secrets.SIGN_PASSWORD }}
# cert-sha1: 048de957759a1837a967e61b8c97c442f7b9ec24
# folder: .
# timestamp-server: http://timestamp.digicert.com
- name: Upload artifact (x86)
uses: actions/upload-artifact@v4
with:
name: GalaxyBudsClient_Setup_32bit_${{steps.version.outputs.version}}.exe
path: GalaxyBudsClient_Setup_32bit_${{steps.version.outputs.version}}.exe
attach-to-release:
runs-on: windows-latest
needs: [make-nsis-installer]
if: github.event_name == 'release'
steps:
- name: Prepare version information (1/3)
uses: oprypin/[email protected]
with:
repository: timschneeb/GalaxyBudsClient
releases-only: true
id: last_release
- name: Prepare version information (2/3)
uses: benjlevesque/[email protected]
id: short-sha
with:
length: 6
- name: Prepare version information (3/3)
shell: bash
run: echo 'version=${{steps.last_release.outputs.tag}}-${{steps.short-sha.outputs.sha}}' >> $GITHUB_OUTPUT
id: version
- name: Download setup artifact (x64)
uses: actions/download-artifact@v4
with:
name: GalaxyBudsClient_Setup_64bit_${{steps.version.outputs.version}}.exe
- name: Download portable artifact (x64)
uses: actions/download-artifact@v4
with:
name: GalaxyBudsClient_win64_portable
- name: Rename (x64)
run: |
ren GalaxyBudsClient_Setup_64bit_${{steps.version.outputs.version}}.exe GalaxyBudsClient_Windows_64bit_Setup.exe
ren GalaxyBudsClient.exe GalaxyBudsClient_Windows_64bit_Portable.exe
- uses: AButler/[email protected]
with:
files: '*.exe'
repo-token: ${{ secrets.GH_TOKEN }}
release-on-winget:
runs-on: windows-latest
needs: [attach-to-release]
if: github.event_name == 'release'
steps:
- name: Prepare version information (1/2)
uses: oprypin/[email protected]
with:
repository: timschneeb/GalaxyBudsClient
releases-only: true
id: last_release
- name: Prepare version information (2/2)
uses: benjlevesque/[email protected]
id: short-sha
with:
length: 6
- name: Release on WinGet
uses: vedantmgoyal9/winget-releaser@main
with:
identifier: timschneeb.GalaxyBudsClient
version: '${{steps.last_release.outputs.tag}}-${{steps.short-sha.outputs.sha}}'
token: ${{ secrets.WINGET_TOKEN }}