VERSION holds MAJOR.MINOR (1.1), edited by hand. Every push to main is tagged vMAJOR.MINOR.PATCH by the "Tag release" workflow, with PATCH counted as an integer by scripts/next-version.sh. "Promote release" moves the major tag (v1) to a tested release and refuses to move it backwards. drb-update.sh: a newer release on the node's channel is now a reason to update by itself. REF=latest follows the highest vX.Y.Z tag (test nodes); REF=v1 follows the promoted tag (customer nodes). Versions compare per field as integers (1.10.0 > 1.9.3, never string or float order). It never downgrades, and an untagged target still needs a request. After an update it writes DRB_VERSION to .env; the edge node reports it in checkin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
1.6 KiB
YAML
40 lines
1.6 KiB
YAML
name: Promote release
|
|
|
|
# node-26#49: move the major tag (v1) to a tested release. Customer nodes
|
|
# (updater REF=v1) install it on their next timer run, because its version is
|
|
# numerically higher than what they run. Never moves it backwards.
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: "Release to promote, e.g. 1.1.3 (must already be tagged v1.1.3)"
|
|
required: true
|
|
|
|
jobs:
|
|
promote:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Move the major tag
|
|
env:
|
|
VERSION: ${{ inputs.version }}
|
|
run: |
|
|
[[ "$VERSION" =~ ^([0-9]+)\.[0-9]+\.[0-9]+$ ]] || { echo "version must be MAJOR.MINOR.PATCH, got '$VERSION'"; exit 1; }
|
|
MAJOR="${BASH_REMATCH[1]}"
|
|
git fetch --force --tags origin
|
|
git rev-parse -q --verify "refs/tags/v$VERSION" >/dev/null || { echo "tag v$VERSION does not exist"; exit 1; }
|
|
# Refuse to go backwards: compare with the release v$MAJOR points at now.
|
|
CUR="$(git tag --points-at "v$MAJOR" 2>/dev/null | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' \
|
|
| sed 's/^v//' | sort -t. -k1,1n -k2,2n -k3,3n | tail -1 || true)"
|
|
if [ -n "$CUR" ]; then
|
|
HIGHEST="$(printf '%s\n%s\n' "$CUR" "$VERSION" | sort -t. -k1,1n -k2,2n -k3,3n | tail -1)"
|
|
[ "$HIGHEST" = "$VERSION" ] || { echo "v$MAJOR is at $CUR, newer than $VERSION — refusing to roll back here"; exit 1; }
|
|
fi
|
|
git tag -f "v$MAJOR" "v$VERSION^{commit}"
|
|
git push --force origin "refs/tags/v$MAJOR"
|
|
echo "v$MAJOR -> $VERSION (was ${CUR:-untagged})"
|