From b3606e33a615acd88777ff415bb3d01b8587e3ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sun, 19 Apr 2026 22:45:54 +0800 Subject: [PATCH] release: fix apk package file ownership --- .github/build_alpine_apk.sh | 17 +++++++++++++++-- .github/build_openwrt_apk.sh | 17 +++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/build_alpine_apk.sh b/.github/build_alpine_apk.sh index aaaa04f9..610103b5 100755 --- a/.github/build_alpine_apk.sh +++ b/.github/build_alpine_apk.sh @@ -2,6 +2,18 @@ set -e -o pipefail +prepare_apk_root() { + # apk mkpkg resolves owner/group names through --root/etc/{passwd,group}. + APK_ROOT_DIR=$(mktemp -d) + mkdir -p "$APK_ROOT_DIR/etc" + cat > "$APK_ROOT_DIR/etc/passwd" < "$APK_ROOT_DIR/etc/group" < "$PACKAGES_DIR/.conffiles_static" | sort > "$PACKAGES_DIR/.list" # Build APK -apk mkpkg \ +apk --root "$APK_ROOT_DIR" mkpkg \ --info "name:sing-box" \ --info "version:${APK_VERSION}" \ --info "description:The universal proxy platform." \ diff --git a/.github/build_openwrt_apk.sh b/.github/build_openwrt_apk.sh index 49e1c131..59f07fd8 100755 --- a/.github/build_openwrt_apk.sh +++ b/.github/build_openwrt_apk.sh @@ -2,6 +2,18 @@ set -e -o pipefail +prepare_apk_root() { + # apk mkpkg resolves owner/group names through --root/etc/{passwd,group}. + APK_ROOT_DIR=$(mktemp -d) + mkdir -p "$APK_ROOT_DIR/etc" + cat > "$APK_ROOT_DIR/etc/passwd" < "$APK_ROOT_DIR/etc/group" < "$PACKAGES_DIR/.conffiles_static" | sort > "$PACKAGES_DIR/.list" # Build APK -apk mkpkg \ +apk --root "$APK_ROOT_DIR" mkpkg \ --info "name:sing-box" \ --info "version:${APK_VERSION}" \ --info "description:The universal proxy platform." \