From f3949c6ecad3e8c80f6e189a27f58a9ab71c9d67 Mon Sep 17 00:00:00 2001 From: Kerolos Atallah Date: Wed, 12 Aug 2026 22:23:03 +0300 Subject: [PATCH 1/2] Verify Windows CLI releases --- .github/workflows/ci.yml | 25 +++++++++ .github/workflows/release-smoke.yml | 85 +++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 .github/workflows/release-smoke.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b32cb8..0729744 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,31 @@ jobs: - name: Build run: go build ./cmd/outagedeck + windows: + runs-on: windows-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 + with: + go-version-file: go.mod + cache: false + - name: Test + run: go test ./... + - name: Build + run: go build -ldflags "-X main.version=ci" -o outagedeck.exe ./cmd/outagedeck + - name: Check commands + shell: pwsh + run: | + if ((.\outagedeck.exe version) -ne "ci") { + throw "Unexpected version output" + } + + $alerts = .\outagedeck.exe alerts github cloudflare + if ($alerts -notmatch "stack=github%2Ccloudflare") { + throw "Alerts command did not return the expected stack link" + } + container: runs-on: ubuntu-latest timeout-minutes: 10 diff --git a/.github/workflows/release-smoke.yml b/.github/workflows/release-smoke.yml new file mode 100644 index 0000000..512d370 --- /dev/null +++ b/.github/workflows/release-smoke.yml @@ -0,0 +1,85 @@ +name: Verify Windows release + +on: + release: + types: [published] + workflow_dispatch: + inputs: + version: + description: Release version without the v prefix + required: true + default: "0.1.3" + +permissions: + contents: read + +jobs: + windows: + runs-on: windows-latest + timeout-minutes: 10 + steps: + - name: Resolve version + id: version + shell: pwsh + env: + RELEASE_TAG: ${{ github.event.release.tag_name }} + REQUESTED_VERSION: ${{ inputs.version }} + run: | + $version = if ($env:REQUESTED_VERSION) { + $env:REQUESTED_VERSION + } else { + ($env:RELEASE_TAG).TrimStart("v") + } + + if ($version -notmatch '^[0-9]+\.[0-9]+\.[0-9]+([-.][0-9A-Za-z.-]+)?$') { + throw "Invalid version: $version" + } + + "version=$version" >> $env:GITHUB_OUTPUT + + - name: Download release + shell: pwsh + env: + VERSION: ${{ steps.version.outputs.version }} + run: | + $baseUrl = "https://github.com/outagedeck/cli/releases/download/v$env:VERSION" + $archive = "outagedeck_$($env:VERSION)_windows_amd64.zip" + + Invoke-WebRequest "$baseUrl/$archive" -OutFile $archive + Invoke-WebRequest "$baseUrl/checksums.txt" -OutFile checksums.txt + + - name: Verify archive + shell: pwsh + env: + VERSION: ${{ steps.version.outputs.version }} + run: | + $archive = "outagedeck_$($env:VERSION)_windows_amd64.zip" + $entry = Get-Content checksums.txt | Where-Object { $_ -match " $([regex]::Escape($archive))$" } + if (-not $entry) { + throw "Checksum entry not found for $archive" + } + + $expected = ($entry -split "\s+")[0].ToUpperInvariant() + $actual = (Get-FileHash $archive -Algorithm SHA256).Hash + if ($actual -ne $expected) { + throw "Checksum mismatch for $archive" + } + + Expand-Archive $archive -DestinationPath release + if (-not (Test-Path release/outagedeck.exe)) { + throw "outagedeck.exe is missing from $archive" + } + + - name: Check commands + shell: pwsh + env: + VERSION: ${{ steps.version.outputs.version }} + run: | + if ((.\release\outagedeck.exe version) -ne $env:VERSION) { + throw "Unexpected version output" + } + + $alerts = .\release\outagedeck.exe alerts github cloudflare + if ($alerts -notmatch "stack=github%2Ccloudflare") { + throw "Alerts command did not return the expected stack link" + } From f3bc75f3beab963474f8bb554c347c8a0c9ac2d0 Mon Sep 17 00:00:00 2001 From: Kerolos Atallah Date: Wed, 12 Aug 2026 22:25:09 +0300 Subject: [PATCH 2/2] Fix Windows smoke output matching --- .github/workflows/ci.yml | 2 +- .github/workflows/release-smoke.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0729744..df8eca5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: throw "Unexpected version output" } - $alerts = .\outagedeck.exe alerts github cloudflare + $alerts = .\outagedeck.exe alerts github cloudflare | Out-String if ($alerts -notmatch "stack=github%2Ccloudflare") { throw "Alerts command did not return the expected stack link" } diff --git a/.github/workflows/release-smoke.yml b/.github/workflows/release-smoke.yml index 512d370..fdd4305 100644 --- a/.github/workflows/release-smoke.yml +++ b/.github/workflows/release-smoke.yml @@ -79,7 +79,7 @@ jobs: throw "Unexpected version output" } - $alerts = .\release\outagedeck.exe alerts github cloudflare + $alerts = .\release\outagedeck.exe alerts github cloudflare | Out-String if ($alerts -notmatch "stack=github%2Ccloudflare") { throw "Alerts command did not return the expected stack link" }