hex/.github/workflows/windows-installer.yml
Dax Raad 2ad25a5bb6 ci(release): resolve target URLs against the manifest URL
The release service now writes root-relative target URLs (/release/<app>/files/<sha256>/<name>); the publish check, the AUR source, the installers, the Windows installer test, and the site resolve them against the manifest's URL. A dev site without a platform's build links its frozen 2.3.1 download.
2026-10-24 11:32:25 -04:00

105 lines
3.9 KiB
YAML

name: Windows installer
# Builds and silently tests Hex-Setup-<version>-windows-<x64|arm64>.exe
# around the executables the release service publishes (the stable manifest
# on anoma.ly/release, or dev.anoma.ly/release before the first release), so
# installer changes are tested on real Windows runners without a full
# release. Release builds the installers for new releases itself.
on:
pull_request:
paths:
- packaging/windows/**
- resources/windows/hex.ico
- scripts/build-windows-installer.ps1
- scripts/test-windows-installer.ps1
- .github/workflows/windows-installer.yml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: windows-installer-${{ github.ref }}
cancel-in-progress: true
jobs:
published:
name: Fetch the published release
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.fetch.outputs.version }}
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- id: fetch
name: Download the published Windows executables and check them against the manifest
run: |
for release in https://anoma.ly/release https://dev.anoma.ly/release; do
manifest="$release/hex/desktop/stable.json"
curl --fail --silent --show-error --proto '=https' "$manifest" -o manifest.json && break
rm -f manifest.json
done
test -f manifest.json
version=$(jq -er .release.version manifest.json)
mkdir -p dist
for label in x64 arm64; do
url="${release%/release}$(jq -er --arg t "windows-$label" '.release.targets[$t].url' manifest.json)"
file="dist/Hex-$version-windows-$label.exe"
curl --fail --silent --show-error --proto '=https' "$url" -o "$file"
test "$(sha256sum < "$file" | cut -d' ' -f1)" = "$(jq -r --arg t "windows-$label" '.release.targets[$t].sha256' manifest.json)"
done
echo "Testing installers around Hex $version from $manifest." >> "$GITHUB_STEP_SUMMARY"
echo "version=$version" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v7
with:
name: published
path: dist/
if-no-files-found: error
installer:
name: Installer ${{ matrix.arch }}
needs: published
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
label: x64
runner: windows-latest
- arch: aarch64
label: arm64
runner: windows-11-arm
env:
HEX_VERSION: ${{ needs.published.outputs.version }}
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: actions/download-artifact@v8
with:
name: published
path: published
- name: Build the installer
shell: pwsh
run: |
$exe = (Resolve-Path "published/Hex-$env:HEX_VERSION-windows-${{ matrix.label }}.exe").Path
"HEX_EXE=$exe" | Out-File -FilePath $env:GITHUB_ENV -Append
scripts/build-windows-installer.ps1 -Executable $exe -Version $env:HEX_VERSION -Arch ${{ matrix.arch }} -OutDir installers
- name: Install, reinstall, refuse a downgrade, and uninstall silently
shell: pwsh
run: scripts/test-windows-installer.ps1 -Installer "installers/Hex-Setup-$env:HEX_VERSION-windows-${{ matrix.label }}.exe" -Executable $env:HEX_EXE -Version $env:HEX_VERSION
- name: Upload installer logs
if: always()
uses: actions/upload-artifact@v7
with:
name: installer-logs-${{ matrix.label }}
path: ${{ runner.temp }}/hex-installer-logs
if-no-files-found: ignore
- uses: actions/upload-artifact@v7
with:
name: hex-setup-${{ matrix.label }}
path: installers/
if-no-files-found: error