ci: promote preview .deb to stable on release (#10846)

The current CI job expects the release to have the `.deb` files
attached. Since writing that workflow, I've changed my mind on attaching
the `.deb` files there. Instead, they are only uploaded to the
repository. Without documentation on how to use them, these `.deb` files
are unlikely to provide a good user experience.

We change the job to instead promote the latest "preview` archives to
the stable repo.
This commit is contained in:
Thomas Eizinger
2025-11-11 06:57:02 +11:00
committed by GitHub
parent bd2abbaae3
commit 49b7701536
2 changed files with 31 additions and 27 deletions

View File

@@ -8,6 +8,7 @@
# The `pool-` directories are referenced by the live repository metadata and the files in there need to atomically change with the metadata.
set -euo pipefail
shopt -s globstar
COMPONENT="main"
WORK_DIR="$(mktemp -d)"
@@ -57,7 +58,11 @@ for DISTRIBUTION in "stable" "preview"; do
if [ "$(ls -A "${IMPORT_DIR}")" ]; then
echo "Normalizing package names..."
for deb in "${IMPORT_DIR}"/*.deb; do
for deb in "${IMPORT_DIR}"/**; do
if [[ ! "$deb" == *.deb ]]; then
continue
fi
if [ -f "$deb" ]; then
# Extract metadata from the .deb file
PACKAGE=$(dpkg-deb -f "$deb" Package 2>/dev/null)
@@ -85,7 +90,7 @@ for DISTRIBUTION in "stable" "preview"; do
done
echo "Importing new packages..."
mv --force --target-directory="${POOL_DIR}/" "${IMPORT_DIR}"/*.deb
mv --force --target-directory="${POOL_DIR}/" "${IMPORT_DIR}"/**/*.deb
fi
if [ -z "$(ls -A "${POOL_DIR}")" ]; then