Compare commits

...

2 Commits

Author SHA1 Message Date
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 kind: pipeline
type: docker type: docker
name: awg-openwrt-build-publish name: awg-openwrt-full-build
trigger: trigger:
event: event:
@@ -13,104 +13,92 @@ volumes:
steps: steps:
- name: build - name: build
image: node:20-bookworm image: debian:12
volumes: volumes:
- name: drone_cache - name: drone_cache
path: /cache path: /cache
environment: environment:
OPENWRT_TAG: "24.10.2" OPENWRT_GIT_REF: "v24.10.2"
OPENWRT_PKGARCH: "aarch64_generic"
OPENWRT_TARGET: "rockchip" OPENWRT_TARGET: "rockchip"
OPENWRT_SUBTARGET: "armv8" OPENWRT_SUBTARGET: "armv8"
OPENWRT_VERMAGIC: "0d90324e4fb76fa1183dcb1f1b600b7a-r1" OPENWRT_ARCH: "aarch64_generic"
OPENWRT_KERNEL_DEP: "kernel (=6.6.93~0d90324e4fb76fa1183dcb1f1b600b7a-r1)"
commands: commands:
- apt-get update - apt-get update
- | - |
DEBIAN_FRONTEND=noninteractive apt-get install -y \ DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates \ build-essential clang flex bison g++ gawk gcc-multilib g++-multilib \
curl \ gettext git libncurses-dev libssl-dev python3 python3-dev python3-setuptools \
wget \ python3-distutils python3-pyelftools rsync swig unzip zlib1g-dev file wget \
jq \ curl xz-utils zstd subversion patch tar cpio jq ca-certificates
git \
rsync \
unzip \
zip \
xz-utils \
zstd \
gawk \
file \
patch \
perl \
python3 \
python3-dev \
python3-pyelftools \
python3-setuptools \
python3-distutils \
swig \
build-essential \
clang \
libncurses5-dev \
libncursesw5-dev \
libelf-dev \
gettext \
xsltproc \
cpio \
flex \
bison \
tar
- npm install
- mkdir -p "/cache/awg-openwrt/$DRONE_TAG" - echo "DRONE_TAG=$DRONE_TAG"
- rm -rf "/cache/awg-openwrt/$DRONE_TAG/"* - echo "OPENWRT_GIT_REF=$OPENWRT_GIT_REF"
- mkdir -p "$DRONE_WORKSPACE/awgrelease" - 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) - rm -rf /work
- test -n "$SDK_FILE" - mkdir -p /work
- SDK_URL="https://downloads.openwrt.org/releases/$OPENWRT_TAG/targets/$OPENWRT_TARGET/$OPENWRT_SUBTARGET/$SDK_FILE" - cd /work
- wget -O "$SDK_FILE" "$SDK_URL" - 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 cat > .config <<'EOF'
*.tar.zst) tar --zstd -xf "$SDK_FILE" ;; CONFIG_TARGET_rockchip=y
*.tar.xz) tar -xf "$SDK_FILE" ;; CONFIG_TARGET_rockchip_armv8=y
*) echo "Unknown SDK archive format: $SDK_FILE"; exit 1 ;; CONFIG_PACKAGE_kmod-amneziawg=m
esac CONFIG_PACKAGE_amneziawg-tools=y
CONFIG_PACKAGE_luci-proto-amneziawg=y
CONFIG_PACKAGE_luci-i18n-amneziawg-ru=y
EOF
- rm -f "$SDK_FILE" - make defconfig
- SDK_ROOT=$(find "$DRONE_WORKSPACE" -maxdepth 1 -type d -name 'openwrt-sdk-*' | head -n1) - make download -j"$(nproc)" || make download -j1 V=s
- test -n "$SDK_ROOT"
- cd "$SDK_ROOT" && ./scripts/feeds update -a - make package/kmod-amneziawg/compile -j"$(nproc)" V=s
- cd "$SDK_ROOT" && ./scripts/feeds install -a - 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
- cp -r "$DRONE_WORKSPACE/kmod-amneziawg" "$SDK_ROOT/package/" - rm -rf "$DRONE_WORKSPACE/awgrelease"
- cp -r "$DRONE_WORKSPACE/amneziawg-tools" "$SDK_ROOT/package/" - mkdir -p "$DRONE_WORKSPACE/awgrelease"
- cp -r "$DRONE_WORKSPACE/luci-proto-amneziawg" "$SDK_ROOT/package/" - mkdir -p "/cache/awg-openwrt/$DRONE_TAG"
- find "/cache/awg-openwrt/$DRONE_TAG" -type f -delete || true
- cd "$SDK_ROOT" && printf '%s\n' 'CONFIG_PACKAGE_kmod-amneziawg=m' > .config - KMOD_FILE=$(find bin/targets -type f -name 'kmod-amneziawg*.ipk' | sort | tail -n1)
- cd "$SDK_ROOT" && printf '%s\n' 'CONFIG_PACKAGE_amneziawg-tools=y' >> .config - TOOLS_FILE=$(find bin/packages -type f -name 'amneziawg-tools*.ipk' | sort | tail -n1)
- cd "$SDK_ROOT" && printf '%s\n' 'CONFIG_PACKAGE_luci-proto-amneziawg=y' >> .config - LUCI_FILE=$(find bin/packages -type f -name 'luci-proto-amneziawg*.ipk' | sort | tail -n1)
- cd "$SDK_ROOT" && printf '%s\n' 'CONFIG_PACKAGE_luci-i18n-amneziawg-ru=y' >> .config - I18N_FILE=$(find bin/packages -type f -name 'luci-i18n-amneziawg-ru*.ipk' | sort | tail -n1 || true)
- cd "$SDK_ROOT" && make defconfig
- cd "$SDK_ROOT" && make package/kmod-amneziawg/download V=s || true - test -n "$KMOD_FILE"
- cd "$SDK_ROOT" && make package/kmod-amneziawg/prepare V=s || true - test -n "$TOOLS_FILE"
- cd "$SDK_ROOT" && make package/kmod-amneziawg/compile V=s - test -n "$LUCI_FILE"
- cd "$SDK_ROOT" && make package/luci-proto-amneziawg/download V=s - cp "$KMOD_FILE" "$DRONE_WORKSPACE/awgrelease/"
- cd "$SDK_ROOT" && make package/luci-proto-amneziawg/prepare V=s - cp "$TOOLS_FILE" "$DRONE_WORKSPACE/awgrelease/"
- cd "$SDK_ROOT" && make package/luci-proto-amneziawg/compile V=s - cp "$LUCI_FILE" "$DRONE_WORKSPACE/awgrelease/"
- if [ -n "$I18N_FILE" ]; then cp "$I18N_FILE" "$DRONE_WORKSPACE/awgrelease/"; fi
- cd "$SDK_ROOT" && make package/amneziawg-tools/download V=s - rm -rf /tmp/kmodcheck
- cd "$SDK_ROOT" && make package/amneziawg-tools/prepare V=s - mkdir -p /tmp/kmodcheck/pkg /tmp/kmodcheck/control
- cd "$SDK_ROOT" && make package/amneziawg-tools/compile V=s - 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
- find "$SDK_ROOT/bin/packages" -type f -name 'amneziawg-tools*.ipk' -exec cp {} "$DRONE_WORKSPACE/awgrelease/" \; - ls -lah "$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/" \;
- test -n "$(find "$DRONE_WORKSPACE/awgrelease" -type f -name '*.ipk' | head -n1)"
- cp -a "$DRONE_WORKSPACE/awgrelease/." "/cache/awg-openwrt/$DRONE_TAG/" - cp -a "$DRONE_WORKSPACE/awgrelease/." "/cache/awg-openwrt/$DRONE_TAG/"
- ls -lah "/cache/awg-openwrt/$DRONE_TAG/" - ls -lah "/cache/awg-openwrt/$DRONE_TAG/"