更新滚动版本逻辑,生产版本采用CI进行自动管理

This commit is contained in:
yyhuni
2025-12-17 08:49:55 +08:00
parent 63e72b8427
commit b838356550
2 changed files with 29 additions and 3 deletions

View File

@@ -99,3 +99,29 @@ jobs:
${{ steps.version.outputs.IS_RELEASE == 'true' && format('{0}/{1}:latest', env.IMAGE_PREFIX, matrix.image) || '' }}
cache-from: type=gha
cache-to: type=gha,mode=max
# 所有镜像构建成功后,更新 VERSION 文件
update-version:
runs-on: ubuntu-latest
needs: build # 等待所有 build job 完成
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update VERSION file
run: |
VERSION="${GITHUB_REF#refs/tags/}"
echo "$VERSION" > VERSION
echo "Updated VERSION to $VERSION"
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add VERSION
git diff --staged --quiet || git commit -m "chore: bump version to ${GITHUB_REF#refs/tags/}"
git push