Compare commits

..

3 Commits

Author SHA1 Message Date
Maksim Zavitaev
0472a2c3aa Fix Drone file
Some checks failed
continuous-integration/drone/tag Build is failing
2026-03-30 13:42:33 +03:00
Maksim Zavitaev
a2c1dbf7d5 Fix Drone file
Some checks are pending
continuous-integration/drone/tag Build is running
2026-03-30 11:33:31 +03:00
Maksim Zavitaev
caf1df999a Fix Drone file
Some checks failed
continuous-integration/drone/tag Build is failing
2026-03-30 10:54:34 +03:00

View File

@@ -1,6 +1,6 @@
kind: pipeline
type: docker
name: awg-openwrt-build-publish
name: awg-openwrt-full-build
trigger:
event:
@@ -13,104 +13,133 @@ volumes:
steps:
- name: build
image: node:20-bookworm
image: debian:12
volumes:
- name: drone_cache
path: /cache
environment:
OPENWRT_TAG: "24.10.2"
OPENWRT_PKGARCH: "aarch64_generic"
OPENWRT_GIT_REF: "v24.10.2"
OPENWRT_TARGET: "rockchip"
OPENWRT_SUBTARGET: "armv8"
OPENWRT_VERMAGIC: "0d90324e4fb76fa1183dcb1f1b600b7a-r1"
OPENWRT_ARCH: "aarch64_generic"
OPENWRT_KERNEL_DEP: "kernel (=6.6.93~0d90324e4fb76fa1183dcb1f1b600b7a-r1)"
commands:
- apt-get update
- |
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates \
curl \
wget \
jq \
git \
rsync \
unzip \
zip \
xz-utils \
zstd \
gawk \
file \
patch \
perl \
python3 \
python3-dev \
python3-pyelftools \
python3-setuptools \
python3-distutils \
swig \
bash \
build-essential \
clang \
libncurses5-dev \
libncursesw5-dev \
libelf-dev \
gettext \
xsltproc \
cpio \
curl \
file \
flex \
bison \
tar
- npm install
g++ \
gawk \
gcc-multilib \
g++-multilib \
gettext \
git \
jq \
libelf-dev \
libncurses5-dev \
libncursesw5-dev \
libssl-dev \
python3 \
python3-dev \
python3-distutils \
python3-pyelftools \
python3-setuptools \
rsync \
swig \
tar \
unzip \
wget \
xsltproc \
zlib1g-dev \
zstd \
cpio \
patch \
ca-certificates \
xz-utils \
subversion
- mkdir -p "/cache/awg-openwrt/$DRONE_TAG"
- rm -rf "/cache/awg-openwrt/$DRONE_TAG/"*
- mkdir -p "$DRONE_WORKSPACE/awgrelease"
- echo "DRONE_TAG=$DRONE_TAG"
- echo "OPENWRT_GIT_REF=$OPENWRT_GIT_REF"
- echo "OPENWRT_TARGET=$OPENWRT_TARGET"
- echo "OPENWRT_SUBTARGET=$OPENWRT_SUBTARGET"
- echo "OPENWRT_ARCH=$OPENWRT_ARCH"
- echo "OPENWRT_KERNEL_DEP=$OPENWRT_KERNEL_DEP"
- SDK_FILE=$(curl -fsSL "https://downloads.openwrt.org/releases/$OPENWRT_TAG/targets/$OPENWRT_TARGET/$OPENWRT_SUBTARGET/" | grep -o 'openwrt-sdk-[^"]*\.Linux-x86_64\.tar\.\(xz\|zst\)' | head -n1)
- test -n "$SDK_FILE"
- SDK_URL="https://downloads.openwrt.org/releases/$OPENWRT_TAG/targets/$OPENWRT_TARGET/$OPENWRT_SUBTARGET/$SDK_FILE"
- wget -O "$SDK_FILE" "$SDK_URL"
- rm -rf /work
- mkdir -p /work
- cd /work
- git clone --depth 1 --branch "$OPENWRT_GIT_REF" https://github.com/openwrt/openwrt.git
- cd /work/openwrt
- ./scripts/feeds update -a
- ./scripts/feeds install -a
- rm -rf package/kmod-amneziawg package/amneziawg-tools package/luci-proto-amneziawg
- cp -r "$DRONE_WORKSPACE/kmod-amneziawg" package/
- cp -r "$DRONE_WORKSPACE/amneziawg-tools" package/
- cp -r "$DRONE_WORKSPACE/luci-proto-amneziawg" package/
- |
case "$SDK_FILE" in
*.tar.zst) tar --zstd -xf "$SDK_FILE" ;;
*.tar.xz) tar -xf "$SDK_FILE" ;;
*) echo "Unknown SDK archive format: $SDK_FILE"; exit 1 ;;
esac
cat > .config <<'EOF'
CONFIG_TARGET_rockchip=y
CONFIG_TARGET_rockchip_armv8=y
CONFIG_PACKAGE_kmod-amneziawg=m
CONFIG_PACKAGE_amneziawg-tools=y
CONFIG_PACKAGE_luci-proto-amneziawg=y
CONFIG_PACKAGE_luci-i18n-amneziawg-ru=y
EOF
- rm -f "$SDK_FILE"
- SDK_ROOT=$(find "$DRONE_WORKSPACE" -maxdepth 1 -type d -name 'openwrt-sdk-*' | head -n1)
- test -n "$SDK_ROOT"
- make defconfig
- cd "$SDK_ROOT" && ./scripts/feeds update -a
- cd "$SDK_ROOT" && ./scripts/feeds install -a
# Сначала подготовка buildroot
- make download -j"$(nproc)" || make download -j1 V=s
- make tools/install -j"$(nproc)" V=s
- make toolchain/install -j"$(nproc)" V=s
- make target/compile -j"$(nproc)" V=s
- cp -r "$DRONE_WORKSPACE/kmod-amneziawg" "$SDK_ROOT/package/"
- cp -r "$DRONE_WORKSPACE/amneziawg-tools" "$SDK_ROOT/package/"
- cp -r "$DRONE_WORKSPACE/luci-proto-amneziawg" "$SDK_ROOT/package/"
# Потом сборка нужных пакетов
- make package/libs/toolchain/compile -j"$(nproc)" V=s || true
- make package/kernel/linux/compile -j"$(nproc)" V=s || true
- cd "$SDK_ROOT" && printf '%s\n' 'CONFIG_PACKAGE_kmod-amneziawg=m' > .config
- cd "$SDK_ROOT" && printf '%s\n' 'CONFIG_PACKAGE_amneziawg-tools=y' >> .config
- cd "$SDK_ROOT" && printf '%s\n' 'CONFIG_PACKAGE_luci-proto-amneziawg=y' >> .config
- cd "$SDK_ROOT" && printf '%s\n' 'CONFIG_PACKAGE_luci-i18n-amneziawg-ru=y' >> .config
- cd "$SDK_ROOT" && make defconfig
- make package/kmod-amneziawg/compile -j"$(nproc)" V=s
- make package/amneziawg-tools/compile -j"$(nproc)" V=s
- make package/luci-proto-amneziawg/compile -j"$(nproc)" V=s
- make package/luci-i18n-amneziawg-ru/compile -j"$(nproc)" V=s || true
- cd "$SDK_ROOT" && make package/kmod-amneziawg/download V=s || true
- cd "$SDK_ROOT" && make package/kmod-amneziawg/prepare V=s || true
- cd "$SDK_ROOT" && make package/kmod-amneziawg/compile V=s
- rm -rf "$DRONE_WORKSPACE/awgrelease"
- mkdir -p "$DRONE_WORKSPACE/awgrelease"
- mkdir -p "/cache/awg-openwrt/$DRONE_TAG"
- find "/cache/awg-openwrt/$DRONE_TAG" -type f -delete || true
- cd "$SDK_ROOT" && make package/luci-proto-amneziawg/download V=s
- cd "$SDK_ROOT" && make package/luci-proto-amneziawg/prepare V=s
- cd "$SDK_ROOT" && make package/luci-proto-amneziawg/compile V=s
- KMOD_FILE=$(find bin/targets -type f -name 'kmod-amneziawg*.ipk' | sort | tail -n1)
- TOOLS_FILE=$(find bin/packages -type f -name 'amneziawg-tools*.ipk' | sort | tail -n1)
- LUCI_FILE=$(find bin/packages -type f -name 'luci-proto-amneziawg*.ipk' | sort | tail -n1)
- I18N_FILE=$(find bin/packages -type f -name 'luci-i18n-amneziawg-ru*.ipk' | sort | tail -n1 || true)
- cd "$SDK_ROOT" && make package/amneziawg-tools/download V=s
- cd "$SDK_ROOT" && make package/amneziawg-tools/prepare V=s
- cd "$SDK_ROOT" && make package/amneziawg-tools/compile V=s
- test -n "$KMOD_FILE"
- test -n "$TOOLS_FILE"
- test -n "$LUCI_FILE"
- find "$SDK_ROOT/bin/packages" -type f -name 'amneziawg-tools*.ipk' -exec cp {} "$DRONE_WORKSPACE/awgrelease/" \;
- find "$SDK_ROOT/bin/packages" -type f -name 'luci-proto-amneziawg*.ipk' -exec cp {} "$DRONE_WORKSPACE/awgrelease/" \;
- find "$SDK_ROOT/bin/packages" -type f -name 'luci-i18n-amneziawg-ru*.ipk' -exec cp {} "$DRONE_WORKSPACE/awgrelease/" \;
- find "$SDK_ROOT/bin/targets" -type f -name 'kmod-amneziawg*.ipk' -exec cp {} "$DRONE_WORKSPACE/awgrelease/" \;
- cp "$KMOD_FILE" "$DRONE_WORKSPACE/awgrelease/"
- cp "$TOOLS_FILE" "$DRONE_WORKSPACE/awgrelease/"
- cp "$LUCI_FILE" "$DRONE_WORKSPACE/awgrelease/"
- if [ -n "$I18N_FILE" ]; then cp "$I18N_FILE" "$DRONE_WORKSPACE/awgrelease/"; fi
- test -n "$(find "$DRONE_WORKSPACE/awgrelease" -type f -name '*.ipk' | head -n1)"
- rm -rf /tmp/kmodcheck
- mkdir -p /tmp/kmodcheck/pkg /tmp/kmodcheck/control
- tar -xzf "$KMOD_FILE" -C /tmp/kmodcheck/pkg
- tar -xzf /tmp/kmodcheck/pkg/control.tar.gz -C /tmp/kmodcheck/control
- echo "===== kmod control ====="
- cat /tmp/kmodcheck/control/control
- grep -F "$OPENWRT_KERNEL_DEP" /tmp/kmodcheck/control/control
- ls -lah "$DRONE_WORKSPACE/awgrelease"
- cp -a "$DRONE_WORKSPACE/awgrelease/." "/cache/awg-openwrt/$DRONE_TAG/"
- ls -lah "/cache/awg-openwrt/$DRONE_TAG/"