Fix Drone file
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
Maksim Zavitaev
2026-03-30 03:19:18 +03:00
parent ded94df0c1
commit 6210c73b30

View File

@@ -1,14 +1,22 @@
kind: pipeline
type: docker
name: awg-openwrt-build
name: awg-openwrt-build-publish
trigger:
event:
- tag
volumes:
- name: drone_cache
host:
path: /cache
steps:
- name: build
image: node:20-bookworm
volumes:
- name: drone_cache
path: /cache
environment:
OPENWRT_TAG: "24.10.2"
OPENWRT_PKGARCH: "aarch64_generic"
@@ -50,20 +58,15 @@ steps:
flex \
bison \
tar
- node --version
- npm --version
- python3 --version
- echo "OPENWRT_TAG=$OPENWRT_TAG"
- echo "OPENWRT_PKGARCH=$OPENWRT_PKGARCH"
- echo "OPENWRT_TARGET=$OPENWRT_TARGET"
- echo "OPENWRT_SUBTARGET=$OPENWRT_SUBTARGET"
- echo "OPENWRT_VERMAGIC=$OPENWRT_VERMAGIC"
- npm install
- mkdir -p "/cache/awg-openwrt/$DRONE_TAG"
- rm -rf "/cache/awg-openwrt/$DRONE_TAG/"*
- mkdir -p "$DRONE_WORKSPACE/awgrelease"
- 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"
- echo "SDK_URL=$SDK_URL"
- wget -O "$SDK_FILE" "$SDK_URL"
- |
@@ -74,11 +77,8 @@ steps:
esac
- rm -f "$SDK_FILE"
- SDK_DIR=$(find "$DRONE_WORKSPACE" -maxdepth 1 -type d -name 'openwrt-sdk-*' | head -n1)
- test -n "$SDK_DIR"
- SDK_ROOT="$SDK_DIR"
- echo "SDK_ROOT=$SDK_ROOT"
- test -d "$SDK_ROOT"
- SDK_ROOT=$(find "$DRONE_WORKSPACE" -maxdepth 1 -type d -name 'openwrt-sdk-*' | head -n1)
- test -n "$SDK_ROOT"
- cd "$SDK_ROOT" && ./scripts/feeds update -a
- cd "$SDK_ROOT" && ./scripts/feeds install -a
@@ -105,28 +105,26 @@ steps:
- cd "$SDK_ROOT" && make package/amneziawg-tools/prepare V=s
- cd "$SDK_ROOT" && make package/amneziawg-tools/compile V=s
- mkdir -p "$DRONE_WORKSPACE/awgrelease"
- POSTFIX="v${OPENWRT_TAG}_${OPENWRT_PKGARCH}_${OPENWRT_TARGET}_${OPENWRT_SUBTARGET}"
- KMOD_POSTFIX="v${OPENWRT_TAG}_${OPENWRT_PKGARCH}_${OPENWRT_TARGET}_${OPENWRT_SUBTARGET}_${OPENWRT_VERMAGIC}"
- echo "POSTFIX=$POSTFIX"
- echo "KMOD_POSTFIX=$KMOD_POSTFIX"
- 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/" \;
- ls -lah "$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/"
- ls -lah "/cache/awg-openwrt/$DRONE_TAG/"
- name: publish-release
image: plugins/gitea-release
volumes:
- name: drone_cache
path: /cache
settings:
base_url: https://git.mzavitaev.ru
api_key:
from_secret: gitea_token
files:
- awgrelease/*.ipk
- /cache/awg-openwrt/${DRONE_TAG}/*.ipk
checksum: sha256
file_exists: overwrite
title: AWG for OpenWrt 24.10.2