feat: add manual run for all platforms (#79)

Co-authored-by: Svyatoslav Shchipunov <s.shchipunov@tinkoff.ru>
This commit is contained in:
Slava-Shchipunov
2025-12-23 12:16:34 +07:00
committed by GitHub
parent f4c13f262d
commit 3498354348

View File

@@ -12,18 +12,19 @@ on:
workflow_dispatch:
inputs:
version:
description: 'OpenWRT version (e.g., 24.10.3)'
description: 'OpenWRT version (e.g., 24.10.5)'
required: true
type: string
targets:
description: 'Targets (comma-separated, e.g., "stm32,ramips")'
required: true
description: 'Targets (comma-separated, optional)'
required: false
type: string
subtargets:
description: 'Subtargets (comma-separated, e.g., "stm32mp1,mt7621")'
required: true
description: 'Subtargets (comma-separated, optional)'
required: false
type: string
jobs:
generate-config:
runs-on: ubuntu-latest
@@ -38,16 +39,22 @@ jobs:
with:
node-version: '20.16.0'
- name: Get OpenWRT version from tag
id: get_version
- name: Get OpenWRT version from inputs or tag
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
echo "TARGETS=${{ inputs.targets }}" >> $GITHUB_ENV
echo "SUBTARGETS=${{ inputs.subtargets }}" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" == "workflow_call" ]; then
VERSION="${{ inputs.tag_name }}"
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
if [ -n "${{ inputs.targets }}" ]; then
echo "TARGETS=${{ inputs.targets }}" >> $GITHUB_ENV
fi
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
echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
fi
@@ -120,34 +127,35 @@ jobs:
- name: Setup SDK and feeds
run: |
# Find SDK directory
SDK_DIR=$(find . -maxdepth 1 -name "openwrt-sdk-*" -type d | head -n1)
if [ -z "$SDK_DIR" ]; then
echo "SDK directory not found"
exit 1
fi
# Get absolute paths
[ -z "$SDK_DIR" ] && echo "SDK directory not found" && exit 1
WORKSPACE_DIR=$(pwd)
cd "$SDK_DIR"
# Update feeds to include LuCI
./scripts/feeds update -a
./scripts/feeds install -a
# Copy current repository packages directly to package directory
# Remove unstable feeds
sed -i '/telephony/d' feeds.conf.default
sed -i '/routing/d' feeds.conf.default
# 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/amneziawg-tools" package/
cp -r "$WORKSPACE_DIR/luci-proto-amneziawg" package/
# Configure packages to build
echo "CONFIG_PACKAGE_kmod-amneziawg=m" > .config
echo "CONFIG_PACKAGE_amneziawg-tools=y" >> .config
echo "CONFIG_PACKAGE_luci-proto-amneziawg=y" >> .config
echo "CONFIG_PACKAGE_luci-i18n-amneziawg-ru=y" >> .config
# Config
cat > .config <<EOF
CONFIG_PACKAGE_kmod-amneziawg=m
CONFIG_PACKAGE_amneziawg-tools=y
CONFIG_PACKAGE_luci-proto-amneziawg=y
CONFIG_PACKAGE_luci-i18n-amneziawg-ru=y
EOF
make defconfig
- name: Build AmneziaWG packages