Skip to content

Prompt client auth only when required #35

Prompt client auth only when required

Prompt client auth only when required #35

Workflow file for this run

name: CI
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Go Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: false
- name: Run tests
run: go test ./...
- name: Run go vet
run: go vet ./...
- name: Check gofmt
run: |
unformatted="$(gofmt -l $(git ls-files '*.go'))"
if [ -n "$unformatted" ]; then
echo "gofmt violations:"
echo "$unformatted"
exit 1
fi
- name: Validate all configs
run: go run ./cmd/road validate --all-configs
- name: Validate compatibility profiles
run: go test ./internal/repoqa -run TestRepositoryCompatProfilesLoad -count=1
build-linux:
name: Linux Build Smoke
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: false
- name: Build linux amd64
run: bash ./scripts/build-linux.sh amd64
- name: Smoke linux amd64 binary
run: ./build/linux/amd64/road-proxy --version
- name: Check linux package plugin filter
run: test ! -d ./build/linux/amd64/plugins/udp-sync-stress
- name: Check linux package internal file filter
run: |
test ! -f ./build/linux/amd64/plugins/gzdoom-udp/studio-report.json
test ! -f ./build/linux/amd64/docs/PROJECT-TODO.md
test ! -f ./build/linux/amd64/docs/PLUGIN-STUDIO-CAPTURE-REPLAY-DRAFT.md
- name: Build linux arm64
run: bash ./scripts/build-linux.sh arm64
build-windows:
name: Windows Build Smoke
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: false
- name: Build windows amd64
shell: pwsh
run: ./scripts/build-windows.ps1
- name: Smoke windows amd64 binary
shell: pwsh
run: ./build/windows/road-proxy.exe --version
- name: Check windows package plugin filter
shell: pwsh
run: |
if (Test-Path -LiteralPath "./build/windows/plugins/udp-sync-stress") {
throw "source-only plugin leaked into windows build output"
}
if (Test-Path -LiteralPath "./build/windows/plugins/gzdoom-udp/studio-report.json") {
throw "studio report leaked into windows build output"
}
if (Test-Path -LiteralPath "./build/windows/docs/PROJECT-TODO.md") {
throw "internal project TODO leaked into windows build output"
}
if (Test-Path -LiteralPath "./build/windows/docs/PLUGIN-STUDIO-CAPTURE-REPLAY-DRAFT.md") {
throw "draft doc leaked into windows build output"
}
- name: Build windows arm64
shell: pwsh
run: ./scripts/build-windows.ps1 -Arch arm64
release-package:
name: Tag Release Package
runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
needs:
- test
- build-linux
- build-windows
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: false
- name: Build release packages
shell: pwsh
run: |
$env:ROAD_VERSION = "${{ github.ref_name }}"
$env:ROAD_COMMIT = "${{ github.sha }}"
./scripts/build-cross.ps1 -Package -IncludeWindowsArm64
- name: Upload release packages
uses: actions/upload-artifact@v7
with:
name: road-proxy-v3-${{ github.ref_name }}
path: |
build/release/*.zip
build/release/*.sha256
- name: Publish GitHub Release
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: |
$tag = "${{ github.ref_name }}"
$assets = Get-ChildItem -LiteralPath "build/release" -File |
Where-Object { $_.Name -like "*.zip" -or $_.Name -like "*.sha256" } |
Sort-Object Name |
ForEach-Object { $_.FullName }
if (-not $assets -or $assets.Count -eq 0) {
throw "no release assets found under build/release"
}
gh release view $tag --repo $env:GITHUB_REPOSITORY *> $null
if ($LASTEXITCODE -eq 0) {
gh release upload $tag @assets --repo $env:GITHUB_REPOSITORY --clobber
} else {
gh release create $tag @assets --repo $env:GITHUB_REPOSITORY --title "ROAD Proxy v3 $tag" --generate-notes
}