-
Notifications
You must be signed in to change notification settings - Fork 85
/
publish.ps1
executable file
·210 lines (154 loc) · 8.07 KB
/
publish.ps1
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
#!/usr/bin/env pwsh
$AssemblyVersion = "9.9"
if ((Test-Path env:CLI_VERSION) -And $env:CLI_VERSION.StartsWith("refs/tags/v")) {
$AssemblyVersion = $env:CLI_VERSION.Substring(11)
}
Write-Output "version: $AssemblyVersion"
### ado2gh ###
if ((Test-Path env:SKIP_WINDOWS) -And $env:SKIP_WINDOWS.ToUpper() -eq "TRUE") {
Write-Output "Skipping ado2gh Windows build because SKIP_WINDOWS is set"
}
else {
dotnet publish src/ado2gh/ado2gh.csproj -c Release -o dist/win-x64/ -r win-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
Compress-Archive -Path ./dist/win-x64/ado2gh.exe -DestinationPath ./dist/ado2gh.$AssemblyVersion.win-x64.zip -Force
if (Test-Path -Path ./dist/win-x64/ado2gh-windows-amd64.exe) {
Remove-Item ./dist/win-x64/ado2gh-windows-amd64.exe
}
Copy-Item ./dist/win-x64/ado2gh.exe ./dist/win-x64/ado2gh-windows-amd64.exe
dotnet publish src/ado2gh/ado2gh.csproj -c Release -o dist/win-x86/ -r win-x86 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
Compress-Archive -Path ./dist/win-x86/ado2gh.exe -DestinationPath ./dist/ado2gh.$AssemblyVersion.win-x86.zip -Force
if (Test-Path -Path ./dist/win-x86/ado2gh-windows-386.exe) {
Remove-Item ./dist/win-x86/ado2gh-windows-386.exe
}
Copy-Item ./dist/win-x86/ado2gh.exe ./dist/win-x86/ado2gh-windows-386.exe
}
if ((Test-Path env:SKIP_LINUX) -And $env:SKIP_LINUX.ToUpper() -eq "TRUE") {
Write-Output "Skipping ado2gh Linux build because SKIP_LINUX is set"
}
else {
dotnet publish src/ado2gh/ado2gh.csproj -c Release -o dist/linux-x64/ -r linux-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
tar -cvzf ./dist/ado2gh.$AssemblyVersion.linux-x64.tar.gz -C ./dist/linux-x64 ado2gh
if (Test-Path -Path ./dist/linux-x64/ado2gh-linux-amd64) {
Remove-Item ./dist/linux-x64/ado2gh-linux-amd64
}
Copy-Item ./dist/linux-x64/ado2gh ./dist/linux-x64/ado2gh-linux-amd64
}
if ((Test-Path env:SKIP_MACOS) -And $env:SKIP_MACOS.ToUpper() -eq "TRUE") {
Write-Output "Skipping ado2gh MacOS build because SKIP_MACOS is set"
}
else {
dotnet publish src/ado2gh/ado2gh.csproj -c Release -o dist/osx-x64/ -r osx-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
tar -cvzf ./dist/ado2gh.$AssemblyVersion.osx-x64.tar.gz -C ./dist/osx-x64 ado2gh
if (Test-Path -Path ./dist/osx-x64/ado2gh-darwin-amd64) {
Remove-Item ./dist/osx-x64/ado2gh-darwin-amd64
}
Copy-Item ./dist/osx-x64/ado2gh ./dist/osx-x64/ado2gh-darwin-amd64
}
### gei ###
if ((Test-Path env:SKIP_WINDOWS) -And $env:SKIP_WINDOWS.ToUpper() -eq "TRUE") {
Write-Output "Skipping gei Windows build because SKIP_WINDOWS is set"
}
else {
dotnet publish src/gei/gei.csproj -c Release -o dist/win-x64/ -r win-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
if (Test-Path -Path ./dist/win-x64/gei-windows-amd64.exe) {
Remove-Item ./dist/win-x64/gei-windows-amd64.exe
}
Rename-Item ./dist/win-x64/gei.exe gei-windows-amd64.exe
dotnet publish src/gei/gei.csproj -c Release -o dist/win-x86/ -r win-x86 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
if (Test-Path -Path ./dist/win-x86/gei-windows-386.exe) {
Remove-Item ./dist/win-x86/gei-windows-386.exe
}
Rename-Item ./dist/win-x86/gei.exe gei-windows-386.exe
}
if ((Test-Path env:SKIP_LINUX) -And $env:SKIP_LINUX.ToUpper() -eq "TRUE") {
Write-Output "Skipping gei Linux build because SKIP_LINUX is set"
}
else {
dotnet publish src/gei/gei.csproj -c Release -o dist/linux-x64/ -r linux-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
if (Test-Path -Path ./dist/linux-x64/gei-linux-amd64) {
Remove-Item ./dist/linux-x64/gei-linux-amd64
}
Rename-Item ./dist/linux-x64/gei gei-linux-amd64
}
if ((Test-Path env:SKIP_MACOS) -And $env:SKIP_MACOS.ToUpper() -eq "TRUE") {
Write-Output "Skipping gei MacOS build because SKIP_MACOS is set"
}
else {
dotnet publish src/gei/gei.csproj -c Release -o dist/osx-x64/ -r osx-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
if (Test-Path -Path ./dist/osx-x64/gei-darwin-amd64) {
Remove-Item ./dist/osx-x64/gei-darwin-amd64
}
Rename-Item ./dist/osx-x64/gei gei-darwin-amd64
}
### bbs2gh ###
if ((Test-Path env:SKIP_WINDOWS) -And $env:SKIP_WINDOWS.ToUpper() -eq "TRUE") {
Write-Output "Skipping bbs2gh Windows build because SKIP_WINDOWS is set"
}
else {
dotnet publish src/bbs2gh/bbs2gh.csproj -c Release -o dist/win-x64/ -r win-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
if (Test-Path -Path ./dist/win-x64/bbs2gh-windows-amd64.exe) {
Remove-Item ./dist/win-x64/bbs2gh-windows-amd64.exe
}
Rename-Item ./dist/win-x64/bbs2gh.exe bbs2gh-windows-amd64.exe
dotnet publish src/bbs2gh/bbs2gh.csproj -c Release -o dist/win-x86/ -r win-x86 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
if (Test-Path -Path ./dist/win-x86/bbs2gh-windows-386.exe) {
Remove-Item ./dist/win-x86/bbs2gh-windows-386.exe
}
Rename-Item ./dist/win-x86/bbs2gh.exe bbs2gh-windows-386.exe
}
if ((Test-Path env:SKIP_LINUX) -And $env:SKIP_LINUX.ToUpper() -eq "TRUE") {
Write-Output "Skipping bbs2gh Linux build because SKIP_LINUX is set"
}
else {
dotnet publish src/bbs2gh/bbs2gh.csproj -c Release -o dist/linux-x64/ -r linux-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
if (Test-Path -Path ./dist/linux-x64/bbs2gh-linux-amd64) {
Remove-Item ./dist/linux-x64/bbs2gh-linux-amd64
}
Rename-Item ./dist/linux-x64/bbs2gh bbs2gh-linux-amd64
}
if ((Test-Path env:SKIP_MACOS) -And $env:SKIP_MACOS.ToUpper() -eq "TRUE") {
Write-Output "Skipping bbs2gh MacOS build because SKIP_MACOS is set"
}
else {
dotnet publish src/bbs2gh/bbs2gh.csproj -c Release -o dist/osx-x64/ -r osx-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true /p:VersionPrefix=$AssemblyVersion
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
if (Test-Path -Path ./dist/osx-x64/bbs2gh-darwin-amd64) {
Remove-Item ./dist/osx-x64/bbs2gh-darwin-amd64
}
Rename-Item ./dist/osx-x64/bbs2gh bbs2gh-darwin-amd64
}