ci: rename rolling release tag dev -> dev-latest
Build (Dev) / build (push) Successful in 11s
CI / quality (push) Successful in 12s
CI / quality (pull_request) Failing after 0s

A release tag named "dev" collides with the dev branch, making refs
ambiguous ("refname 'dev' is ambiguous") and breaking git push/checkout.
Publish the rolling build to tag "dev-latest" instead; pi-update.sh pulls
from there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Joshua King
2026-06-05 11:48:15 -04:00
parent d2222d4947
commit c6d812cca2
2 changed files with 9 additions and 6 deletions
+8 -5
View File
@@ -9,6 +9,9 @@ import { createHash } from 'node:crypto';
const { TOKEN, SERVER, REPO, SHA } = process.env; const { TOKEN, SERVER, REPO, SHA } = process.env;
const BIN = 'remoterig'; const BIN = 'remoterig';
// Rolling release tag. NOT "dev" — that would collide with the dev branch
// and make refs ambiguous (git push/checkout dev breaks).
const TAG = 'dev-latest';
const VERSION = SHA.slice(0, 8); const VERSION = SHA.slice(0, 8);
const API = `${SERVER}/api/v1/repos/${REPO}`; const API = `${SERVER}/api/v1/repos/${REPO}`;
const H = { Authorization: `token ${TOKEN}` }; const H = { Authorization: `token ${TOKEN}` };
@@ -27,21 +30,21 @@ const files = {
'version.txt': Buffer.from(VERSION + '\n'), 'version.txt': Buffer.from(VERSION + '\n'),
}; };
// Roll the "dev" release forward to this commit: delete the old release + tag. // Roll the release forward to this commit: delete the old release + tag.
const existing = await fetch(`${API}/releases/tags/dev`, { headers: H }); const existing = await fetch(`${API}/releases/tags/${TAG}`, { headers: H });
if (existing.ok) { if (existing.ok) {
const rel = await existing.json(); const rel = await existing.json();
await fetch(`${API}/releases/${rel.id}`, { method: 'DELETE', headers: H }); await fetch(`${API}/releases/${rel.id}`, { method: 'DELETE', headers: H });
} }
await fetch(`${API}/tags/dev`, { method: 'DELETE', headers: H }); // ignore if absent await fetch(`${API}/tags/${TAG}`, { method: 'DELETE', headers: H }); // ignore if absent
const rel = await ok(await fetch(`${API}/releases`, { const rel = await ok(await fetch(`${API}/releases`, {
method: 'POST', method: 'POST',
headers: { ...H, 'Content-Type': 'application/json' }, headers: { ...H, 'Content-Type': 'application/json' },
body: JSON.stringify({ body: JSON.stringify({
tag_name: 'dev', tag_name: TAG,
target_commitish: SHA, target_commitish: SHA,
name: `dev (${VERSION})`, name: `${TAG} (${VERSION})`,
body: `Rolling dev build ${SHA}`, body: `Rolling dev build ${SHA}`,
prerelease: true, prerelease: true,
}), }),
+1 -1
View File
@@ -24,7 +24,7 @@ REPO="${REPO:-CubeCraft-Creations/remote-rig}"
DEPLOY_DIR="/opt/remoterig" DEPLOY_DIR="/opt/remoterig"
DEPLOY_PATH="${DEPLOY_PATH:-$DEPLOY_DIR/remoterig}" DEPLOY_PATH="${DEPLOY_PATH:-$DEPLOY_DIR/remoterig}"
SERVICE="${SERVICE:-remoterig}" SERVICE="${SERVICE:-remoterig}"
TAG="dev" TAG="dev-latest"
DL="$GITEA_BASE/$REPO/releases/download/$TAG" DL="$GITEA_BASE/$REPO/releases/download/$TAG"
VERSION_FILE="$DEPLOY_DIR/VERSION" VERSION_FILE="$DEPLOY_DIR/VERSION"