chore: publish tag alpha support

chore: update alpha and release workflows to include version consistency checks
This commit is contained in:
Tunglies
2025-06-05 20:56:15 +08:00
parent 80f550d67e
commit 44b7af0c6e
4 changed files with 60 additions and 6 deletions

View File

@@ -5,9 +5,10 @@ on:
# ! 不再使用 workflow_dispatch 触发。
# workflow_dispatch:
push:
# ? 应当限制在 main 分支上触发发布。
# branches:
# - main
# 应当限制在 main 分支上触发发布。
branches:
- main
# 应当限制 v*.*.* 的 tag 触发发布。
tags:
- "v*.*.*"
permissions: write-all
@@ -20,8 +21,28 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
check_tag_version:
name: Check Release Tag and package.json Version Consistency
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check tag and package.json version
run: |
TAG_REF="${GITHUB_REF##*/}"
echo "Current tag: $TAG_REF"
PKG_VERSION=$(jq -r .version package.json)
echo "package.json version: $PKG_VERSION"
if [[ "$TAG_REF" != "v$PKG_VERSION" ]]; then
echo "Tag ($TAG_REF) does not match package.json version (v$PKG_VERSION)."
exit 1
fi
echo "Tag and package.json version are consistent."
release:
name: Release Build
needs: check_tag_version
strategy:
fail-fast: false
matrix: