mirror of
https://github.com/Slava-Shchipunov/awg-openwrt.git
synced 2026-03-14 01:13:09 +00:00
feat: add manual run for all platforms (#79)
Co-authored-by: Svyatoslav Shchipunov <s.shchipunov@tinkoff.ru>
This commit is contained in:
64
.github/workflows/build-module.yml
vendored
64
.github/workflows/build-module.yml
vendored
@@ -12,18 +12,19 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
description: 'OpenWRT version (e.g., 24.10.3)'
|
description: 'OpenWRT version (e.g., 24.10.5)'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
targets:
|
targets:
|
||||||
description: 'Targets (comma-separated, e.g., "stm32,ramips")'
|
description: 'Targets (comma-separated, optional)'
|
||||||
required: true
|
required: false
|
||||||
type: string
|
type: string
|
||||||
subtargets:
|
subtargets:
|
||||||
description: 'Subtargets (comma-separated, e.g., "stm32mp1,mt7621")'
|
description: 'Subtargets (comma-separated, optional)'
|
||||||
required: true
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
generate-config:
|
generate-config:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -38,16 +39,22 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: '20.16.0'
|
node-version: '20.16.0'
|
||||||
|
|
||||||
- name: Get OpenWRT version from tag
|
- name: Get OpenWRT version from inputs or tag
|
||||||
id: get_version
|
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
|
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
if [ -n "${{ inputs.targets }}" ]; then
|
||||||
echo "TARGETS=${{ inputs.targets }}" >> $GITHUB_ENV
|
echo "TARGETS=${{ inputs.targets }}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${{ inputs.subtargets }}" ]; then
|
||||||
echo "SUBTARGETS=${{ inputs.subtargets }}" >> $GITHUB_ENV
|
echo "SUBTARGETS=${{ inputs.subtargets }}" >> $GITHUB_ENV
|
||||||
elif [ "${{ github.event_name }}" == "workflow_call" ]; then
|
fi
|
||||||
VERSION="${{ inputs.tag_name }}"
|
|
||||||
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
|
elif [ "${{ github.event_name }}" = "workflow_call" ]; then
|
||||||
|
echo "VERSION=${{ inputs.tag_name }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
|
echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
@@ -120,33 +127,34 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup SDK and feeds
|
- name: Setup SDK and feeds
|
||||||
run: |
|
run: |
|
||||||
# Find SDK directory
|
|
||||||
SDK_DIR=$(find . -maxdepth 1 -name "openwrt-sdk-*" -type d | head -n1)
|
SDK_DIR=$(find . -maxdepth 1 -name "openwrt-sdk-*" -type d | head -n1)
|
||||||
|
[ -z "$SDK_DIR" ] && echo "SDK directory not found" && exit 1
|
||||||
|
|
||||||
if [ -z "$SDK_DIR" ]; then
|
|
||||||
echo "SDK directory not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get absolute paths
|
|
||||||
WORKSPACE_DIR=$(pwd)
|
WORKSPACE_DIR=$(pwd)
|
||||||
|
|
||||||
cd "$SDK_DIR"
|
cd "$SDK_DIR"
|
||||||
|
|
||||||
# Update feeds to include LuCI
|
# Remove unstable feeds
|
||||||
./scripts/feeds update -a
|
sed -i '/telephony/d' feeds.conf.default
|
||||||
./scripts/feeds install -a
|
sed -i '/routing/d' feeds.conf.default
|
||||||
|
|
||||||
# Copy current repository packages directly to package directory
|
# Update only required feeds
|
||||||
|
./scripts/feeds update base packages luci
|
||||||
|
./scripts/feeds install -p base
|
||||||
|
./scripts/feeds install -p packages
|
||||||
|
./scripts/feeds install -p luci
|
||||||
|
|
||||||
|
# Copy packages
|
||||||
cp -r "$WORKSPACE_DIR/kmod-amneziawg" package/
|
cp -r "$WORKSPACE_DIR/kmod-amneziawg" package/
|
||||||
cp -r "$WORKSPACE_DIR/amneziawg-tools" package/
|
cp -r "$WORKSPACE_DIR/amneziawg-tools" package/
|
||||||
cp -r "$WORKSPACE_DIR/luci-proto-amneziawg" package/
|
cp -r "$WORKSPACE_DIR/luci-proto-amneziawg" package/
|
||||||
|
|
||||||
# Configure packages to build
|
# Config
|
||||||
echo "CONFIG_PACKAGE_kmod-amneziawg=m" > .config
|
cat > .config <<EOF
|
||||||
echo "CONFIG_PACKAGE_amneziawg-tools=y" >> .config
|
CONFIG_PACKAGE_kmod-amneziawg=m
|
||||||
echo "CONFIG_PACKAGE_luci-proto-amneziawg=y" >> .config
|
CONFIG_PACKAGE_amneziawg-tools=y
|
||||||
echo "CONFIG_PACKAGE_luci-i18n-amneziawg-ru=y" >> .config
|
CONFIG_PACKAGE_luci-proto-amneziawg=y
|
||||||
|
CONFIG_PACKAGE_luci-i18n-amneziawg-ru=y
|
||||||
|
EOF
|
||||||
|
|
||||||
make defconfig
|
make defconfig
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user