diff --git a/.github/workflows/wheels-released.yml b/.github/workflows/wheels-released.yml index 5cb0992..408d3ed 100644 --- a/.github/workflows/wheels-released.yml +++ b/.github/workflows/wheels-released.yml @@ -199,6 +199,11 @@ jobs: env: GPG_PASSPHRASE: ${{ secrets.WHEELS_REPO_GPG_PASSPHRASE }} GPG_KEY_ID: ${{ env.GPG_KEY_ID }} + # Scope regen to the dispatched channel only. The sync step above pulls + # just pool// from R2, so regenerating the OTHER channel would + # scan an empty local pool and clobber its R2 index on upload + # (#3218 / #2838). The other channel's dists are left untouched. + CHANNELS: ${{ steps.inputs.outputs.channel }} run: | set -euo pipefail chmod +x scripts/regenerate-apt-metadata.sh diff --git a/scripts/regenerate-apt-metadata.sh b/scripts/regenerate-apt-metadata.sh index b506cd3..31093ad 100755 --- a/scripts/regenerate-apt-metadata.sh +++ b/scripts/regenerate-apt-metadata.sh @@ -20,7 +20,17 @@ fi ARCHITECTURES="amd64 arm64" COMPONENTS="main" -DISTRIBUTIONS="stable bleeding-edge" +# Per-channel regen (CHANNELS env), default = both for manual full rebuilds. +# +# CRITICAL (#3218, recurrence of #2838): the publish workflow only syncs +# pool// from R2, so any channel NOT being published has an +# empty local pool here. Regenerating it would emit an empty Packages, and the +# upload step's `find dists` would then clobber that channel's good R2 index. +# A bleeding-edge snapshot publish was wiping the stable index minutes after +# every stable release. Scoping to the dispatched channel keeps the other +# channel's R2 dists untouched. The workflow passes CHANNELS=; a bare +# manual run still rebuilds both (only safe when both pools are present locally). +DISTRIBUTIONS="${CHANNELS:-stable bleeding-edge}" # apt-ftparchive uses a config file to know where the pool lives. The same # config drives both distributions — only the dist-name and the scan path