diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7f8a83fe3..ca1f42dcc 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -24,6 +24,8 @@ Thank you! - [ ] Site / documentation update - [ ] Demo update - [ ] Workflow +- [ ] Chore +- [ ] Release - [ ] Other (about what?) ### 🔗 Related issue link diff --git a/.github/PULL_REQUEST_TEMPLATE/pr_cn.md b/.github/PULL_REQUEST_TEMPLATE/pr_cn.md index 029ada7ad..5e72ffc24 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pr_cn.md +++ b/.github/PULL_REQUEST_TEMPLATE/pr_cn.md @@ -22,6 +22,8 @@ - [ ] 网站/文档更新 - [ ] demo 更新 - [ ] Workflow +- [ ] 配置修改 +- [ ] 发布 - [ ] 其他 (具体是什么,请补充?) ### 🔗 相关 issue 连接 diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index a51d306ea..1ec8afe3b 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -35,33 +35,34 @@ jobs: - name: Parse semver version from branch name id: semver_parser - uses: release-kit/semver@v2 + uses: xile611/read-package-version-action@v2.1 with: - string: ${{ github.ref_name }} - pattern: '^pre-release/(.*)$' # ^v?(.*)$ by default + path: packages/vtable + semver_string: ${{ github.ref_name }} + semver_pattern: '^pre-release/(.*)$' # ^v?(.*)$ by default - name: Apply prereleaseName - run: node common/scripts/install-run-rush.js publish --apply --prerelease-name ${{ steps.semver_parser.outputs.prerelease }} --partial-prerelease + run: node common/scripts/install-run-rush.js publish --apply --prerelease-name ${{ steps.semver_parser.outputs.pre_release_name }} --partial-prerelease - name: Publish to npm env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} NPM_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - run: node common/scripts/install-run-rush.js publish --publish --include-all --tag ${{ steps.semver_parser.outputs.prerelease }} + run: node common/scripts/install-run-rush.js publish --publish --include-all --tag ${{ steps.semver_parser.outputs.pre_release_type }} - name: Update shrinkwrap run: node common/scripts/install-run-rush.js update - - name: Get package version + - name: Get npm version id: package-version - uses: culshaw/read-package-node-version-actions@v1 + uses: xile611/read-package-version-action@v2.1 with: - path: './packages/vtable' # 各项目需要修改一下 + path: packages/vtable - name: Commit & Push changes uses: actions-js/push@master with: github_token: ${{ secrets.GITHUB_TOKEN }} - message: 'build: prelease version ${{ steps.package-version.outputs.version }}' + message: 'build: prelease version ${{ steps.package-version.outputs.current_version }}' branch: ${{ github.ref_name }} author_name: ${{ github.actor }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dc585094e..98e3ec57d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,6 +35,9 @@ jobs: run: node common/scripts/install-run-rush.js install --bypass-policy - name: Build packages + run: node common/scripts/install-run-rush.js build --only tag:package + + - name: Update version run: node common/scripts/install-run-rush.js version --bump - name: Publish to npm @@ -46,35 +49,36 @@ jobs: - name: Update shrinkwrap run: node common/scripts/install-run-rush.js update - - name: Get package version + - name: Get npm version id: package-version - uses: culshaw/read-package-node-version-actions@v1 + uses: xile611/read-package-version-action@v2.1 with: - path: './packages/vtable' # 各项目修改一下 + path: packages/vtable - name: Commit & Push changes uses: actions-js/push@master with: github_token: ${{ secrets.GITHUB_TOKEN }} - message: 'build: prelease version ${{ steps.package-version.outputs.version }}' + message: 'build: prelease version ${{ steps.package-version.outputs.current_version }}' branch: ${{ github.ref_name }} - name: Create Release for Tag id: release_tag - # See more about this action: https://github.com/actions/create-release - uses: actions/create-release@v1 + uses: ncipollo/release-action@v1.12.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v${{ steps.package-version.outputs.version }} - release_name: Release v${{ steps.package-version.outputs.version }} - prerelease: false # + tag: v${{ steps.package-version.outputs.current_version }} + commit: main + prerelease: false + draft: true # - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 + uses: dustinirving/create-pr@v1.0.2 with: token: ${{ secrets.GITHUB_TOKEN }} + title: '[Auto release] release ${{ steps.package-version.outputs.current_version }}' base: main - branch: ${{ github.ref_name }} - title: '[Auto release] release ${{ steps.package-version.outputs.version }}' - author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> + head: ${{ github.ref_name }} + labels: release # default labels, the action will throw error if not specified + reviewers: fangsmile,Rui-Sun # default reviewers, the action will throw error if not specified diff --git a/common/git-hooks/pre-commit b/common/git-hooks/pre-commit index 9b7f86791..ebd177c7a 100644 --- a/common/git-hooks/pre-commit +++ b/common/git-hooks/pre-commit @@ -24,7 +24,7 @@ if [[ $STAGE_FILES != "" ]] ; then if [[ $changedFiles != "" ]] ; then echo " - [Notice]: please check, do you need to run ${RED}${BIG_FONT}rush change${RESET} to generate changelog, + [Notice]: please check, do you need to run ${RED}${BIG_FONT}rush change-all${RESET} to generate changelog, you has modified some src files, include: ${changedFiles} "