Skip to content

Commit 0961060

Browse files
committed
Simplify build script
1 parent 50e645d commit 0961060

16 files changed

+39
-67
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
# Build artifacts
88
[Bb]in/
99
[Oo]bj/
10+
artifacts/
1011
version.txt

build-package.ps1

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
$ArtifactsDir="artifacts"
2+
$WorkDir="$ArtifactsDir/workdir"
3+
$IncludeDir="$WorkDir/lib"
4+
5+
if (Test-Path $ArtifactsDir) {
6+
Remove-Item -Recurse "$ArtifactsDir"
7+
}
8+
New-Item -ItemType Directory -Force "$WorkDir"
9+
10+
dotnet publish --configuration Release
11+
12+
$PublishDir="bin/Release/net6.0-windows/win-x64/publish"
13+
14+
function CreateArchive {
15+
param (
16+
$ZipName
17+
)
18+
19+
$ZipPath = "$ArtifactsDir/$ZipName"
20+
./tools/7za.exe a -mx=9 $ZipPath "$WorkDir/*"
21+
./tools/7za.exe rn $ZipPath $WorkDir "pass-winmenu"
22+
}
23+
24+
Copy-Item "pass-winmenu/$PublishDir/pass-winmenu.exe" "$WorkDir/pass-winmenu.exe"
25+
Copy-Item "pass-winmenu/embedded/default-config.yaml" "$WorkDir/pass-winmenu.yaml"
26+
./tools/7za.exe x -aos "include/GnuPG.zip" "-o$IncludeDir"
27+
./tools/patch.exe --no-backup-if-mismatch "$WorkDir/pass-winmenu.yaml" "include/packaged-config.patch"
28+
CreateArchive "pass-winmenu.zip"
29+
30+
Remove-Item -Recurse "$WorkDir/*"
31+
Copy-Item "pass-winmenu/$PublishDir/pass-winmenu.exe" "$WorkDir/pass-winmenu.exe"
32+
Copy-Item "pass-winmenu/embedded/default-config.yaml" "$WorkDir/pass-winmenu.yaml"
33+
./tools/patch.exe --no-backup-if-mismatch "$WorkDir/pass-winmenu.yaml" "include/packaged-config-nogpg.patch"
34+
CreateArchive "pass-winmenu-nogpg.zip"
35+
36+
Copy-Item "pass-winmenu/$PublishDir/pass-winmenu.exe" "$ArtifactsDir/pass-winmenu.exe"
37+
Copy-Item "commandline/$PublishDir/pw.exe" "$ArtifactsDir/pw.exe"
File renamed without changes.
File renamed without changes.

pass-winmenu.sln

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1212
.editorconfig = .editorconfig
1313
.gitignore = .gitignore
1414
README.md = README.md
15+
build-package.ps1 = build-package.ps1
1516
EndProjectSection
1617
EndProject
1718
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "commandline", "commandline\commandline.csproj", "{007CC95A-4244-4578-B215-BD0DF6FEA6AA}"

pass-winmenu/build-package.ps1

-67
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)