From c49119aef36ed872fb6c0fd33d93e8fb4c35e759 Mon Sep 17 00:00:00 2001 From: Abdulwahb Isam Date: Fri, 16 Oct 2026 08:51:46 +0300 Subject: [PATCH] disktree: feat: publish the Windows setup with each release The windows release job installs Inno Setup 7.1.0 from its GitHub release, checked against a pinned SHA256 (the runners carry 6.7.1 and 6.6.1), compiles packaging/windows/disktree.iss for the job's architecture, and uploads the setup with a sha256 file in the same format as the zip's. Verified: the pinned hash is of the downloaded installer, whose Authenticode signature is valid; the workflow parses. Not yet run in Actions. --- .github/workflows/release.yml | 40 ++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04712f5..abd4f5e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -250,13 +250,51 @@ jobs: [IO.File]::WriteAllText("dist/$name.zip.sha256", "$hash $name.zip`n") "archive=dist/$name.zip" >> $env:GITHUB_OUTPUT + - name: Install Inno Setup + shell: pwsh + # Pinned and checked rather than the runner's own: the two images + # carry different, older versions. + env: + INNO_URL: https://github.com/jrsoftware/issrc/releases/download/is-7_1_0/innosetup-7.1.0-x64.exe + INNO_SHA256: 0362a383ed217d4c4239b5933866dd96d3eb2102737da92f80f6057a4b40df2f + run: | + $setup = "$env:RUNNER_TEMP/innosetup.exe" + $dir = "$env:RUNNER_TEMP/inno" + Invoke-WebRequest $env:INNO_URL -OutFile $setup + $hash = (Get-FileHash $setup -Algorithm SHA256).Hash.ToLower() + if ($hash -ne $env:INNO_SHA256) { + throw "Inno Setup download has SHA256 $hash" + } + Start-Process $setup -Wait -ArgumentList ` + '/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART', '/SP-', + '/CURRENTUSER', "/DIR=$dir" + "$dir" >> $env:GITHUB_PATH + + - name: Installer + id: installer + shell: pwsh + env: + VERSION: ${{ needs.release.outputs.version }} + ARCH: ${{ matrix.arch }} + run: | + ISCC.exe /Q "/DAppVersion=$env:VERSION" "/DArch=$env:ARCH" ` + packaging/windows/disktree.iss + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $name = "disktree-$env:VERSION-$env:ARCH-windows-setup.exe" + $hash = (Get-FileHash "target/bundle/$name" -Algorithm SHA256).Hash.ToLower() + [IO.File]::WriteAllText("target/bundle/$name.sha256", "$hash $name`n") + "setup=target/bundle/$name" >> $env:GITHUB_OUTPUT + - name: Upload shell: bash env: GH_TOKEN: ${{ github.token }} TAG: ${{ needs.release.outputs.tag }} ARCHIVE: ${{ steps.package.outputs.archive }} - run: gh release upload "$TAG" "$ARCHIVE" "$ARCHIVE.sha256" --clobber + SETUP: ${{ steps.installer.outputs.setup }} + run: | + gh release upload "$TAG" "$ARCHIVE" "$ARCHIVE.sha256" \ + "$SETUP" "$SETUP.sha256" --clobber publish: name: Publish