feat: add manual start for build

This commit is contained in:
Slava-Shchipunov
2025-10-04 00:04:18 +07:00
parent e9dc49aeda
commit 55a2e3c3f0
2 changed files with 55 additions and 15 deletions

View File

@@ -9,6 +9,20 @@ on:
tag_name:
required: true
type: string
workflow_dispatch:
inputs:
version:
description: 'OpenWRT version (e.g., 24.10.3)'
required: true
type: string
targets:
description: 'Targets (comma-separated, e.g., "stm32,ramips")'
required: true
type: string
subtargets:
description: 'Subtargets (comma-separated, e.g., "stm32mp1,mt7621")'
required: true
type: string
jobs:
generate-config:
@@ -27,8 +41,12 @@ jobs:
- name: Get OpenWRT version from tag
id: get_version
run: |
if [ "${{ github.event_name }}" == "workflow_call" ]; then
echo "VERSION=${{ inputs.tag_name }}" >> $GITHUB_ENV
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
else
echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
@@ -39,7 +57,7 @@ jobs:
- name: Generate Job Config
id: generate-config
run: node index.js ${{ env.VERSION }}
run: node index.js ${{ env.VERSION }} "${{ env.TARGETS }}" "${{ env.SUBTARGETS }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}