fix(ci): Update publish workflow to use individual ipk files
The release contains individual ipk files, not architecture-specific tarballs. Update the workflow to: - Download all *.ipk files from the release - Copy packages to all architecture directories (most SecuBox packages are architecture-independent LuCI/shell packages) - Simplify the repository structure creation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f447f62b13
commit
f9d1fee08e
125
.github/workflows/publish-package-repo.yml
vendored
125
.github/workflows/publish-package-repo.yml
vendored
@ -42,7 +42,7 @@ jobs:
|
|||||||
VERSION_NUM="${VERSION#v}"
|
VERSION_NUM="${VERSION#v}"
|
||||||
echo "version_num=$VERSION_NUM" >> $GITHUB_OUTPUT
|
echo "version_num=$VERSION_NUM" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Download package tarballs from release
|
- name: Download packages from release
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
@ -50,36 +50,18 @@ jobs:
|
|||||||
cd downloads
|
cd downloads
|
||||||
|
|
||||||
VERSION="${{ steps.version.outputs.version }}"
|
VERSION="${{ steps.version.outputs.version }}"
|
||||||
VERSION_NUM="${{ steps.version.outputs.version_num }}"
|
|
||||||
|
|
||||||
echo "Downloading packages from release $VERSION..."
|
echo "Downloading packages from release $VERSION..."
|
||||||
|
|
||||||
# Architecture-specific packages
|
# Download all ipk files from the release
|
||||||
ARCHITECTURES=(
|
gh release download "$VERSION" -p "*.ipk" || {
|
||||||
"x86-64:x86_64"
|
echo "No ipk files found in release"
|
||||||
"aarch64-generic:aarch64_generic"
|
exit 1
|
||||||
"aarch64-cortex-a72:aarch64_cortex-a72"
|
}
|
||||||
"aarch64-cortex-a53:aarch64_cortex-a53"
|
|
||||||
"rockchip-armv8:aarch64_generic"
|
|
||||||
"bcm27xx-bcm2711:aarch64_cortex-a72"
|
|
||||||
"mediatek-filogic:aarch64_cortex-a53"
|
|
||||||
"mips-24kc:mips_24kc"
|
|
||||||
"mipsel-24kc:mipsel_24kc"
|
|
||||||
)
|
|
||||||
|
|
||||||
for arch_map in "${ARCHITECTURES[@]}"; do
|
echo "Downloaded packages:"
|
||||||
ARCH="${arch_map%%:*}"
|
ls -lh *.ipk | wc -l
|
||||||
OPKG_ARCH="${arch_map##*:}"
|
echo "packages total"
|
||||||
TARBALL="secubox-${VERSION_NUM}-${ARCH}.tar.gz"
|
|
||||||
|
|
||||||
echo "Downloading $TARBALL for opkg arch $OPKG_ARCH..."
|
|
||||||
gh release download "$VERSION" -p "$TARBALL" || echo "Skipping $TARBALL (not found)"
|
|
||||||
done
|
|
||||||
|
|
||||||
# All-architectures package (LuCI apps, configs)
|
|
||||||
gh release download "$VERSION" -p "secubox-${VERSION_NUM}-all-architectures.tar.gz" || true
|
|
||||||
|
|
||||||
ls -lh
|
|
||||||
|
|
||||||
- name: Create repository structure
|
- name: Create repository structure
|
||||||
run: |
|
run: |
|
||||||
@ -87,78 +69,43 @@ jobs:
|
|||||||
mkdir -p repo/luci
|
mkdir -p repo/luci
|
||||||
mkdir -p repo/catalog
|
mkdir -p repo/catalog
|
||||||
|
|
||||||
VERSION_NUM="${{ steps.version.outputs.version_num }}"
|
# All supported architectures - packages with _all.ipk work for all
|
||||||
|
ARCHITECTURES=(
|
||||||
# Architecture mappings
|
"x86_64"
|
||||||
declare -A ARCH_MAP=(
|
"aarch64_generic"
|
||||||
["x86-64"]="x86_64"
|
"aarch64_cortex-a72"
|
||||||
["aarch64-generic"]="aarch64_generic"
|
"aarch64_cortex-a53"
|
||||||
["aarch64-cortex-a72"]="aarch64_cortex-a72"
|
"mips_24kc"
|
||||||
["aarch64-cortex-a53"]="aarch64_cortex-a53"
|
"mipsel_24kc"
|
||||||
["rockchip-armv8"]="aarch64_generic"
|
|
||||||
["bcm27xx-bcm2711"]="aarch64_cortex-a72"
|
|
||||||
["mediatek-filogic"]="aarch64_cortex-a53"
|
|
||||||
["mips-24kc"]="mips_24kc"
|
|
||||||
["mipsel-24kc"]="mipsel_24kc"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Extract and organize packages
|
# Create directories for each architecture
|
||||||
for ARCH in "${!ARCH_MAP[@]}"; do
|
for OPKG_ARCH in "${ARCHITECTURES[@]}"; do
|
||||||
OPKG_ARCH="${ARCH_MAP[$ARCH]}"
|
|
||||||
TARBALL="downloads/secubox-${VERSION_NUM}-${ARCH}.tar.gz"
|
|
||||||
|
|
||||||
if [ -f "$TARBALL" ]; then
|
|
||||||
echo "Processing $TARBALL -> $OPKG_ARCH"
|
|
||||||
|
|
||||||
# Create arch directories
|
|
||||||
mkdir -p "repo/packages/${OPKG_ARCH}"
|
mkdir -p "repo/packages/${OPKG_ARCH}"
|
||||||
mkdir -p "repo/luci/${OPKG_ARCH}"
|
mkdir -p "repo/luci/${OPKG_ARCH}"
|
||||||
|
done
|
||||||
|
|
||||||
# Extract to temp
|
# Categorize and copy packages
|
||||||
TMPDIR=$(mktemp -d)
|
echo "Organizing packages..."
|
||||||
tar -xzf "$TARBALL" -C "$TMPDIR"
|
for ipk in downloads/*.ipk; do
|
||||||
|
[ -f "$ipk" ] || continue
|
||||||
|
PKG_NAME=$(basename "$ipk")
|
||||||
|
|
||||||
# Move LuCI packages to luci/ and others to packages/
|
# Determine if it's a LuCI package
|
||||||
find "$TMPDIR" -name '*.ipk' | while read pkg; do
|
|
||||||
PKG_NAME=$(basename "$pkg")
|
|
||||||
if [[ "$PKG_NAME" == luci-* ]]; then
|
if [[ "$PKG_NAME" == luci-* ]]; then
|
||||||
cp "$pkg" "repo/luci/${OPKG_ARCH}/"
|
TARGET_DIR="repo/luci"
|
||||||
else
|
else
|
||||||
cp "$pkg" "repo/packages/${OPKG_ARCH}/"
|
TARGET_DIR="repo/packages"
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -rf "$TMPDIR"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Handle all-architectures tarball (architecture-independent packages)
|
|
||||||
ALL_TARBALL="downloads/secubox-${VERSION_NUM}-all-architectures.tar.gz"
|
|
||||||
if [ -f "$ALL_TARBALL" ]; then
|
|
||||||
echo "Processing all-architectures packages..."
|
|
||||||
TMPDIR=$(mktemp -d)
|
|
||||||
tar -xzf "$ALL_TARBALL" -C "$TMPDIR"
|
|
||||||
|
|
||||||
# Copy all-arch packages to each architecture directory
|
|
||||||
for OPKG_ARCH in "x86_64" "aarch64_generic" "aarch64_cortex-a72" "aarch64_cortex-a53" "mips_24kc" "mipsel_24kc"; do
|
|
||||||
if [ -d "repo/packages/${OPKG_ARCH}" ]; then
|
|
||||||
find "$TMPDIR" -name '*.ipk' | while read pkg; do
|
|
||||||
PKG_NAME=$(basename "$pkg")
|
|
||||||
# Skip if architecture-specific version exists
|
|
||||||
if [ ! -f "repo/packages/${OPKG_ARCH}/${PKG_NAME}" ] && \
|
|
||||||
[ ! -f "repo/luci/${OPKG_ARCH}/${PKG_NAME}" ]; then
|
|
||||||
if [[ "$PKG_NAME" == luci-* ]]; then
|
|
||||||
cp "$pkg" "repo/luci/${OPKG_ARCH}/" 2>/dev/null || true
|
|
||||||
else
|
|
||||||
cp "$pkg" "repo/packages/${OPKG_ARCH}/" 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
rm -rf "$TMPDIR"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Copy to all architecture directories
|
||||||
|
# (OpenWrt packages are typically arch-independent for LuCI/shell packages)
|
||||||
|
for OPKG_ARCH in "${ARCHITECTURES[@]}"; do
|
||||||
|
cp "$ipk" "${TARGET_DIR}/${OPKG_ARCH}/"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
echo ""
|
||||||
echo "Repository structure:"
|
echo "Repository structure:"
|
||||||
find repo -type d
|
find repo -type d
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user