From b06c9580708528a77646275f32ed3a3ba9fd236b Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 12 Jun 2024 11:37:23 +0800 Subject: [PATCH] chore: update release ci (#4632) * chore: update release ci * chore: test ci * fix: ci * fix: ci * fix: update release.sh --- .github/workflows/manual-release.yml | 8 +++++++- lerna.json | 2 +- release.sh | 18 ++++++++++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index 43e066a22b..828e8ab840 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -6,6 +6,10 @@ concurrency: on: workflow_dispatch: + inputs: + is_feat: + description: 'is feat' + type: boolean jobs: push-commit: runs-on: ubuntu-latest @@ -36,7 +40,9 @@ jobs: git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions Bot" echo "packages/pro-plugins/" >> .git/info/exclude - bash release.sh + bash release.sh $IS_FEAT + env: + IS_FEAT: ${{ inputs.is_feat && '--is-feat' || '' }} - name: push pro plugins continue-on-error: true uses: ad-m/github-push-action@master diff --git a/lerna.json b/lerna.json index 4339bd9f1b..18f08e49cc 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.1-alpha.3", + "version": "1.1.0-alpha", "npmClient": "yarn", "useWorkspaces": true, "npmClientArgs": ["--ignore-engines"], diff --git a/release.sh b/release.sh index 543592b5e5..17640555a6 100755 --- a/release.sh +++ b/release.sh @@ -1,4 +1,18 @@ -yarn version:alpha -y +current_version=$(jq -r '.version' lerna.json) +IFS='.-' read -r major minor patch label <<< "$current_version" + +if [ "$1" == '--is-feat' ]; then + new_minor=$((minor + 1)) + new_version="$major.$new_minor.0-$label" + echo $new_version; +else + new_patch=$((patch + 1)) + new_version="$major.$minor.$new_patch-$label" + echo $new_version; +fi + +lerna version $new_version --preid alpha --force-publish=* --no-git-tag-version -y + cd ./packages/pro-plugins git add . git commit -m "chore(versions): 😊 publish v$(jq -r '.version' ../../lerna.json)" @@ -11,4 +25,4 @@ git tag v$(jq -r '.version' lerna.json) yarn changelog --breaking-pattern "BREAKING CHANGE:" git add . git commit -m "chore: update changelog" -#git push --atomic origin main v$(jq -r '.version' lerna.json) +# git push --atomic origin main v$(jq -r '.version' lerna.json)