mirror of
https://github.com/tobi/disktree.git
synced 2026-12-04 08:01:05 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user