Phase 5: scaffold Crucible (sow-tools) — dispatcher + builder shims, container, PR-first CI, fail-closed (D11, D19).
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
# Build the Crucible image. PR-first (D7): PRs build only; push to main also
|
||||
# publishes registry.westgate.pw/sow/crucible:<git-sha>. Never a mutable tag.
|
||||
name: build-image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
REGISTRY: registry.westgate.pw
|
||||
IMAGE: sow/crucible
|
||||
|
||||
jobs:
|
||||
build-image:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with: { fetch-depth: 0 }
|
||||
|
||||
- name: Resolve tag
|
||||
id: tag
|
||||
run: echo "sha=$(git rev-parse --short=12 HEAD)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Build image
|
||||
run: |
|
||||
docker build \
|
||||
--build-arg GIT_SHA=${{ steps.tag.outputs.sha }} \
|
||||
-f docker/Dockerfile \
|
||||
-t ${REGISTRY}/${IMAGE}:${{ steps.tag.outputs.sha }} .
|
||||
|
||||
# Publish only on main (post-merge). PRs verify the build but never push.
|
||||
- name: Publish image
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
env:
|
||||
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
run: |
|
||||
echo "${REGISTRY_PASSWORD}" | docker login "${REGISTRY}" -u "${REGISTRY_USER}" --password-stdin
|
||||
docker push ${REGISTRY}/${IMAGE}:${{ steps.tag.outputs.sha }}
|
||||
@@ -0,0 +1,40 @@
|
||||
# Tag a Crucible release: re-tag the already-built immutable image and attach
|
||||
# per-platform binary bundles. Tag-gated; never PR-triggered (deploy/release is
|
||||
# not a PR concern, D7). The :<sha> image from build-image is the source of truth.
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
env:
|
||||
REGISTRY: registry.westgate.pw
|
||||
IMAGE: sow/crucible
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: nixos/nix:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with: { fetch-depth: 0 }
|
||||
|
||||
- name: Build release binaries
|
||||
run: |
|
||||
nix develop --command bash -c '
|
||||
set -euo pipefail
|
||||
GOOS=linux GOARCH=amd64 scripts/build-binaries.sh
|
||||
mkdir -p dist
|
||||
tar -C bin -czf "dist/crucible-linux-amd64-${GITHUB_REF_NAME}.tar.gz" .
|
||||
'
|
||||
|
||||
- name: Upload release artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: crucible-${{ github.ref_name }}
|
||||
path: dist/*
|
||||
|
||||
# TODO(phase-6): re-tag registry.westgate.pw/sow/crucible:<sha> as :<tag>
|
||||
# and pin it from sow-platform releases/*.yml once the registry is live.
|
||||
@@ -0,0 +1,27 @@
|
||||
# Lint + unit tests for the Crucible suite. PR-first: PRs + push to main (D7).
|
||||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: nixos/nix:latest
|
||||
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