From ae4f1120d6d48ed618322ead6d6976a893fc231f Mon Sep 17 00:00:00 2001 From: Seth Van Niekerk Date: Sun, 14 Jun 2026 08:45:21 -0400 Subject: [PATCH 1/8] url changes --- .github/scripts/publish/generate-manifest.sh | 17 +++++++++++++---- .github/scripts/publish/plugin-readmes.sh | 4 ++-- .github/scripts/publish/releases-readme.sh | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/scripts/publish/generate-manifest.sh b/.github/scripts/publish/generate-manifest.sh index 01738fe..6d673c8 100644 --- a/.github/scripts/publish/generate-manifest.sh +++ b/.github/scripts/publish/generate-manifest.sh @@ -12,9 +12,17 @@ set -e generated_at="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" registry_url="https://github.com/${GITHUB_REPOSITORY}" registry_name="${GITHUB_REPOSITORY}" -root_url="https://github.com/${GITHUB_REPOSITORY}/releases/download" +download_base_url="https://github.com/${GITHUB_REPOSITORY}/releases/download" raw_releases_url="https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/${RELEASES_BRANCH}" +# Use GitHub Pages URL for metadata if configured; fall back to raw.githubusercontent.com +pages_url=$(gh api "repos/${GITHUB_REPOSITORY}/pages" --jq '.html_url // empty' 2>/dev/null || true) +if [[ -n "$pages_url" ]]; then + metadata_base_url="${pages_url%/}" +else + metadata_base_url="$raw_releases_url" +fi + # GPG signing setup - optional; set GPG_PRIVATE_KEY (armored) and optionally GPG_PASSPHRASE gpg_key_id="" gpg_signing_failed=0 @@ -276,8 +284,8 @@ for plugin_dir in plugins/*/; do desc_trimmed="$desc_raw" fi - # manifest_url is absolute: per-plugin manifest stays in the releases branch (raw.githubusercontent.com) - plugin_manifest_url="${raw_releases_url}/metadata/${plugin_name}/manifest.json" + # manifest_url is relative: clients compose with metadata_base_url from the root manifest + plugin_manifest_url="metadata/${plugin_name}/manifest.json" root_entry=$(jq -n \ --argjson latest_metadata "$latest_metadata" \ @@ -318,7 +326,8 @@ inner_root=$( echo '{' echo ' "registry_url": '"$(jq -n --arg u "$registry_url" '$u')"',' echo ' "registry_name": '"$(jq -n --arg u "$registry_name" '$u')"',' - echo ' "root_url": '"$(jq -n --arg u "$root_url" '$u')"',' + echo ' "download_base_url": '"$(jq -n --arg u "$download_base_url" '$u')"',' + echo ' "metadata_base_url": '"$(jq -n --arg u "$metadata_base_url" '$u')"',' echo ' "plugins": [' first=true for entry in "${root_entries[@]}"; do diff --git a/.github/scripts/publish/plugin-readmes.sh b/.github/scripts/publish/plugin-readmes.sh index b8dea2e..89eee96 100644 --- a/.github/scripts/publish/plugin-readmes.sh +++ b/.github/scripts/publish/plugin-readmes.sh @@ -24,8 +24,8 @@ shields_encode() { printf '%s' "$s" } -# Read root_url from the root manifest (set by generate-manifest.sh) -root_url=$(jq -r '.manifest.root_url // ""' "manifest.json" 2>/dev/null || echo "") +# Read download_base_url from the root manifest (set by generate-manifest.sh) +root_url=$(jq -r '.manifest.download_base_url // ""' "manifest.json" 2>/dev/null || echo "") for plugin_dir in plugins/*/; do [[ ! -d "$plugin_dir" ]] && continue diff --git a/.github/scripts/publish/releases-readme.sh b/.github/scripts/publish/releases-readme.sh index 0219324..d68cbfd 100644 --- a/.github/scripts/publish/releases-readme.sh +++ b/.github/scripts/publish/releases-readme.sh @@ -43,7 +43,7 @@ render_plugin() { local manifest_file="./metadata/${plugin_name}/manifest.json" local root_url - root_url=$(jq -r '.manifest.root_url // ""' "manifest.json" 2>/dev/null || echo "") + root_url=$(jq -r '.manifest.download_base_url // ""' "manifest.json" 2>/dev/null || echo "") local latest_url_path="" [[ -f "$manifest_file" ]] && latest_url_path=$(jq -r '.manifest.latest.latest_url // empty' "$manifest_file") local zip_url="" From b6bfbfd8fb1c4a0c6cb0f20dae03a0f4c0b4e9fa Mon Sep 17 00:00:00 2001 From: Seth Van Niekerk Date: Sun, 14 Jun 2026 08:47:58 -0400 Subject: [PATCH 2/8] icons migration --- .github/scripts/publish/generate-manifest.sh | 14 ++++++++ .github/scripts/publish/run.sh | 2 +- .github/workflows/run-migrations.yml | 35 ++++++++++++++++---- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/.github/scripts/publish/generate-manifest.sh b/.github/scripts/publish/generate-manifest.sh index 6d673c8..0799f90 100644 --- a/.github/scripts/publish/generate-manifest.sh +++ b/.github/scripts/publish/generate-manifest.sh @@ -142,6 +142,16 @@ for plugin_dir in plugins/*/; do existing_manifest_file="metadata/$plugin_name/manifest.json" mkdir -p "metadata/$plugin_name" + # Sync icon from source branch; prefer png > svg > jpg > webp + icon_rel="" + for ext in png svg jpg webp; do + if [[ -f "$plugin_dir/logo.$ext" ]]; then + cp "$plugin_dir/logo.$ext" "metadata/$plugin_name/logo.$ext" + icon_rel="metadata/${plugin_name}/logo.$ext" + break + fi + done + # Discover published versions from GitHub Releases (newest first) versioned_tags=$(echo "$all_release_tags" \ | grep "^${plugin_name}-" \ @@ -229,6 +239,7 @@ for plugin_dir in plugins/*/; do --arg latest_url "$latest_url" \ --arg registry_url "$registry_url" \ --arg registry_name "$registry_name" \ + --arg icon_rel "$icon_rel" \ --argjson versioned_zips "$versioned_zips" \ --argjson latest_metadata "$latest_metadata" \ --argjson latest_size_kb "$latest_size_kb" \ @@ -246,6 +257,7 @@ for plugin_dir in plugins/*/; do discord_thread: (.discord_thread // null), registry_url: $registry_url, registry_name: $registry_name, + icon: (if $icon_rel != "" then $icon_rel else null end), last_updated: ($latest_metadata.last_updated // null), latest: (if ($latest_metadata | length > 0) then { version: $latest_metadata.version, @@ -301,11 +313,13 @@ for plugin_dir in plugins/*/; do --arg min_da_version "$min_da_version" \ --arg max_da_version "$max_da_version" \ --arg latest_url "$latest_url" \ + --arg icon_rel "$icon_rel" \ '{ slug: $slug, name: $name, description: $description, manifest_url: $manifest_url, + icon: (if $icon_rel != "" then $icon_rel else null end), author: $author, license: (if $license != "" then $license else null end), deprecated: $deprecated, diff --git a/.github/scripts/publish/run.sh b/.github/scripts/publish/run.sh index b7d792f..a9847dc 100644 --- a/.github/scripts/publish/run.sh +++ b/.github/scripts/publish/run.sh @@ -20,7 +20,7 @@ fi RELEASES_BRANCH="releases" MAX_VERSIONED_ZIPS=10 -RELEASES_BRANCH_VERSION=3 +RELEASES_BRANCH_VERSION=4 SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" export SOURCE_BRANCH RELEASES_BRANCH MAX_VERSIONED_ZIPS diff --git a/.github/workflows/run-migrations.yml b/.github/workflows/run-migrations.yml index c062477..43492d2 100644 --- a/.github/workflows/run-migrations.yml +++ b/.github/workflows/run-migrations.yml @@ -3,6 +3,7 @@ name: Run Migrations # Migration history: # 001 (v0 → v2): Move ZIPs from releases branch git history to GitHub Release assets # 002 (v2 → v3): Rename zips/ to metadata/ on the releases branch +# 003 (v3 → v4): Publish plugin icons to metadata/ and add icon fields to manifests permissions: contents: write @@ -36,10 +37,11 @@ jobs: any_pending: ${{ steps.detect.outputs.any_pending }} needs_001: ${{ steps.detect.outputs.needs_001 }} needs_002: ${{ steps.detect.outputs.needs_002 }} + needs_003: ${{ steps.detect.outputs.needs_003 }} use_app: ${{ steps.config.outputs.use_app }} app_id: ${{ steps.config.outputs.app_id }} # Add outputs for future migrations here: - # needs_003: ${{ steps.detect.outputs.needs_003 }} + # needs_004: ${{ steps.detect.outputs.needs_004 }} steps: - name: Validate inputs run: | @@ -70,7 +72,7 @@ jobs: id: detect run: | RELEASES_BRANCH="releases" - TARGET_VER=3 # bump when adding a new migration + TARGET_VER=4 # bump when adding a new migration current_ver=0 if git ls-remote --exit-code --heads origin "$RELEASES_BRANCH" >/dev/null 2>&1; then @@ -84,9 +86,12 @@ jobs: (( current_ver < 3 )) && echo "needs_002=true" >> "$GITHUB_OUTPUT" \ || echo "needs_002=false" >> "$GITHUB_OUTPUT" + (( current_ver < 4 )) && echo "needs_003=true" >> "$GITHUB_OUTPUT" \ + || echo "needs_003=false" >> "$GITHUB_OUTPUT" + # Add future migrations here: - # (( current_ver < 4 )) && echo "needs_003=true" >> "$GITHUB_OUTPUT" \ - # || echo "needs_003=false" >> "$GITHUB_OUTPUT" + # (( current_ver < 5 )) && echo "needs_004=true" >> "$GITHUB_OUTPUT" \ + # || echo "needs_004=false" >> "$GITHUB_OUTPUT" (( current_ver < TARGET_VER )) && echo "any_pending=true" >> "$GITHUB_OUTPUT" \ || echo "any_pending=false" >> "$GITHUB_OUTPUT" @@ -372,6 +377,24 @@ jobs: echo "rebuild_type=regular" >> "$GITHUB_OUTPUT" echo "end_version=3" >> "$GITHUB_OUTPUT" + # --------------------------------------------------------------------------- + # Migration 003 (v3 → v4): Publish plugin icons to metadata/ on the releases branch. + # needs_rebuild=regular — next publish run copies logo.* and adds icon fields to manifests. + # --------------------------------------------------------------------------- + migration_003: + needs: [setup, migration_002] + if: needs.setup.outputs.needs_003 == 'true' + runs-on: ubuntu-latest + outputs: + rebuild_type: ${{ steps.flags.outputs.rebuild_type }} + end_version: ${{ steps.flags.outputs.end_version }} + steps: + - name: Set migration flags + id: flags + run: | + echo "rebuild_type=regular" >> "$GITHUB_OUTPUT" + echo "end_version=4" >> "$GITHUB_OUTPUT" + # --------------------------------------------------------------------------- # Add future migration jobs here following the same pattern. # --------------------------------------------------------------------------- @@ -381,7 +404,7 @@ jobs: # Skipped on dry runs or if no migrations were pending. # --------------------------------------------------------------------------- write_repo_ver: - needs: [setup, migration_001, migration_002] + needs: [setup, migration_001, migration_002, migration_003] if: | always() && needs.setup.outputs.any_pending == 'true' && @@ -458,7 +481,7 @@ jobs: # The trigger jobs below never need changing. # --------------------------------------------------------------------------- aggregate_migrations: - needs: [migration_001, migration_002] + needs: [migration_001, migration_002, migration_003] if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') runs-on: ubuntu-latest outputs: From 45c2df4a48ddcff343f9c72272c1e13164d0869c Mon Sep 17 00:00:00 2001 From: Seth Van Niekerk Date: Sun, 14 Jun 2026 08:55:40 -0400 Subject: [PATCH 3/8] oops dont need a migration --- .github/scripts/publish/run.sh | 2 +- .github/workflows/run-migrations.yml | 35 +++++----------------------- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/.github/scripts/publish/run.sh b/.github/scripts/publish/run.sh index a9847dc..b7d792f 100644 --- a/.github/scripts/publish/run.sh +++ b/.github/scripts/publish/run.sh @@ -20,7 +20,7 @@ fi RELEASES_BRANCH="releases" MAX_VERSIONED_ZIPS=10 -RELEASES_BRANCH_VERSION=4 +RELEASES_BRANCH_VERSION=3 SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" export SOURCE_BRANCH RELEASES_BRANCH MAX_VERSIONED_ZIPS diff --git a/.github/workflows/run-migrations.yml b/.github/workflows/run-migrations.yml index 43492d2..c062477 100644 --- a/.github/workflows/run-migrations.yml +++ b/.github/workflows/run-migrations.yml @@ -3,7 +3,6 @@ name: Run Migrations # Migration history: # 001 (v0 → v2): Move ZIPs from releases branch git history to GitHub Release assets # 002 (v2 → v3): Rename zips/ to metadata/ on the releases branch -# 003 (v3 → v4): Publish plugin icons to metadata/ and add icon fields to manifests permissions: contents: write @@ -37,11 +36,10 @@ jobs: any_pending: ${{ steps.detect.outputs.any_pending }} needs_001: ${{ steps.detect.outputs.needs_001 }} needs_002: ${{ steps.detect.outputs.needs_002 }} - needs_003: ${{ steps.detect.outputs.needs_003 }} use_app: ${{ steps.config.outputs.use_app }} app_id: ${{ steps.config.outputs.app_id }} # Add outputs for future migrations here: - # needs_004: ${{ steps.detect.outputs.needs_004 }} + # needs_003: ${{ steps.detect.outputs.needs_003 }} steps: - name: Validate inputs run: | @@ -72,7 +70,7 @@ jobs: id: detect run: | RELEASES_BRANCH="releases" - TARGET_VER=4 # bump when adding a new migration + TARGET_VER=3 # bump when adding a new migration current_ver=0 if git ls-remote --exit-code --heads origin "$RELEASES_BRANCH" >/dev/null 2>&1; then @@ -86,12 +84,9 @@ jobs: (( current_ver < 3 )) && echo "needs_002=true" >> "$GITHUB_OUTPUT" \ || echo "needs_002=false" >> "$GITHUB_OUTPUT" - (( current_ver < 4 )) && echo "needs_003=true" >> "$GITHUB_OUTPUT" \ - || echo "needs_003=false" >> "$GITHUB_OUTPUT" - # Add future migrations here: - # (( current_ver < 5 )) && echo "needs_004=true" >> "$GITHUB_OUTPUT" \ - # || echo "needs_004=false" >> "$GITHUB_OUTPUT" + # (( current_ver < 4 )) && echo "needs_003=true" >> "$GITHUB_OUTPUT" \ + # || echo "needs_003=false" >> "$GITHUB_OUTPUT" (( current_ver < TARGET_VER )) && echo "any_pending=true" >> "$GITHUB_OUTPUT" \ || echo "any_pending=false" >> "$GITHUB_OUTPUT" @@ -377,24 +372,6 @@ jobs: echo "rebuild_type=regular" >> "$GITHUB_OUTPUT" echo "end_version=3" >> "$GITHUB_OUTPUT" - # --------------------------------------------------------------------------- - # Migration 003 (v3 → v4): Publish plugin icons to metadata/ on the releases branch. - # needs_rebuild=regular — next publish run copies logo.* and adds icon fields to manifests. - # --------------------------------------------------------------------------- - migration_003: - needs: [setup, migration_002] - if: needs.setup.outputs.needs_003 == 'true' - runs-on: ubuntu-latest - outputs: - rebuild_type: ${{ steps.flags.outputs.rebuild_type }} - end_version: ${{ steps.flags.outputs.end_version }} - steps: - - name: Set migration flags - id: flags - run: | - echo "rebuild_type=regular" >> "$GITHUB_OUTPUT" - echo "end_version=4" >> "$GITHUB_OUTPUT" - # --------------------------------------------------------------------------- # Add future migration jobs here following the same pattern. # --------------------------------------------------------------------------- @@ -404,7 +381,7 @@ jobs: # Skipped on dry runs or if no migrations were pending. # --------------------------------------------------------------------------- write_repo_ver: - needs: [setup, migration_001, migration_002, migration_003] + needs: [setup, migration_001, migration_002] if: | always() && needs.setup.outputs.any_pending == 'true' && @@ -481,7 +458,7 @@ jobs: # The trigger jobs below never need changing. # --------------------------------------------------------------------------- aggregate_migrations: - needs: [migration_001, migration_002, migration_003] + needs: [migration_001, migration_002] if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') runs-on: ubuntu-latest outputs: From 720d9915e8531645b11e2131b479d3c71f4fc4f4 Mon Sep 17 00:00:00 2001 From: Seth Van Niekerk Date: Sun, 14 Jun 2026 08:58:27 -0400 Subject: [PATCH 4/8] immutable tags retry --- .github/scripts/publish/build-zips.sh | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/scripts/publish/build-zips.sh b/.github/scripts/publish/build-zips.sh index 70bf579..ee79e3d 100644 --- a/.github/scripts/publish/build-zips.sh +++ b/.github/scripts/publish/build-zips.sh @@ -133,13 +133,27 @@ for plugin_dir in plugins/*/; do fi release_notes+="**README:** [Plugin README](${readme_url})" - # Upload versioned GitHub Release + # Upload versioned GitHub Release (retry with numeric suffix on immutable tag conflict) echo " $plugin_name v$version - uploading to GitHub Releases" - gh release create "$release_tag" \ - --repo "$GITHUB_REPOSITORY" \ - --title "${plugin_name} v${version}" \ - --notes "$release_notes" \ - "$zip_path" + final_tag="$release_tag" + tag_suffix=0 + while true; do + if gh release create "$final_tag" \ + --repo "$GITHUB_REPOSITORY" \ + --title "${plugin_name} v${version}" \ + --notes "$release_notes" \ + "$zip_path" 2>/tmp/rel_err; then + break + fi + if grep -q "immutable\|Cannot create ref" /tmp/rel_err; then + tag_suffix=$(( tag_suffix + 1 )) + final_tag="${release_tag}-${tag_suffix}" + echo " Tag conflict on $release_tag, retrying as $final_tag" + else + cat /tmp/rel_err >&2; rm -f "$zip_path" /tmp/rel_err; exit 1 + fi + done + rm -f /tmp/rel_err rm -f "$zip_path" done From 3684b32a2bcbee3a7a997d11ff3bb2b19764a8c2 Mon Sep 17 00:00:00 2001 From: Seth Van Niekerk Date: Sun, 14 Jun 2026 09:03:55 -0400 Subject: [PATCH 5/8] skip existing releases --- .github/scripts/publish/build-zips.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/scripts/publish/build-zips.sh b/.github/scripts/publish/build-zips.sh index ee79e3d..21572bd 100644 --- a/.github/scripts/publish/build-zips.sh +++ b/.github/scripts/publish/build-zips.sh @@ -145,7 +145,10 @@ for plugin_dir in plugins/*/; do "$zip_path" 2>/tmp/rel_err; then break fi - if grep -q "immutable\|Cannot create ref" /tmp/rel_err; then + if grep -q "already exists" /tmp/rel_err; then + echo " $plugin_name v$version - release already exists, skipping upload" + break + elif grep -q "immutable\|Cannot create ref" /tmp/rel_err; then tag_suffix=$(( tag_suffix + 1 )) final_tag="${release_tag}-${tag_suffix}" echo " Tag conflict on $release_tag, retrying as $final_tag" From cd3ac9fbb256e5891359a8aa1e331ae3a9f947ea Mon Sep 17 00:00:00 2001 From: Seth Van Niekerk Date: Sun, 14 Jun 2026 09:09:58 -0400 Subject: [PATCH 6/8] remove extra icon field --- .github/scripts/publish/generate-manifest.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/scripts/publish/generate-manifest.sh b/.github/scripts/publish/generate-manifest.sh index 0799f90..bf013cc 100644 --- a/.github/scripts/publish/generate-manifest.sh +++ b/.github/scripts/publish/generate-manifest.sh @@ -239,7 +239,6 @@ for plugin_dir in plugins/*/; do --arg latest_url "$latest_url" \ --arg registry_url "$registry_url" \ --arg registry_name "$registry_name" \ - --arg icon_rel "$icon_rel" \ --argjson versioned_zips "$versioned_zips" \ --argjson latest_metadata "$latest_metadata" \ --argjson latest_size_kb "$latest_size_kb" \ @@ -257,7 +256,6 @@ for plugin_dir in plugins/*/; do discord_thread: (.discord_thread // null), registry_url: $registry_url, registry_name: $registry_name, - icon: (if $icon_rel != "" then $icon_rel else null end), last_updated: ($latest_metadata.last_updated // null), latest: (if ($latest_metadata | length > 0) then { version: $latest_metadata.version, @@ -313,13 +311,11 @@ for plugin_dir in plugins/*/; do --arg min_da_version "$min_da_version" \ --arg max_da_version "$max_da_version" \ --arg latest_url "$latest_url" \ - --arg icon_rel "$icon_rel" \ '{ slug: $slug, name: $name, description: $description, manifest_url: $manifest_url, - icon: (if $icon_rel != "" then $icon_rel else null end), author: $author, license: (if $license != "" then $license else null end), deprecated: $deprecated, From 42d365d68fbed3e043b05052888cc79b9def8993 Mon Sep 17 00:00:00 2001 From: Seth Van Niekerk Date: Sun, 14 Jun 2026 09:18:50 -0400 Subject: [PATCH 7/8] fix immutable release reference --- .github/scripts/publish/generate-manifest.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/scripts/publish/generate-manifest.sh b/.github/scripts/publish/generate-manifest.sh index bf013cc..842bf90 100644 --- a/.github/scripts/publish/generate-manifest.sh +++ b/.github/scripts/publish/generate-manifest.sh @@ -163,10 +163,11 @@ for plugin_dir in plugins/*/; do while IFS= read -r release_tag; do [[ -z "$release_tag" ]] && continue zip_version="${release_tag#${plugin_name}-}" - zip_url="${plugin_name}-${zip_version}/${plugin_name}-${zip_version}.zip" - # Strip a plain-integer migration retry suffix (e.g. 1.0.0-1 -> 1.0.0) so the - # canonical version is used for metadata lookup and manifest entries. + # Strip a plain-integer retry suffix (e.g. 1.0.0-1 -> 1.0.0) for metadata lookup and the ZIP filename. canonical_version=$(sed 's/-[0-9][0-9]*$//' <<< "$zip_version") + # Release directory uses the full tag version (may include retry suffix); + # the ZIP asset filename uses the canonical version (how build-zips.sh named it). + zip_url="${plugin_name}-${zip_version}/${plugin_name}-${canonical_version}.zip" # Fresh metadata from this run takes priority; fall back to existing manifest fresh_meta_file="${BUILD_META_DIR:-}/$plugin_key/${plugin_key}-${canonical_version}.json" @@ -219,7 +220,10 @@ for plugin_dir in plugins/*/; do # Use the actual tag-derived zip_version (which may include a retry suffix) for the URL, # so the URL resolves to the real release asset. latest_url="" - [[ -n "$latest_zip_version" ]] && latest_url="${plugin_name}-${latest_zip_version}/${plugin_name}-${latest_zip_version}.zip" + if [[ -n "$latest_zip_version" ]]; then + latest_canonical=$(sed 's/-[0-9][0-9]*$//' <<< "$latest_zip_version") + latest_url="${plugin_name}-${latest_zip_version}/${plugin_name}-${latest_canonical}.zip" + fi # Overwrite min/max_dispatcharr_version for the current version's entry from plugin.json, # so metadata-only updates (no version bump) are reflected without a rebuild. From d09cf74f093c12e900d0569f087ef150244902a4 Mon Sep 17 00:00:00 2001 From: Seth Van Niekerk Date: Sun, 14 Jun 2026 09:26:07 -0400 Subject: [PATCH 8/8] upload skip fix --- .github/scripts/publish/build-zips.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/scripts/publish/build-zips.sh b/.github/scripts/publish/build-zips.sh index 21572bd..8116dbe 100644 --- a/.github/scripts/publish/build-zips.sh +++ b/.github/scripts/publish/build-zips.sh @@ -137,6 +137,7 @@ for plugin_dir in plugins/*/; do echo " $plugin_name v$version - uploading to GitHub Releases" final_tag="$release_tag" tag_suffix=0 + upload_skipped=false while true; do if gh release create "$final_tag" \ --repo "$GITHUB_REPOSITORY" \ @@ -147,6 +148,7 @@ for plugin_dir in plugins/*/; do fi if grep -q "already exists" /tmp/rel_err; then echo " $plugin_name v$version - release already exists, skipping upload" + upload_skipped=true break elif grep -q "immutable\|Cannot create ref" /tmp/rel_err; then tag_suffix=$(( tag_suffix + 1 )) @@ -158,6 +160,13 @@ for plugin_dir in plugins/*/; do done rm -f /tmp/rel_err + # If the upload was skipped (release already existed), discard the fresh metadata + # so generate-manifest.sh falls back to the existing manifest's checksums, which + # reflect the zip that is actually in the release rather than the one we just built. + if [[ "$upload_skipped" == "true" ]]; then + rm -f "$BUILD_META_DIR/$plugin_key/${plugin_key}-${version}.json" + fi + rm -f "$zip_path" done