Skip to content

Commit

Permalink
Simplify build script
Browse files Browse the repository at this point in the history
  • Loading branch information
geluk committed Jan 14, 2024
1 parent 50e645d commit 0961060
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 67 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
# Build artifacts
[Bb]in/
[Oo]bj/
artifacts/
version.txt
37 changes: 37 additions & 0 deletions build-package.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
$ArtifactsDir="artifacts"
$WorkDir="$ArtifactsDir/workdir"
$IncludeDir="$WorkDir/lib"

if (Test-Path $ArtifactsDir) {
Remove-Item -Recurse "$ArtifactsDir"
}
New-Item -ItemType Directory -Force "$WorkDir"

dotnet publish --configuration Release

$PublishDir="bin/Release/net6.0-windows/win-x64/publish"

function CreateArchive {
param (
$ZipName
)

$ZipPath = "$ArtifactsDir/$ZipName"
./tools/7za.exe a -mx=9 $ZipPath "$WorkDir/*"
./tools/7za.exe rn $ZipPath $WorkDir "pass-winmenu"
}

Copy-Item "pass-winmenu/$PublishDir/pass-winmenu.exe" "$WorkDir/pass-winmenu.exe"
Copy-Item "pass-winmenu/embedded/default-config.yaml" "$WorkDir/pass-winmenu.yaml"
./tools/7za.exe x -aos "include/GnuPG.zip" "-o$IncludeDir"
./tools/patch.exe --no-backup-if-mismatch "$WorkDir/pass-winmenu.yaml" "include/packaged-config.patch"
CreateArchive "pass-winmenu.zip"

Remove-Item -Recurse "$WorkDir/*"
Copy-Item "pass-winmenu/$PublishDir/pass-winmenu.exe" "$WorkDir/pass-winmenu.exe"
Copy-Item "pass-winmenu/embedded/default-config.yaml" "$WorkDir/pass-winmenu.yaml"
./tools/patch.exe --no-backup-if-mismatch "$WorkDir/pass-winmenu.yaml" "include/packaged-config-nogpg.patch"
CreateArchive "pass-winmenu-nogpg.zip"

Copy-Item "pass-winmenu/$PublishDir/pass-winmenu.exe" "$ArtifactsDir/pass-winmenu.exe"
Copy-Item "commandline/$PublishDir/pw.exe" "$ArtifactsDir/pw.exe"
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions pass-winmenu.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
.gitignore = .gitignore
README.md = README.md
build-package.ps1 = build-package.ps1
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "commandline", "commandline\commandline.csproj", "{007CC95A-4244-4578-B215-BD0DF6FEA6AA}"
Expand Down
67 changes: 0 additions & 67 deletions pass-winmenu/build-package.ps1

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 comments on commit 0961060

Please sign in to comment.