This commit is contained in:
44
.drone.yml
44
.drone.yml
@@ -1,14 +1,22 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: awg-openwrt-build
|
name: awg-openwrt-build-publish
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- tag
|
- tag
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: drone_cache
|
||||||
|
host:
|
||||||
|
path: /cache
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: build
|
||||||
image: node:20-bookworm
|
image: node:20-bookworm
|
||||||
|
volumes:
|
||||||
|
- name: drone_cache
|
||||||
|
path: /cache
|
||||||
environment:
|
environment:
|
||||||
OPENWRT_TAG: "24.10.2"
|
OPENWRT_TAG: "24.10.2"
|
||||||
OPENWRT_PKGARCH: "aarch64_generic"
|
OPENWRT_PKGARCH: "aarch64_generic"
|
||||||
@@ -50,20 +58,15 @@ steps:
|
|||||||
flex \
|
flex \
|
||||||
bison \
|
bison \
|
||||||
tar
|
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
|
- 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)
|
- 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"
|
- test -n "$SDK_FILE"
|
||||||
- SDK_URL="https://downloads.openwrt.org/releases/$OPENWRT_TAG/targets/$OPENWRT_TARGET/$OPENWRT_SUBTARGET/$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"
|
- wget -O "$SDK_FILE" "$SDK_URL"
|
||||||
|
|
||||||
- |
|
- |
|
||||||
@@ -74,11 +77,8 @@ steps:
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
- rm -f "$SDK_FILE"
|
- rm -f "$SDK_FILE"
|
||||||
- SDK_DIR=$(find "$DRONE_WORKSPACE" -maxdepth 1 -type d -name 'openwrt-sdk-*' | head -n1)
|
- SDK_ROOT=$(find "$DRONE_WORKSPACE" -maxdepth 1 -type d -name 'openwrt-sdk-*' | head -n1)
|
||||||
- test -n "$SDK_DIR"
|
- test -n "$SDK_ROOT"
|
||||||
- SDK_ROOT="$SDK_DIR"
|
|
||||||
- echo "SDK_ROOT=$SDK_ROOT"
|
|
||||||
- test -d "$SDK_ROOT"
|
|
||||||
|
|
||||||
- cd "$SDK_ROOT" && ./scripts/feeds update -a
|
- cd "$SDK_ROOT" && ./scripts/feeds update -a
|
||||||
- cd "$SDK_ROOT" && ./scripts/feeds install -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/prepare V=s
|
||||||
- cd "$SDK_ROOT" && make package/amneziawg-tools/compile 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 '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-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/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/" \;
|
- 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)"
|
- 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
|
- name: publish-release
|
||||||
image: plugins/gitea-release
|
image: plugins/gitea-release
|
||||||
|
volumes:
|
||||||
|
- name: drone_cache
|
||||||
|
path: /cache
|
||||||
settings:
|
settings:
|
||||||
base_url: https://git.mzavitaev.ru
|
base_url: https://git.mzavitaev.ru
|
||||||
api_key:
|
api_key:
|
||||||
from_secret: gitea_token
|
from_secret: gitea_token
|
||||||
files:
|
files:
|
||||||
- awgrelease/*.ipk
|
- /cache/awg-openwrt/${DRONE_TAG}/*.ipk
|
||||||
checksum: sha256
|
checksum: sha256
|
||||||
file_exists: overwrite
|
file_exists: overwrite
|
||||||
title: AWG for OpenWrt 24.10.2
|
title: AWG for OpenWrt 24.10.2
|
||||||
|
|||||||
Reference in New Issue
Block a user