Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,25 +1,22 @@
|
||||
# Cross-platform Crucible binaries (D7 trigger standard):
|
||||
# PR / push main -> cross-build ALL targets to prove they compile (no publish)
|
||||
# tag v* -> build all targets + SHA256SUMS, upload to the Gitea release
|
||||
# Cross-platform Crucible release binaries: a v* tag builds all targets,
|
||||
# then uploads them, SHA256SUMS, and the canonical wrappers to its Gitea release.
|
||||
# Crucible is pure Go (CGO_ENABLED=0), so cross-compiling is a fast loop.
|
||||
name: build-binaries
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main]
|
||||
tags: ['v*']
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
- "README.md"
|
||||
- "AGENTS.md"
|
||||
- "LICENSE"
|
||||
|
||||
permissions:
|
||||
code: read
|
||||
releases: write
|
||||
|
||||
jobs:
|
||||
build-binaries:
|
||||
runs-on: nix-docker
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with: { fetch-depth: 0 }
|
||||
|
||||
- name: Cross-build all targets
|
||||
@@ -45,9 +42,8 @@ jobs:
|
||||
'
|
||||
|
||||
- name: Upload to Gitea release
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
TAG: ${{ github.ref_name }}
|
||||
REPO: ${{ github.repository }}
|
||||
SERVER: ${{ github.server_url }}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
# Pull-request validation for Crucible. Releases and wrapper synchronization
|
||||
# have their own narrow workflows because they need tag/main events.
|
||||
name: ci
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: nix-docker
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: vet + test + lint
|
||||
run: |
|
||||
nix develop --command bash -c '
|
||||
set -euo pipefail
|
||||
go vet ./...
|
||||
go test ./...
|
||||
shellcheck scripts/*.sh
|
||||
yamllint .gitea
|
||||
'
|
||||
|
||||
- name: binary smoke (fail-closed contract)
|
||||
run: nix develop --command make smoke
|
||||
|
||||
- name: Cross-build all targets
|
||||
run: |
|
||||
nix develop --command bash -c '
|
||||
set -euo pipefail
|
||||
sha="$(git rev-parse --short=12 HEAD)"
|
||||
ldflags="-s -w -X git.westgate.pw/ShadowsOverWestgate/sow-tools/internal/buildinfo.Version=${sha}"
|
||||
rm -rf dist && mkdir -p dist
|
||||
export CGO_ENABLED=0
|
||||
for target in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64 windows/arm64; do
|
||||
os="${target%/*}"; arch="${target#*/}"
|
||||
ext=""; [ "$os" = windows ] && ext=".exe"
|
||||
echo "building crucible-${os}-${arch}${ext}"
|
||||
GOOS="$os" GOARCH="$arch" go build -trimpath -ldflags "$ldflags" \
|
||||
-o "dist/crucible-${os}-${arch}${ext}" ./cmd/crucible
|
||||
done
|
||||
'
|
||||
@@ -14,11 +14,14 @@ on:
|
||||
- 'wrappers/crucible.sh'
|
||||
- 'wrappers/crucible.ps1'
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: nix-docker
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Open sync PRs to consumers
|
||||
env:
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
# Lint + unit tests for the Crucible suite. PR-first: PRs + push to main (D7).
|
||||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
- "README.md"
|
||||
- "AGENTS.md"
|
||||
- "LICENSE"
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: nix-docker
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with: { fetch-depth: 0 }
|
||||
- name: vet + test + lint
|
||||
run: |
|
||||
nix develop --command bash -c '
|
||||
set -euo pipefail
|
||||
go vet ./...
|
||||
go test ./...
|
||||
shellcheck scripts/*.sh
|
||||
yamllint .gitea
|
||||
'
|
||||
- name: binary smoke (fail-closed contract)
|
||||
run: nix develop --command make smoke
|
||||
Reference in New Issue
Block a user