Skip to content

Fix nginx error 32 race condition on restart #11

Fix nginx error 32 race condition on restart

Fix nginx error 32 race condition on restart #11

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
id-token: write
attestations: write
jobs:
release:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', 'global.json') }}
restore-keys: |
nuget-${{ runner.os }}-
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Validate tag matches project version
id: version
shell: pwsh
run: |
$tag = $env:GITHUB_REF_NAME
if ($tag -notmatch '^v(?<version>.+)$') {
throw "Expected tag like v0.2.1, got: $tag"
}
$expected = $Matches.version
$project = [xml](Get-Content src/Stackroot.App/Stackroot.App.csproj -Raw)
$version = $project.Project.PropertyGroup.Version |
Where-Object { -not [string]::IsNullOrWhiteSpace($_) } |
Select-Object -First 1
if ([string]::IsNullOrWhiteSpace($version)) {
throw 'Version missing in Stackroot.App.csproj'
}
if ($version -ne $expected) {
throw "Tag version '$expected' does not match Stackroot.App.csproj version '$version'"
}
"version=$version" >> $env:GITHUB_OUTPUT
- name: Build pinned launcher
shell: pwsh
run: ./scripts/build-pinned-launcher.ps1
- name: Cache installer prerequisites
uses: actions/cache@v4
with:
path: installer/prerequisites
key: prerequisites-${{ hashFiles('installer/dotnet-prereq.ps1', 'installer/vc-redist-prereq.ps1') }}
- name: Cache PIE phar
uses: actions/cache@v4
with:
path: resources/packages/pie.phar
key: pie-phar-${{ hashFiles('scripts/ensure-pie.ps1') }}
- name: Install NSIS
shell: pwsh
run: |
$candidates = @(
$env:NSIS_PATH,
"${env:ProgramFiles(x86)}\NSIS\makensis.exe",
"$env:ProgramFiles\NSIS\makensis.exe"
)
foreach ($path in $candidates) {
if (-not [string]::IsNullOrWhiteSpace($path) -and (Test-Path $path)) {
Write-Host "NSIS already available: $path"
"NSIS_PATH=$path" >> $env:GITHUB_ENV
exit 0
}
}
Write-Host "Installing NSIS via Chocolatey..."
choco install nsis --no-progress -y
if ($LASTEXITCODE -ne 0) { throw "choco install nsis failed ($LASTEXITCODE)" }
foreach ($path in $candidates[1..2]) {
if (Test-Path $path) {
Write-Host "NSIS installed: $path"
"NSIS_PATH=$path" >> $env:GITHUB_ENV
exit 0
}
}
throw "NSIS (makensis) not found after install"
- name: Pack installer
shell: pwsh
run: ./scripts/pack-release.ps1
- name: Generate artifact attestation
uses: actions/attest@v4
with:
subject-path: release/Stackroot-Setup-${{ steps.version.outputs.version }}.exe
- name: Publish GitHub release
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: ./scripts/publish-github-release.ps1