Skip to content

Codex/hardened build 20260828 #19

Codex/hardened build 20260828

Codex/hardened build 20260828 #19

Workflow file for this run

name: Hardened build verification
on:
workflow_dispatch:
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.27.0"
check-latest: false
- name: Test
run: go test ./...
- name: Vulnerability scan
run: |
go install golang.org/x/vuln/cmd/govulncheck@v1.7.0
govulncheck ./...
- name: Build packages
shell: bash
run: |
set -euo pipefail
version="hardened-${GITHUB_SHA::12}"
commit="${GITHUB_SHA}+hardened"
build_time="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
ldflags="-s -w -buildid= -X RealityChecker/internal/version.Version=${version} -X RealityChecker/internal/version.Commit=${commit} -X RealityChecker/internal/version.BuildTime=${build_time}"
mkdir -p dist staging
build_package() {
local goos="$1"
local goarch="$2"
local suffix="$3"
local dir="staging/${goos}-${goarch}"
mkdir -p "${dir}/data"
cp data/cdn_keywords.txt data/Country.mmdb data/gfwlist.conf data/hot_websites.txt "${dir}/data/"
cp SECURITY-HARDENING.md "${dir}/"
CGO_ENABLED=0 GOOS="${goos}" GOARCH="${goarch}" \
go build -trimpath -buildvcs=false -tags netgo -ldflags "${ldflags}" -o "${dir}/reality-checker${suffix}" .
(cd "${dir}" && zip -qr "../../dist/RealityChecker-hardened-${goos}-${goarch}.zip" .)
}
build_package windows amd64 .exe
build_package linux amd64 ""
build_package linux arm64 ""
(cd dist && sha256sum *.zip > SHA256SUMS.txt)
- name: Upload verification artifacts
uses: actions/upload-artifact@v4
with:
name: RealityChecker-hardened
path: dist/*