- scripts/build-release-notes.ps1 extracts the `## <tag>` section and wraps it with download, stable runtime, license and compare links; it fails if the section is missing or empty. - CI checks that CHANGELOG.md has notes for the version in version.go. - release.yml uses those notes instead of --generate-notes, checks out the dispatched tag, fails on gh errors, and backfills notes on an existing release whose body is empty or only the auto "Full Changelog" link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
62 lines
1.9 KiB
YAML
62 lines
1.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
verify:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
cache-dependency-path: frontend/pnpm-lock.yaml
|
|
|
|
- name: Verify CHANGELOG.md matches current version
|
|
shell: pwsh
|
|
run: |
|
|
$ErrorActionPreference = 'Stop'
|
|
$verFile = Get-Content -Raw -LiteralPath 'internal/version/version.go'
|
|
if ($verFile -notmatch 'var\s+Version\s*=\s*"(v[^"]+)"') {
|
|
throw 'Could not parse Version from internal/version/version.go'
|
|
}
|
|
$ver = $Matches[1]
|
|
$tmp = Join-Path $env:RUNNER_TEMP "release-notes-$ver.md"
|
|
& ./scripts/build-release-notes.ps1 -Tag $ver -OutFile $tmp
|
|
Write-Host "PASS CHANGELOG.md contains valid release notes for $ver ($((Get-Item -LiteralPath $tmp).Length) bytes)"
|
|
|
|
- name: Frontend build
|
|
shell: pwsh
|
|
run: |
|
|
pnpm --dir frontend install --frozen-lockfile
|
|
pnpm --dir frontend build
|
|
|
|
- name: Go test & vet
|
|
shell: pwsh
|
|
run: |
|
|
go test ./...
|
|
go vet ./...
|
|
|
|
- name: Build reims-go.exe (window + command-line mode)
|
|
shell: pwsh
|
|
run: |
|
|
New-Item -ItemType Directory -Force -Path build/bin | Out-Null
|
|
go build -trimpath -tags desktop,production -ldflags "-H windowsgui" -o build/bin/reims-go.exe .
|
|
# Command-line mode must still answer through a pipe from the GUI-subsystem build.
|
|
$out = & build/bin/reims-go.exe version | Out-String
|
|
if ($LASTEXITCODE -ne 0 -or $out -notmatch '^reims-go ') { throw "reims-go.exe version failed: $out" }
|