From 588fe2e6475dc019155754737f3f2f8da523ac77 Mon Sep 17 00:00:00 2001 From: Dennis Fokin Date: Wed, 29 Jun 2022 15:28:04 +0200 Subject: [PATCH 1/4] Win: release script --- .github/workflows/windows.yml | 1 + resources/win/release-win.ps1 | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 resources/win/release-win.ps1 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e95b10c1..bb318f2b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -70,6 +70,7 @@ jobs: mkdir $dest mv build\windows\runner\Release\* $dest\ mv yubioath-desktop.msi deploy + mv resources\win\release-win.ps1 deploy - name: Upload artifact uses: actions/upload-artifact@v1 diff --git a/resources/win/release-win.ps1 b/resources/win/release-win.ps1 new file mode 100644 index 00000000..97b15fbb --- /dev/null +++ b/resources/win/release-win.ps1 @@ -0,0 +1,24 @@ +echo "Cloning the Git repo" +git clone git@github.com:Yubico/yubioath-desktop-private.git + +echo "Renaming the Actions folder and moving it" +mv yubioath-desktop-main-windows release +mv release yubioath-desktop-private + +echo "Signing the executables" +cd yubioath-desktop-private +echo "Sleeping 5s: Change to signing key" +Start-Sleep -s 5 +signtool.exe sign /fd SHA256 /t http://timestamp.digicert.com/scripts/timstamp.dll release/authenticator.exe +signtool.exe sign /fd SHA256 /t http://timestamp.digicert.com/scripts/timstamp.dll release/helper/authenticator-helper.exe + +echo "Setting env var and building installer" +$env:SRCDIR = ".\release\" +heat dir .\release -out fragment.wxs -gg -scom -srd -sfrag -dr INSTALLDIR -cg ApplicationFiles -var env.SRCDIR +candle .\fragment.wxs .\resources\win\yubioath-desktop.wxs -ext WixUtilExtension -arch x64 +light fragment.wixobj yubioath-desktop.wixobj -ext WixUIExtension -ext WixUtilExtension -o yubioath-desktop-VERSION-win64.msi + +echo "Signing the installer" +signtool.exe sign /d "Yubico Authenticator" /fd SHA256 /t http://timestamp.digicert.com/scripts/timstamp.dll yubioath-desktop-VERSION-win64.msi + +echo "All done" From df03354554a99be34e0a3e060c73f4cee3e3d6dc Mon Sep 17 00:00:00 2001 From: Dennis Fokin Date: Thu, 30 Jun 2022 11:20:57 +0200 Subject: [PATCH 2/4] Add version as a parameter to the script --- resources/win/release-win.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/win/release-win.ps1 b/resources/win/release-win.ps1 index 97b15fbb..a064da40 100644 --- a/resources/win/release-win.ps1 +++ b/resources/win/release-win.ps1 @@ -1,3 +1,5 @@ +$version = $args[0] + echo "Cloning the Git repo" git clone git@github.com:Yubico/yubioath-desktop-private.git @@ -16,9 +18,9 @@ echo "Setting env var and building installer" $env:SRCDIR = ".\release\" heat dir .\release -out fragment.wxs -gg -scom -srd -sfrag -dr INSTALLDIR -cg ApplicationFiles -var env.SRCDIR candle .\fragment.wxs .\resources\win\yubioath-desktop.wxs -ext WixUtilExtension -arch x64 -light fragment.wixobj yubioath-desktop.wixobj -ext WixUIExtension -ext WixUtilExtension -o yubioath-desktop-VERSION-win64.msi +light fragment.wixobj yubioath-desktop.wixobj -ext WixUIExtension -ext WixUtilExtension -o yubioath-desktop-$version-win64.msi echo "Signing the installer" -signtool.exe sign /d "Yubico Authenticator" /fd SHA256 /t http://timestamp.digicert.com/scripts/timstamp.dll yubioath-desktop-VERSION-win64.msi +signtool.exe sign /d "Yubico Authenticator" /fd SHA256 /t http://timestamp.digicert.com/scripts/timstamp.dll yubioath-desktop-$version-win64.msi echo "All done" From 63bb6d88ead2be0ea84bf4db0b5262715c2df222 Mon Sep 17 00:00:00 2001 From: Dennis Fokin Date: Thu, 30 Jun 2022 12:04:24 +0200 Subject: [PATCH 3/4] Win: cleanup the script --- .github/workflows/windows.yml | 2 +- resources/win/release-win.ps1 | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bb318f2b..2f656c96 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -70,7 +70,7 @@ jobs: mkdir $dest mv build\windows\runner\Release\* $dest\ mv yubioath-desktop.msi deploy - mv resources\win\release-win.ps1 deploy + mv resources deploy - name: Upload artifact uses: actions/upload-artifact@v1 diff --git a/resources/win/release-win.ps1 b/resources/win/release-win.ps1 index a064da40..39d697ab 100644 --- a/resources/win/release-win.ps1 +++ b/resources/win/release-win.ps1 @@ -1,16 +1,9 @@ $version = $args[0] -echo "Cloning the Git repo" -git clone git@github.com:Yubico/yubioath-desktop-private.git - echo "Renaming the Actions folder and moving it" -mv yubioath-desktop-main-windows release -mv release yubioath-desktop-private +mv yubioath-desktop-* release echo "Signing the executables" -cd yubioath-desktop-private -echo "Sleeping 5s: Change to signing key" -Start-Sleep -s 5 signtool.exe sign /fd SHA256 /t http://timestamp.digicert.com/scripts/timstamp.dll release/authenticator.exe signtool.exe sign /fd SHA256 /t http://timestamp.digicert.com/scripts/timstamp.dll release/helper/authenticator-helper.exe From 61804c726eff5aaa4d7c9c1a739dfa53ab10114d Mon Sep 17 00:00:00 2001 From: Dennis Fokin Date: Fri, 1 Jul 2022 09:12:54 +0200 Subject: [PATCH 4/4] Fix version number through set-version.py --- resources/win/release-win.ps1 | 2 +- set-version.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/win/release-win.ps1 b/resources/win/release-win.ps1 index 39d697ab..a778cc1a 100644 --- a/resources/win/release-win.ps1 +++ b/resources/win/release-win.ps1 @@ -1,4 +1,4 @@ -$version = $args[0] +$version=6.0.0-dev.0 echo "Renaming the Actions folder and moving it" mv yubioath-desktop-* release diff --git a/set-version.py b/set-version.py index a8dc4790..9329c08a 100755 --- a/set-version.py +++ b/set-version.py @@ -131,7 +131,15 @@ def update_helper_version(buf): ) return buf +# release-win.ps1 +def update_release_win(buf): + return sub1( + rf'\$version={version_pattern}', + f'$version={version}', + buf, + ) update_file("pubspec.yaml", update_pubspec) update_file("windows/runner/Runner.rc", update_runner_rc) -update_file("helper/version_info.txt", update_helper_version) \ No newline at end of file +update_file("helper/version_info.txt", update_helper_version) +update_file("resources/win/release-win.ps1", update_release_win) \ No newline at end of file