Export the reviewed application-neutral package set through the exact public allowlist. Development history and private application evidence remain outside this canonical source root. Developed with material AI assistance under maintainer review. Signed-off-by: Cole Speelman <crspeelman@gmail.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
$ErrorActionPreference = "Stop"
|
||||
$root = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
|
||||
Push-Location $root
|
||||
try {
|
||||
$failed = $false
|
||||
Get-ChildItem -Recurse -File | ForEach-Object {
|
||||
$relative = [IO.Path]::GetRelativePath($root, $_.FullName).Replace('\', '/')
|
||||
if ($relative.StartsWith('.git/') -or $relative.StartsWith('LICENSES/') -or $relative -eq 'go.sum') { return }
|
||||
if ($relative.StartsWith('starters/') -or $relative.StartsWith('examples/')) { $expected = '0BSD' }
|
||||
elseif ($relative.StartsWith('scripts/') -or $relative.StartsWith('.gitea/') -or $relative.StartsWith('services/')) { $expected = 'AGPL-3.0-only' }
|
||||
else { $expected = 'MPL-2.0' }
|
||||
$header = (Get-Content -LiteralPath $_.FullName -TotalCount 5) -join "`n"
|
||||
if (-not $header.Contains("SPDX-License-Identifier: $expected")) {
|
||||
Write-Error "license mismatch: $relative expected $expected"
|
||||
$failed = $true
|
||||
}
|
||||
}
|
||||
if ($failed) { throw "license boundary failed" }
|
||||
|
||||
$unformatted = & gofmt -l .
|
||||
if ($LASTEXITCODE -ne 0 -or $unformatted) { throw "gofmt check failed: $unformatted" }
|
||||
& go test ./...
|
||||
if ($LASTEXITCODE -ne 0) { throw "go test failed" }
|
||||
& go test -race ./...
|
||||
if ($LASTEXITCODE -ne 0) { throw "race test failed" }
|
||||
& go vet ./...
|
||||
if ($LASTEXITCODE -ne 0) { throw "go vet failed" }
|
||||
$build = Join-Path ([IO.Path]::GetTempPath()) ("gamertan-web-" + [guid]::NewGuid().ToString('N'))
|
||||
New-Item -ItemType Directory -Path $build | Out-Null
|
||||
try {
|
||||
& go build -trimpath -o (Join-Path $build 'basic.exe') ./starters/basic
|
||||
if ($LASTEXITCODE -ne 0) { throw "starter build failed" }
|
||||
} finally {
|
||||
Remove-Item -LiteralPath $build -Recurse -Force
|
||||
}
|
||||
& git diff --check
|
||||
if ($LASTEXITCODE -ne 0) { throw "git diff check failed" }
|
||||
} finally {
|
||||
Pop-Location
|
||||
}
|
||||
Reference in New Issue
Block a user