diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 683a56d3f..095a91134 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -500,10 +500,16 @@ jobs: path: updates-server token: ${{ secrets.DEPLOY_KEY }} - - name: Download object files + - name: Download signed windows objects if: ${{ inputs.update_branch == 'release' }} + env: + GH_TOKEN: ${{ secrets.DEPLOY_KEY }} run: | - git clone https://github.com/zen-browser/windows-binaries.git .github/workflows/object --depth 1 + mkdir -p .github/workflows/object + gh release download "windows-signed-${{ github.run_id }}" \ + --repo zen-browser/windows-binaries \ + --pattern 'windows-x64-signed-*.tar.gz' \ + --dir .github/workflows/object for arch in x86_64 arm64; do archive=".github/workflows/object/windows-x64-signed-$arch.tar.gz" @@ -624,6 +630,17 @@ jobs: ./.github/workflows/object/windows-x64-signed-arm64/zen.installer-arm64.exe ./zen.macos-universal.dmg/* + - name: Clean up signed windows staging release + if: ${{ inputs.update_branch == 'release' }} + env: + GH_TOKEN: ${{ secrets.DEPLOY_KEY }} + run: | + # The per-run staging prerelease on windows-binaries has served its purpose + # now that the signed bundles are published in the real release. Never fail + # the release over this cleanup. + gh release delete "windows-signed-${{ github.run_id }}" \ + --repo zen-browser/windows-binaries --cleanup-tag --yes || true + prepare-flatpak: if: ${{ inputs.create_release && inputs.update_branch == 'release' }} permissions: write-all diff --git a/build/windows/sign.ps1 b/build/windows/sign.ps1 index d01209fe8..83f2ff040 100644 --- a/build/windows/sign.ps1 +++ b/build/windows/sign.ps1 @@ -202,9 +202,8 @@ function SignAndPackage($name) { # Move the manifest mv .\dist\update\. windsign-temp\windows-x64-signed-$name\update_manifest - # note: We need to sign it into a parent folder, called windows-x64-signed-$name - rmdir .\windsign-temp\windows-binaries\windows-x64-signed-$name -Recurse -ErrorAction SilentlyContinue - mv windsign-temp\windows-x64-signed-$name .\windsign-temp\windows-binaries -Force + # The signed bundle stays in windsign-temp\windows-x64-signed-$name; it is + # compressed and uploaded to the staging release once every .exe is signed. rmdir engine\obj-$objName-pc-windows-msvc\ -Recurse -ErrorAction SilentlyContinue echo "Finished $name" @@ -213,32 +212,42 @@ function SignAndPackage($name) { SignAndPackage arm64 SignAndPackage x86_64 -$files = Get-ChildItem .\windsign-temp\windows-binaries -Recurse -Include *.exe +$files = Get-ChildItem .\windsign-temp\windows-x64-signed-x86_64, .\windsign-temp\windows-x64-signed-arm64 -Recurse -Include *.exe signtool.exe sign /n "$SignIdentity" /t http://time.certum.pl/ /fd sha256 /v $files -# Compress each signed bundle into a gzip tarball and drop the raw folder, so the -# windows-binaries repo only ever stores the compressed archive. The tar is -# created with `-C