Improve package version check and repository management

- Replace apt-cache with direct HTTP queries to Armbian repository
  package indices for reliable version detection across all components
- Add repository cleanup jobs (preclean/postclean) to purge old
  package versions and keep only newest
- Implement retry logic (3 attempts) for aptly mirror update
  operations with automatic mirror recreation on failure
- Add download validation to ensure .deb files are actually downloaded
- Add HIDE_NO_UPDATE input option for controlling summary output
- Always sync to debs-beta, sync to debs only on actual version updates
- Enhanced debugging with comprehensive logging for aptly operations
This commit is contained in:
Igor Pecovnik
2025-12-28 21:23:57 +01:00
committed by Igor
parent 4d1474c6f7
commit 7348f4c04e
3 changed files with 367 additions and 193 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -8,6 +8,10 @@ on:
type: boolean
description: "Add https://repo.armbian.com/partial/ to stable repo"
default: false
purge:
type: boolean
description: "Run repository cleanup to purge old package versions"
default: false
concurrency:
group: pipeline
@@ -39,6 +43,7 @@ jobs:
BUILD_RUNNER: "ubuntu-latest"
#BUILD_RUNNER: "X64"
HOST_DEPLOY: "repo.armbian.com"
PURGE: ${{ github.event.inputs.purge }}
secrets:
GPG_KEY1: ${{ secrets.GPG_KEY3 }}
GPG_KEY2: ${{ secrets.GPG_KEY4 }}
@@ -89,25 +94,6 @@ jobs:
TARGET=${REPOSITORY/debs/repository}
sudo chown -R ${USER}:${USER} /outgoing/${TARGET} /armbian/openssh-server/storage/${REPOSITORY}
# delete older packages
declare -A delete_packages
DELETE_AFTER="22.08"
delete_packages=(
["discord"]="% *"
["homeassistant-supervised"]="% *"
["fastfetch"]="% *"
["test_delete_pkg"]="% *"
)
# Loop over the array of packages
for key in "${!delete_packages[@]}"
do
tools/repository/repo \
-i /armbian/openssh-server/storage/${{ matrix.repository }} \
-o /outgoing/${TARGET} \
-c delete -l "Name (% $key*), \$Version (${delete_packages[$key]})"
done
# include packages from manually made images
if [[ "${{ github.event.inputs.partial }}" == "true" ]]; then
@@ -124,8 +110,17 @@ jobs:
sudo rm -rf /outgoing/repository-beta/*
fi
# add from incoming
tools/repository/repo -i /armbian/openssh-server/storage/${{ matrix.repository }} -o /outgoing/${TARGET} -c update
# Count .deb files in incoming directory
DEB_COUNT=$(find /armbian/openssh-server/storage/${{ matrix.repository }} -type f -name "*.deb" 2>/dev/null | wc -l)
echo "Found ${DEB_COUNT} .deb files in storage/${{ matrix.repository }}"
# Only run repository update if there are .deb files to add
if [[ ${DEB_COUNT} -gt 0 ]]; then
# add from incoming
tools/repository/repo -i /armbian/openssh-server/storage/${{ matrix.repository }} -o /outgoing/${TARGET} -c update
else
echo "No .deb files found in storage/${{ matrix.repository }}, skipping repository update"
fi
fi
# calculate size
du -hc --max-depth=1 /outgoing/${TARGET}/public* | tail -1 | awk '{print $1}' > /outgoing/${TARGET}/public/size.txt
@@ -246,4 +241,4 @@ jobs:
with:
token: ${{ secrets.DISPATCH }}
repository: armbian/armbian.github.io
event-type: "Redirector update"
event-type: "Infrastructure: Update redirector"

View File

@@ -17,7 +17,7 @@ It also produces [data exchange files](https://github.armbian.com/) used for aut
| [Build Artifacts Assembly](https://github.com/armbian/os/actions/workflows/complete-artifact-matrix-all.yml) | <a href=https://github.com/armbian/os/actions/workflows/complete-artifact-matrix-all.yml><img alt="Artifacts generation" src="https://img.shields.io/github/actions/workflow/status/armbian/os/complete-artifact-matrix-all.yml?label=&style=for-the-badge&branch=main&logoColor=white"></a> | Assembles packages and stores them in the [ORAS cache](https://github.com/orgs/armbian/packages) |
| [Linux Kernel Shallow Bundles](https://github.com/armbian/shallow/actions/workflows/git-trees-oras.yml) | <a href=https://github.com/armbian/shallow/actions/workflows/git-trees-oras.yml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/shallow/git-trees-oras.yml?label=&style=for-the-badge&branch=main&logoColor=white"></a> | Packages minimal (shallow) kernel source trees for fast and efficient CI use, reducing clone depth and speeding up build workflows |
| [Build Armbian Docker Image](https://github.com/armbian/docker-armbian-build/actions/workflows/update_docker.yml) | <a href=https://github.com/armbian/docker-armbian-build/actions/workflows/update_docker.yml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/docker-armbian-build/update_docker.yml?label=&style=for-the-badge&branch=main&logoColor=white"></a> | Builds and publishes Docker images for the [Armbian Build Framework](https://github.com/armbian/build) to the [GitHub Container Registry](https://github.com/orgs/armbian/packages) |
| [Generate APT Repository](https://github.com/armbian/os/actions/workflows/repository-update.yml) | <a href=https://github.com/armbian/os/actions/workflows/repository-update.yml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/os/repository-update.yml?label=&style=for-the-badge&branch=main&logoColor=white"></a> | Publishes packages from the [ORAS cache](https://github.com/orgs/armbian/packages) and [external sources](https://github.com/armbian/os/tree/main/external) to APT repositories |
| [Repository Update](https://github.com/armbian/armbian.github.io/actions/workflows/infrastructure-repository-update.yml) | <a href=https://github.com/armbian/armbian.github.io/actions/workflows/infrastructure-repository-update.yml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/armbian.github.io/infrastructure-repository-update.yml?label=&style=for-the-badge&branch=main&logoColor=white"></a> | Downloads external packages from third-party sources and adds fresh packages from Armbian ORAS cache to APT repositories |
## Testing & Validation