The gate derived the version with ${tag#archied/}, which leaves "v1.7.0",
then looked for a "## [v1.7.0]" heading. Changelog sections carry no v --
tools/release.sh writes and validates "## [1.7.0]" -- so the gate could
never match and every tagged release failed before the images were built.
This is the gate's first tagged run: it landed in dd9bddc, after the
archied/v1.6.0 tag, so nothing had exercised this branch until v1.7.0.
125 lines
4.3 KiB
YAML
125 lines
4.3 KiB
YAML
# Builds and pushes the archied and archie-agent images to GHCR on every
|
|
# merge to main. Mirrors .gitea/workflows/deploy.yml, which remains the
|
|
# production build path against git.catlow.cloud until that's cut over.
|
|
name: deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["archied/v*", "archie/v*"]
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
jobs:
|
|
gate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.26"
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
|
|
- name: Install gofumpt
|
|
run: go install mvdan.cc/gofumpt@latest
|
|
|
|
- name: Install ripgrep
|
|
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends ripgrep
|
|
|
|
- name: Quality gate
|
|
run: |
|
|
gofumpt -w .
|
|
go fix ./...
|
|
go vet ./...
|
|
go build ./...
|
|
go test ./... -count=1
|
|
|
|
# The dashboard suite runs in CI too, or it only ever runs when
|
|
# someone remembers to; the Go steps above never touch it.
|
|
- name: Dashboard tests
|
|
run: |
|
|
npm ci --prefix ui || npm install --prefix ui
|
|
npm test --prefix ui
|
|
|
|
- name: Release tags must match changelogs
|
|
run: |
|
|
set -e
|
|
fail=0
|
|
for tag in $(git tag --points-at HEAD); do
|
|
case "$tag" in
|
|
archied/v*)
|
|
# Strip the "v" too: tags are archied/vX.Y.Z, changelog
|
|
# sections are "## [X.Y.Z]" (see tools/release.sh).
|
|
ver="${tag#archied/v}"
|
|
echo " archied tag $tag -> looking for [$ver] in CHANGELOG.archied.md"
|
|
grep -q "^## \\[$ver\\]" CHANGELOG.archied.md || {
|
|
echo " FAIL: CHANGELOG.archied.md has no [$ver] section"
|
|
fail=1
|
|
}
|
|
;;
|
|
archie/v*)
|
|
ver="${tag#archie/v}"
|
|
echo " archie tag $tag -> looking for [$ver] in CHANGELOG.archie.md"
|
|
grep -q "^## \\[$ver\\]" CHANGELOG.archie.md || {
|
|
echo " FAIL: CHANGELOG.archie.md has no [$ver] section"
|
|
fail=1
|
|
}
|
|
;;
|
|
esac
|
|
done
|
|
if [ $fail -ne 0 ]; then
|
|
echo
|
|
echo "A release tag points at this commit but its changelog does not"
|
|
echo "describe that version. Run: task release:prepare VERSION=<ver>"
|
|
echo "edit the generated notes, then: task release VERSION=<ver>"
|
|
exit 1
|
|
fi
|
|
if ! git tag --points-at HEAD | grep -qE 'archie' ; then
|
|
echo "::warning ::No release tags at HEAD -- images will be stamped 'dev'"
|
|
fi
|
|
|
|
build-and-push:
|
|
needs: gate
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Log in to GHCR
|
|
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
|
|
|
|
- name: Build and push archied
|
|
run: |
|
|
GATEWAY_TAG="$(git tag --points-at HEAD --list 'archied/v*' | sort -V | tail -1)"
|
|
RUNTIME_TAG="$(git tag --points-at HEAD --list 'archie/v*' | sort -V | tail -1)"
|
|
GATEWAY_VERSION="${GATEWAY_TAG#archied/}"
|
|
RUNTIME_VERSION="${RUNTIME_TAG#archie/}"
|
|
[ -n "$GATEWAY_VERSION" ] || GATEWAY_VERSION=dev
|
|
[ -n "$RUNTIME_VERSION" ] || RUNTIME_VERSION=dev
|
|
docker build \
|
|
--build-arg GATEWAY_VERSION="$GATEWAY_VERSION" \
|
|
--build-arg RUNTIME_VERSION="$RUNTIME_VERSION" \
|
|
-f Dockerfile.archied -t ghcr.io/samcharles93/archied:latest .
|
|
docker push ghcr.io/samcharles93/archied:latest
|
|
|
|
- name: Build and push archie-agent
|
|
run: |
|
|
RUNTIME_TAG="$(git tag --points-at HEAD --list 'archie/v*' | sort -V | tail -1)"
|
|
RUNTIME_VERSION="${RUNTIME_TAG#archie/}"
|
|
[ -n "$RUNTIME_VERSION" ] || RUNTIME_VERSION=dev
|
|
docker build --build-arg RUNTIME_VERSION="$RUNTIME_VERSION" -f Dockerfile -t ghcr.io/samcharles93/archie-agent:latest .
|
|
docker push ghcr.io/samcharles93/archie-agent:latest
|