🌐 AI搜索 & 代理 主页
Skip to content

Commit b749c1c

Browse files
committed
Add a workflow_dispatch for testing releases
1 parent 6dc2a01 commit b749c1c

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ on:
44
push:
55
tags:
66
- 'v*.*' # Matches tags like v1.300, etc.
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version for testing (e.g., "test-1.4" or "dev-2024-01-01")'
11+
required: true
12+
default: 'test-1.4'
13+
type: string
714

815
permissions:
916
contents: write # Required to create releases and upload assets
@@ -18,12 +25,19 @@ jobs:
1825
with:
1926
fetch-depth: 0 # Full history for proper release notes
2027

21-
- name: Extract version from tag
28+
- name: Extract version from tag or input
2229
id: version
2330
run: |
24-
VERSION=${GITHUB_REF#refs/tags/v}
25-
echo "version=${VERSION}" >> $GITHUB_OUTPUT
26-
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
31+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
32+
VERSION="${{ github.event.inputs.version }}"
33+
TAG="v${VERSION}"
34+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
35+
echo "tag=${TAG}" >> $GITHUB_OUTPUT
36+
else
37+
VERSION=${GITHUB_REF#refs/tags/v}
38+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
39+
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
40+
fi
2741
2842
- name: Prepare release artifacts
2943
run: |

0 commit comments

Comments
 (0)