-
Notifications
You must be signed in to change notification settings - Fork 39
190 lines (154 loc) · 7.6 KB
/
ci.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
name: CI
on:
push:
branches:
- main
pull_request:
env:
VERSION: "1.8.0.${{github.run_number}}"
jobs:
build:
# windows-latest is required due to some resource stuff.
runs-on: windows-latest
steps:
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1.9.0
with:
dotnet-version: '7.0.x'
- name: Checkout Code
uses: actions/checkout@v2
- name: Install dependencies
run: dotnet restore Source/mqttMultimeter.sln
# Build applications
- name: Build win-x86
run: dotnet publish Source/mqttMultimeter.csproj -r win-x86 -p:Configuration=Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true --self-contained true -property:Version=${{ env.VERSION }}
- name: Zip win-x86 build
uses: vimtor/action-zip@v1
with:
files: Source/bin/Release/win-x86/publish/
dest: mqttMultimeter-windows-x86.zip
- name: Collect win-x86 artifacts
uses: actions/upload-artifact@v2
with:
name: mqttMultimeter-windows-x86
path: ${{ github.workspace }}/mqttMultimeter-windows-x86.zip
- name: Build win-x64
run: dotnet publish Source/mqttMultimeter.csproj -r win-x64 -p:Configuration=Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true --self-contained true -property:Version=${{ env.VERSION }}
- name: Zip win-x64 build
uses: vimtor/action-zip@v1
with:
files: Source/bin/Release/win-x64/publish/
dest: mqttMultimeter-windows-x64.zip
- name: Collect win-x64 artifacts
uses: actions/upload-artifact@v2
with:
name: mqttMultimeter-windows-x64
path: ${{ github.workspace }}/mqttMultimeter-windows-x64.zip
- name: Build win-arm
run: dotnet publish Source/mqttMultimeter.csproj -r win-arm -p:Configuration=Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true --self-contained true -property:Version=${{ env.VERSION }}
- name: Zip win-arm build
uses: vimtor/action-zip@v1
with:
files: Source/bin/Release/win-arm/publish/
dest: mqttMultimeter-windows-arm.zip
- name: Collect win-arm artifacts
uses: actions/upload-artifact@v2
with:
name: mqttMultimeter-windows-arm
path: ${{ github.workspace }}/mqttMultimeter-windows-arm.zip
- name: Build win-arm64
run: dotnet publish Source/mqttMultimeter.csproj -r win-arm64 -p:Configuration=Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true --self-contained true -property:Version=${{ env.VERSION }}
- name: Zip win-arm64 build
uses: vimtor/action-zip@v1
with:
files: Source/bin/Release/win-arm64/publish/
dest: mqttMultimeter-windows-arm64.zip
- name: Collect win-arm64 artifacts
uses: actions/upload-artifact@v2
with:
name: mqttMultimeter-windows-arm64
path: ${{ github.workspace }}/mqttMultimeter-windows-arm64.zip
- name: Build osx-x64
run: dotnet publish Source/mqttMultimeter.csproj -r osx.12-x64 -p:Configuration=Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true -p:IncludeAllContentForSelfExtract=true --self-contained true -property:Version=${{ env.VERSION }}
- name: Zip osx-x64 build
uses: vimtor/action-zip@v1
with:
files: Source/bin/Release/osx.12-x64/publish/
dest: mqttMultimeter-macOS-x64.zip
- name: Collect osx-x64 artifacts
uses: actions/upload-artifact@v2
with:
name: mqttMultimeter-macOS-x64
path: ${{ github.workspace }}/mqttMultimeter-macOS-x64.zip
- name: Build osx-arm64
run: dotnet publish Source/mqttMultimeter.csproj -r osx.12-arm64 -p:Configuration=Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true -p:IncludeAllContentForSelfExtract=true --self-contained true -property:Version=${{ env.VERSION }}
- name: Zip osx-arm64 build
uses: vimtor/action-zip@v1
with:
files: Source/bin/Release/osx.12-arm64/publish/
dest: mqttMultimeter-macOS-arm64.zip
- name: Collect osx-arm64 artifacts
uses: actions/upload-artifact@v2
with:
name: mqttMultimeter-macOS-arm64
path: ${{ github.workspace }}/mqttMultimeter-macOS-arm64.zip
- name: Build linux-x64
run: dotnet publish Source/mqttMultimeter.csproj -r linux-x64 -p:Configuration=Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true --self-contained true -property:Version=${{ env.VERSION }}
- name: Zip linux-x64 build
uses: vimtor/action-zip@v1
with:
files: Source/bin/Release/linux-x64/publish/
dest: mqttMultimeter-linux-x64.zip
- name: Collect linux-x64 artifacts
uses: actions/upload-artifact@v2
with:
name: mqttMultimeter-linux-x64
path: ${{ github.workspace }}/mqttMultimeter-linux-x64.zip
- name: Build linux-arm
run: dotnet publish Source/mqttMultimeter.csproj -r linux-arm -p:Configuration=Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true --self-contained true -property:Version=${{ env.VERSION }}
- name: Zip linux-arm build
uses: vimtor/action-zip@v1
with:
files: Source/bin/Release/linux-arm/publish/
dest: mqttMultimeter-linux-arm.zip
- name: Collect linux-arm artifacts
uses: actions/upload-artifact@v2
with:
name: mqttMultimeter-linux-arm
path: ${{ github.workspace }}/mqttMultimeter-linux-arm.zip
- name: Build linux-arm64
run: dotnet publish Source/mqttMultimeter.csproj -r linux-arm64 -p:Configuration=Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true --self-contained true -property:Version=${{ env.VERSION }}
- name: Zip linux-arm64 build
uses: vimtor/action-zip@v1
with:
files: Source/bin/Release/linux-arm64/publish/
dest: mqttMultimeter-linux-arm64.zip
- name: Collect linux-arm artifacts
uses: actions/upload-artifact@v2
with:
name: mqttMultimeter-linux-arm64
path: ${{ github.workspace }}/mqttMultimeter-linux-arm64.zip
# Release Management
- name: Delete release drafts
uses: hugo19941994/delete-draft-releases@v1.0.0
with:
threshold: 1s
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v1
#if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
tag_name: v${{ env.VERSION }}
generate_release_notes: true
files: |
${{ github.workspace }}/mqttMultimeter-windows-x86.zip
${{ github.workspace }}/mqttMultimeter-windows-x64.zip
${{ github.workspace }}/mqttMultimeter-windows-arm.zip
${{ github.workspace }}/mqttMultimeter-windows-arm64.zip
${{ github.workspace }}/mqttMultimeter-macOS-x64.zip
${{ github.workspace }}/mqttMultimeter-macOS-arm64.zip
${{ github.workspace }}/mqttMultimeter-linux-x64.zip
${{ github.workspace }}/mqttMultimeter-linux-arm.zip
${{ github.workspace }}/mqttMultimeter-linux-arm64.zip