From 46305ebcaabeb7a634e06f3336c6d202cea33961 Mon Sep 17 00:00:00 2001 From: CaIon Date: Wed, 4 Feb 2026 00:09:02 +0800 Subject: [PATCH] feat(workflow): add manual trigger and tag input for Docker image builds - Introduce a `workflow_dispatch` event to allow manual triggering of the Docker image build workflow. - Add an input parameter for specifying the tag name, enhancing flexibility in build processes. - Update tag resolution logic to prioritize the input tag when provided, ensuring accurate versioning during builds. --- .github/workflows/docker-image-arm64.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-image-arm64.yml b/.github/workflows/docker-image-arm64.yml index 78517af0..50630856 100644 --- a/.github/workflows/docker-image-arm64.yml +++ b/.github/workflows/docker-image-arm64.yml @@ -4,6 +4,12 @@ on: push: tags: - '*' + workflow_dispatch: + inputs: + tag: + description: 'Tag name to build (e.g., v0.10.8-alpha.3)' + required: true + type: string jobs: build_single_arch: @@ -33,7 +39,11 @@ jobs: - name: Resolve tag & write VERSION run: | git fetch --tags --force --depth=1 - TAG=${GITHUB_REF#refs/tags/} + if [ -n "${{ github.event.inputs.tag }}" ]; then + TAG="${{ github.event.inputs.tag }}" + else + TAG=${GITHUB_REF#refs/tags/} + fi echo "TAG=$TAG" >> $GITHUB_ENV echo "$TAG" > VERSION echo "Building tag: $TAG for ${{ matrix.arch }}" @@ -87,10 +97,15 @@ jobs: name: Create multi-arch manifests (Docker Hub) needs: [build_single_arch] runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' steps: - name: Extract tag - run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + run: | + if [ -n "${{ github.event.inputs.tag }}" ]; then + echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV + else + echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + fi # # - name: Normalize GHCR repository # run: echo "GHCR_REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV