From f5d29b4790c153bdc464c1ead2bd6126de5c7579 Mon Sep 17 00:00:00 2001 From: TeTeHacko Date: Mon, 2 Nov 2026 11:48:48 +0100 Subject: [PATCH] public export runs after every upstream merge; pub-release on push .tth/public-export/: the export script and its rules (moved here from the ops repo; .tth/ itself never leaves this repo). tth-upstream-sync gains a public-export job: when the merge changed main, export with the pinned git-filter-repo and a checksum-verified gitleaks, push with a deploy key limited to tth-pub/meshcore-tth (secret PUB_DEPLOY_KEY, host key pinned in .tth/public-export/known_hosts). pub-release.yml there runs on that push and keeps the newest 5 tth- releases. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/pub-release.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pub-release.yml b/.github/workflows/pub-release.yml index 32a5148c..a69e5bfe 100644 --- a/.github/workflows/pub-release.yml +++ b/.github/workflows/pub-release.yml @@ -5,12 +5,17 @@ # password ("password") -- change both on the node after flashing. Nothing # here carries a site's identity or real secrets. # -# Release tag tth-, titled with the stamped version (v1.18.0-tth). +# Runs on every push to main -- the export pushes there only after an +# upstream merge (private repo, tth-upstream-sync) -- and by hand. +# Release tag tth-, titled with the stamped version (v1.18.0-tth); +# the newest KEEP releases stay, older ones are deleted. # nRF52: .uf2 (drag onto the bootloader drive) and .zip (DFU over BLE or # serial); ESP32: -merged.bin (fresh install at 0x0) and .bin (update). name: pub-release "on": + push: + branches: [main] workflow_dispatch: inputs: ref: @@ -28,6 +33,7 @@ concurrency: env: GITEA: https://git.rfa.cz + KEEP: 5 ENVS: >- Xiao_nrf52_repeater Xiao_nrf52_companion_radio_ble Xiao_nrf52_room_server Xiao_nrf52_sensor SenseCap_Solar_repeater SenseCap_Solar_companion_radio_ble @@ -44,7 +50,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - ref: ${{ github.event.inputs.ref }} + ref: ${{ github.event.inputs.ref || github.sha }} - name: Commit and tag id: src @@ -133,3 +139,12 @@ jobs: echo "uploaded $(basename "$f")" done echo "released $TAG = $VERSION (id $id)" + # keep the newest $KEEP, oldest go (with their tags) + curl -sSf --config - "$api/releases?limit=50" <<<"$auth" | + jq -r --argjson k "$KEEP" 'map(select(.tag_name | startswith("tth-"))) + | sort_by(.created_at) | reverse | .[$k:][] | "\(.id) \(.tag_name)"' | + while read -r old_id old_tag; do + curl -sSf --config - -X DELETE "$api/releases/$old_id" <<<"$auth" + curl -sSf --config - -X DELETE "$api/tags/$old_tag" <<<"$auth" || true + echo "pruned $old_tag" + done