From 3498354348ba85f1f62695abaeecd4240905e2f3 Mon Sep 17 00:00:00 2001 From: Slava-Shchipunov <92646230+Slava-Shchipunov@users.noreply.github.com> Date: Tue, 23 Dec 2025 12:16:34 +0700 Subject: [PATCH] feat: add manual run for all platforms (#79) Co-authored-by: Svyatoslav Shchipunov --- .github/workflows/build-module.yml | 78 ++++++++++++++++-------------- 1 file changed, 43 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build-module.yml b/.github/workflows/build-module.yml index 89859e2..78a5f6c 100644 --- a/.github/workflows/build-module.yml +++ b/.github/workflows/build-module.yml @@ -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 <