Skip to content

Commit

Permalink
chore: fix make tag and refine ci workflow (#1730)
Browse files Browse the repository at this point in the history
* chore: fix `make tag` command

* chore(ci): revert workflows for create pd pr
  • Loading branch information
baurine authored Aug 30, 2024
1 parent b6a69ae commit 3d0c3db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/manual-create-pd-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: '[email protected]'
required: true

jobs:
pd_pr:
Expand Down Expand Up @@ -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 "[email protected]"
git add .
if git status | grep -q "Changes to be committed"
then
Expand Down
9 changes: 5 additions & 4 deletions scripts/create_release_tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -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-<sha>-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)
Expand Down

0 comments on commit 3d0c3db

Please sign in to comment.