-
Notifications
You must be signed in to change notification settings - Fork 267
124 lines (103 loc) · 3.12 KB
/
build.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
name: Build WinSparkle
on: [push, pull_request]
jobs:
build:
name: Build DLL
runs-on: windows-latest
strategy:
matrix:
platform: [Win32, x64, ARM64]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Restore dependency packages
run: nuget restore
- name: Build binaries
run: msbuild -m -t:Build -p:Configuration=Release -p:Platform=${{ matrix.platform }} WinSparkle.sln
- name: Archive binaries
uses: actions/upload-artifact@v3
with:
name: winsparkle-binaries-${{ matrix.platform }}
path: |
include/winsparkle*.h
**/WinSparkle.dll
**/WinSparkle.lib
**/WinSparkle.pdb
**/example*.exe
build-nuget:
name: Build NuGet package
runs-on: windows-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Fetch binaries (Win32)
uses: actions/download-artifact@v3
with:
name: winsparkle-binaries-Win32
- name: Fetch binaries (x64)
uses: actions/download-artifact@v3
with:
name: winsparkle-binaries-x64
- name: Fetch binaries (ARM64)
uses: actions/download-artifact@v3
with:
name: winsparkle-binaries-ARM64
- name: Build NuGet package
run: nuget pack nuget/WinSparkle.nuspec -Verbosity detailed
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: nuget-package
path: "*.nupkg"
publish-nuget:
name: Publish NuGet
if: startsWith(github.ref, 'refs/tags/v')
runs-on: windows-latest
needs: build-nuget
steps:
- name: Fetch artifact
uses: actions/download-artifact@v3
with:
name: nuget-package
- uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
nuget-api-key-source: https://www.nuget.org/api/v2/package
- name: Publish to NuGet
run: nuget push *.nupkg -Source https://www.nuget.org/api/v2/package
publish-release:
name: Publish release
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: build-nuget
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0
- name: Fetch binaries (Win32)
uses: actions/download-artifact@v3
with:
name: winsparkle-binaries-Win32
- name: Fetch binaries (x64)
uses: actions/download-artifact@v3
with:
name: winsparkle-binaries-x64
- name: Fetch binaries (ARM64)
uses: actions/download-artifact@v3
with:
name: winsparkle-binaries-ARM64
- name: Package tarballs
run: make -f distrib.makefile
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
prerelease: true
artifacts: "WinSparkle*.zip"
token: ${{ secrets.GITHUB_TOKEN }}