From 3d0c3db0d55c5ca01198d854d54cb97526df6a77 Mon Sep 17 00:00:00 2001 From: Sparkle <1284531+baurine@users.noreply.github.com> Date: Fri, 30 Aug 2024 16:06:00 +0800 Subject: [PATCH] chore: fix `make tag` and refine ci workflow (#1730) * chore: fix `make tag` command * chore(ci): revert workflows for create pd pr --- .github/workflows/manual-create-pd-pr.yaml | 12 ++---------- scripts/create_release_tag.js | 9 +++++---- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/manual-create-pd-pr.yaml b/.github/workflows/manual-create-pd-pr.yaml index 050d8502e..df3b71c31 100644 --- a/.github/workflows/manual-create-pd-pr.yaml +++ b/.github/workflows/manual-create-pd-pr.yaml @@ -10,14 +10,6 @@ on: description: 'PD branch, e.g. ["master", "release-7.6"]' default: '["master"]' required: true - pr_author_name: - description: 'PR author name' - default: 'baurine' - required: true - pr_author_email: - description: 'PR author email' - default: '2008.hbl@gmail.com' - required: true jobs: pd_pr: @@ -53,8 +45,8 @@ jobs: id: git_commit run: | git diff - git config user.name ${{ github.event.inputs.pr_author_name }} - git config user.email ${{ github.event.inputs.pr_author_email }} + git config user.name "baurine" + git config user.email "2008.hbl@gmail.com" git add . if git status | grep -q "Changes to be committed" then diff --git a/scripts/create_release_tag.js b/scripts/create_release_tag.js index 52dd9b5b2..c092a1a27 100644 --- a/scripts/create_release_tag.js +++ b/scripts/create_release_tag.js @@ -81,14 +81,15 @@ function createReleaseTag() { function createMasterTag() { const latestTag = getGitLatestTag(); - // the latest tag must like vX.Y.0-alpha, likes `v8.4.0-alpha` - if (!latestTag.match(/^v\d+\.\d+.0-alpha/)) { - console.error(`Err: latest tag ${latestTag} is not a valid alpha tag`) + // the latest tag must like vX.Y.0-alpha-3-g383cf602, likes `v8.4.0-alpha-3-g383cf602` + // or like vX.Y.0--3-g383cf602 + const shortSha = getGitShortSha(); + if (!latestTag.match(/^v\d+\.\d+.0-alpha/) && !latestTag.match(/^v\d+\.\d+.0-[0-9a-z]{8}/)) { + console.error(`Err: latest tag ${latestTag} is not a valid tag, please add the tag manually, currently sha is ${shortSha}, the tag should be vX.Y.Z-${shortSha}`) process.exit(1) } const splitPos = latestTag.indexOf('-'); const prefix = latestTag.substring(0, splitPos); - const shortSha = getGitShortSha(); const nextTag = `${prefix}-${shortSha}` question(nextTag)