ci: Fix broken windows deploy for msi and choco

This commit is contained in:
ClementTsang 2020-08-23 14:49:24 -04:00
parent 279504e401
commit 3165918d52
3 changed files with 14 additions and 4 deletions

View file

@ -54,9 +54,12 @@ before_deploy:
strip "./target/i686-pc-windows-msvc/release/btm";
mv "./target/i686-pc-windows-msvc/release/btm" "btm.exe";
zip bottom_i686-pc-windows-msvc.zip "btm.exe";
python "./deployment/windows/choco/choco_packager.py" "bottom_i686-pc-windows-msvc.zip" "bottom_x86_64-pc-windows-msvc.zip" $TRAVIS_TAG "./deployment/windows/choco/bottom.nuspec.template" "./deployment/windows/choco/chocolateyinstall.ps1.template";
python "./deployment/windows/choco/choco_packager.py" "bottom_i686-pc-windows-msvc.zip" "bottom_x86_64-pc-windows-msvc.zip" $TRAVIS_TAG "./deployment/windows/choco/bottom.nuspec.template" "./deployment/windows/choco/chocolateyinstall.ps1.template" "./deployment/windows/choco/bottom.nuspec" "./deployment/windows/choco/tools/chocolateyinstall.ps1";
zip choco.zip "./deployment/windows/choco/bottom.nuspec" "./deployment/windows/choco/tools/";
choco install wixtoolset;
# Generating msi
# See https://travis-ci.community/t/unable-to-install-wix-toolset/1071 for why we do nuget.
choco install nuget.commandline;
nuget install WiX.Toolset;
cargo install cargo-wix;
cargo wix init;
cargo wix;

View file

@ -13,12 +13,14 @@
"Qudsi",
"SIGTERM",
"Tebibytes",
"Toolset",
"Ungrouped",
"WASD",
"Wojnarowski",
"andys",
"choco",
"cmdline",
"commandline",
"crossterm",
"curr",
"czvf",
@ -33,6 +35,7 @@
"minwindef",
"noheader",
"ntdef",
"nuget",
"paren",
"pmem",
"processthreadsapi",

View file

@ -12,6 +12,8 @@ deployment_file_path_64 = args[2]
version = args[3]
nuspec_template = args[4]
ps1_template = args[5]
generated_nuspec = args[6]
generated_ps1 = args[7]
print("Generating Chocolatey package for:")
print(" 32-bit: %s", deployment_file_path_32)
@ -19,6 +21,8 @@ print(" 64-bit: %s", deployment_file_path_64)
print(" VERSION: %s" % version)
print(" NUSPEC TEMPLATE: %s" % nuspec_template)
print(" PS1 TEMPLATE: %s" % ps1_template)
print(" GENERATED NUSPEC: %s" % generated_nuspec)
print(" GENERATED_PS1: %s" % generated_ps1)
with open(deployment_file_path_32, "rb") as deployment_file_32, open(
deployment_file_path_64, "rb"
@ -36,7 +40,7 @@ with open(deployment_file_path_32, "rb") as deployment_file_32, open(
print(substitute)
print("\n============================================================\n")
with open("./bottom.nuspec", "w") as generated_file:
with open(generated_nuspec, "w") as generated_file:
generated_file.write(substitute)
os.makedirs("tools")
@ -47,6 +51,6 @@ with open(deployment_file_path_32, "rb") as deployment_file_32, open(
print(substitute)
print("\n============================================================\n")
with open("./tools/chocolateyinstall.ps1", "w") as generated_file:
with open(generated_ps1, "w") as generated_file:
generated_file.write(substitute)