feat: add manual run for all platforms

This commit is contained in:
Svyatoslav Shchipunov
2025-12-23 11:47:49 +07:00
parent f4c13f262d
commit 311ce2290b

View File

@@ -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
echo "TARGETS=${{ inputs.targets }}" >> $GITHUB_ENV
echo "SUBTARGETS=${{ inputs.subtargets }}" >> $GITHUB_ENV if [ -n "${{ inputs.targets }}" ]; then
elif [ "${{ github.event_name }}" == "workflow_call" ]; then echo "TARGETS=${{ inputs.targets }}" >> $GITHUB_ENV
VERSION="${{ inputs.tag_name }}" fi
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
if [ -n "${{ inputs.subtargets }}" ]; then
echo "SUBTARGETS=${{ inputs.subtargets }}" >> $GITHUB_ENV
fi
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,34 +127,35 @@ 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
- name: Build AmneziaWG packages - name: Build AmneziaWG packages