feat(releaseupdate): install from release artifacts with journaled rollback, topology check and channels

This commit is contained in:
sam committed 2026-10-05 17:02:29 +11:00
1 parent 9bb20830f3
commit ee2c9cda97
24 files changed
+1186 -333

No files matched your search

+22 -7
View File
@@ -166,6 +166,8 @@ jobs:
fi
build-and-push:
outputs:
agent_digest: ${{ steps.agent.outputs.digest }}
needs: gate
runs-on: ubuntu-latest
steps:
@@ -258,6 +260,7 @@ jobs:
cache-to: type=gha,mode=max,scope=archied
- name: Build and push archie-agent
id: agent
if: steps.versions.outputs.runtime_tag != '' || steps.versions.outputs.release_tag != ''
uses: docker/build-push-action@v6
with:
@@ -282,7 +285,7 @@ jobs:
# the Docker image build-and-push already publishes, never as a host
# binary (archie-core-8cda.4.7.1).
dist-zip:
needs: gate
needs: [gate, build-and-push]
# Not gated on github.ref. A release is pushed as main plus both tags at
# one SHA, the concurrency group below collapses those into a single run,
# and the survivor is whichever ref happened to start last -- for
@@ -329,7 +332,7 @@ jobs:
# list and the copy list below stop matching the commands in cmd/.
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 }}"
mkdir -p dist
for cmd in archied archie-gateway archie-state-store archie-ui archie-messaging; do
for cmd in $(jq -r '.required_topology.units[]' release.json); do
go build -ldflags "$ldflags" -o "dist/$cmd" "./cmd/$cmd"
done
@@ -339,19 +342,28 @@ jobs:
set -e
name="archie-core-archied-v${{ steps.version.outputs.version }}-linux-amd64"
mkdir -p "$name"
cp dist/archied dist/archie-gateway dist/archie-state-store dist/archie-ui dist/archie-messaging "$name/"
for cmd in $(jq -r '.required_topology.units[]' release.json); do
cp "dist/$cmd" "$name/"
done
cp deployments/INSTRUCTIONS.md CHANGELOG.md "$name/"
cp scripts/archie-update-* "$name/"
digest='${{ needs.build-and-push.outputs.agent_digest }}'
test -n "$digest"
jq --arg image "ghcr.io/samcharles93/archie-agent@$digest" '. + {agent_image: $image}' release.json > "$name/release.json"
# README.md doesn't exist yet in this repo; include it once it does
# rather than fail the release on its absence.
[ -f README.md ] && cp README.md "$name/"
zip -r "$name.zip" "$name"
sha256sum "$name.zip" > SHA256SUMS
echo "name=$name" >> "$GITHUB_OUTPUT"
- name: Upload distribution zip
uses: actions/upload-artifact@v4
with:
name: ${{ steps.zip.outputs.name }}
path: ${{ steps.zip.outputs.name }}.zip
path: |
${{ steps.zip.outputs.name }}.zip
SHA256SUMS
retention-days: 90
# A Release is what an operator can actually download from; the
@@ -370,7 +382,10 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
tag="archied/v${{ steps.version.outputs.version }}"
tag="v${{ steps.version.outputs.version }}"
if ! git ls-remote --exit-code --tags origin "refs/tags/$tag" >/dev/null; then
tag="archied/v${{ steps.version.outputs.version }}"
fi
version="${{ steps.version.outputs.version }}"
# The release body is this version's changelog section, not the whole
# file: from its "## [x.y.z]" heading to the next "## [" heading.
@@ -391,11 +406,11 @@ jobs:
# alone, so a re-run of this job (a retried or superseded deploy)
# cannot fail on an existing Release or duplicate the zip.
if gh release view "$tag" >/dev/null 2>&1; then
gh release upload "$tag" "${{ steps.zip.outputs.name }}.zip" --clobber
gh release upload "$tag" "${{ steps.zip.outputs.name }}.zip" SHA256SUMS --clobber
else
gh release create "$tag" \
--title "archied v$version" \
--notes-file "$notes" \
"${{ steps.zip.outputs.name }}.zip"
"${{ steps.zip.outputs.name }}.zip" SHA256SUMS
fi
echo "published $tag with ${{ steps.zip.outputs.name }}.zip"