ci: ship the binaries the gate built, and stop rebuilding archied

The release gate stamps the version into `task build`, and the
distribution step packages those binaries instead of compiling the tree
a second time with different flags. `task build` is static to match.

The image builds keep Go's compile cache between runs. canary and
promote take archied from the published edge image. The Woodpecker gate
and pull-request check keep Go's caches on the host.

Also: one Node version, the distribution waits for the archied image,
release notes wait for the signed release and carry the prerelease flag.
This commit is contained in:
sam committed 2026-11-10 10:37:03 +00:00
1 parent c3e64e5485
commit b137942b35
11 files changed
+152 -103

No files matched your search

+11 -15
View File
@@ -17,24 +17,20 @@ jobs:
if: vars.CANARY_URL != ''
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- name: Build archied
run: go build -tags no_ui -o "$RUNNER_TEMP/archied" ./cmd/archied
- name: Log in to the Gitea registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
# The judge is the archied that deploy published for main, not a build
# of its own.
- name: Fetch archied from the edge image
run: |
set -e
image=git.catlow.cloud/sam/archied:edge
docker pull -q "$image"
container="$(docker create "$image")"
trap 'docker rm "$container" >/dev/null' EXIT
docker cp "$container:/usr/local/bin/archied" "$RUNNER_TEMP/archied"
- name: Judge the canary
env:
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}
+43 -40
View File
@@ -70,7 +70,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "22"
node-version: "24"
- name: Install quality tools
run: |
@@ -93,9 +93,17 @@ jobs:
- name: Pull test container images
run: docker pull alpine:3
# A release stamps its version here: dist-zip ships these binaries, so
# the release is what the gate tested.
- name: Quality gate
env:
RELEASE_VERSION: ${{ needs.plan.outputs.archied_version }}
run: |
task check TEST_FLAGS=-count=1
if [ -n "$RELEASE_VERSION" ]; then
task check TEST_FLAGS=-count=1 GATEWAY_VERSION="$RELEASE_VERSION" RUNTIME_VERSION="$RELEASE_VERSION"
else
task check TEST_FLAGS=-count=1
fi
git diff --exit-code
- name: Vulnerability scan
@@ -129,6 +137,15 @@ jobs:
echo "This commit isn't a release, so the images are published as :edge and sha-<sha>; :latest keeps naming the newest promoted release."
fi
- name: Upload the release binaries
if: needs.plan.outputs.archied_version != ''
uses: actions/upload-artifact@v4
with:
name: release-binaries
path: bin/
if-no-files-found: error
retention-days: 1
archied-image:
needs: gate
runs-on: self-hosted
@@ -147,6 +164,11 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
# A named builder that keeps its state, so the Dockerfile's compile
# cache is still there on the next run.
name: archie-archied
keep-state: true
- name: Log in to the Gitea registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
@@ -188,7 +210,8 @@ jobs:
agent-image:
outputs:
agent_digest: ${{ steps.agent.outputs.digest }}
needs: gate
needs: [plan, gate]
if: needs.plan.outputs.archied_version != ''
runs-on: self-hosted
steps:
- name: Checkout
@@ -205,6 +228,9 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
name: archie-agent
keep-state: true
- name: Log in to the Gitea registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
@@ -234,51 +260,23 @@ jobs:
cache-to: type=gha,mode=max,scope=archie-agent
dist-zip:
needs: [plan, gate, agent-image]
needs: [plan, gate, archied-image, agent-image]
if: needs.plan.outputs.archied_version != ''
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
- name: Download the binaries the gate built
uses: actions/download-artifact@v4
with:
go-version-file: go.mod
cache: false
- uses: pnpm/action-setup@v4
with:
package_json_file: ui/package.json
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "24"
- name: Build the dashboard
working-directory: ui
run: |
pnpm install --frozen-lockfile
pnpm run build
name: release-binaries
path: bin
- name: Resolve archied version
id: version
run: echo "version=${{ needs.plan.outputs.archied_version }}" >> "$GITHUB_OUTPUT"
- name: Build linux/amd64 binaries
env:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: "0"
run: |
set -e
ldflags="-X github.com/samcharles93/archie-core/internal/installtype.buildType=binary -X github.com/samcharles93/archie-core/internal/buildinfo.Version=${{ steps.version.outputs.version }} -X github.com/samcharles93/archie-core/internal/buildinfo.Runtime=${{ steps.version.outputs.version }} -X github.com/samcharles93/archie-core/internal/app/agentworker.version=${{ steps.version.outputs.version }}"
mkdir -p dist
for cmd in $(jq -r '.required_topology.units[], .required_topology.binaries[]?' release.json); do
go build -ldflags "$ldflags" -o "dist/$cmd" "./cmd/$cmd"
done
- name: Assemble distribution zip
id: zip
run: |
@@ -286,8 +284,10 @@ jobs:
name="archie-core-archied-v${{ steps.version.outputs.version }}-linux-amd64"
mkdir -p "$name"
for cmd in $(jq -r '.required_topology.units[], .required_topology.binaries[]?' release.json); do
cp "dist/$cmd" "$name/"
# An artifact does not keep the executable bit.
install -m 0755 "bin/$cmd" "$name/$cmd"
done
chmod +x bin/archied
cp deployments/INSTRUCTIONS.md CHANGELOG.md "$name/"
digest='${{ needs.agent-image.outputs.agent_digest }}'
test -n "$digest"
@@ -314,7 +314,7 @@ jobs:
version="${{ steps.version.outputs.version }}"
prerelease=false
case "$version" in *-*) prerelease=true ;; esac
./dist/archied release publish -source git.catlow.cloud/sam/archie \
./bin/archied release publish -source git.catlow.cloud/sam/archie \
-version "$version" -prerelease="$prerelease" \
-zip "${{ steps.zip.outputs.name }}.zip" \
-agent-image "git.catlow.cloud/sam/archie-agent@${{ needs.agent-image.outputs.agent_digest }}" \
@@ -327,6 +327,8 @@ jobs:
set -e
tag="v${{ steps.version.outputs.version }}"
version="${{ steps.version.outputs.version }}"
prerelease=false
case "$version" in *-*) prerelease=true ;; esac
notes="$(mktemp)"
awk -v hdr="## [$version]" '
index($0, hdr) == 1 { printing = 1 }
@@ -343,7 +345,8 @@ jobs:
curl -sf -X DELETE -H "$auth" "$api/repos/$repo/releases/tags/$tag" >/dev/null || true
curl -sf -X POST -H "$auth" -H "Content-Type: application/json" \
-d "$(jq -n --arg tag "$tag" --arg name "Archie v$version" --arg body "$(cat "$notes")" \
'{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}')" \
--argjson prerelease "$prerelease" \
'{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: $prerelease}')" \
"$api/repos/$repo/releases" >/dev/null
echo "published release notes for $tag"
@@ -351,7 +354,7 @@ jobs:
if: vars.CANARY_URL != ''
env:
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}
run: ./dist/archied release canary start -dashboard "${{ vars.CANARY_URL }}" -version "${{ steps.version.outputs.version }}"
run: ./bin/archied release canary start -dashboard "${{ vars.CANARY_URL }}" -version "${{ steps.version.outputs.version }}"
- name: Link the packages to this repository
env:
+10 -14
View File
@@ -21,23 +21,19 @@ jobs:
if: vars.CANARY_URL != ''
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- name: Build archied
run: go build -tags no_ui -o "$RUNNER_TEMP/archied" ./cmd/archied
- name: Log in to the Gitea registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
# The archied that deploy published for main, not a build of its own.
- name: Fetch archied from the edge image
run: |
set -e
image=git.catlow.cloud/sam/archied:edge
docker pull -q "$image"
container="$(docker create "$image")"
trap 'docker rm "$container" >/dev/null' EXIT
docker cp "$container:/usr/local/bin/archied" "$RUNNER_TEMP/archied"
- name: Promote the canary's release
env:
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}