Skip to content

Commit 674c666

Browse files
committed
chore(ci): 在构建流程中添加版本文件写入步骤
- 新增Git Tag到VERSION文件的写入步骤 - 从GITHUB_REF环境变量提取版本标签 - 在Go二进制构建前执行,为后续构建提供版本信息支持 主要改进CI构建流程的版本管理能力,通过自动生成VERSION文件提升构建产物的版本追踪能力。
1 parent 9b48da5 commit 674c666

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ jobs:
7575
name: frontend-dist
7676
path: static/
7777

78+
- name: Write version to VERSION file
79+
run: |
80+
TAG_NAME=${GITHUB_REF#refs/tags/}
81+
echo "$TAG_NAME" > VERSION
82+
echo "Written version $TAG_NAME to VERSION file"
83+
7884
- name: Build Go binaries
7985
run: |
8086
mkdir -p build

0 commit comments

Comments
 (0)