From 9e7aa04edb7316281ef44e1612b3ce96ef0f582d Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 6 Aug 2024 22:24:19 +0800 Subject: [PATCH] workflow: auto create gh release tag in release --- .github/workflows/release.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index caf86b43e..823bbcd45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ on: type: string jobs: - publish: + release: # prevents this action from running on forks if: github.repository == 'vuejs/core' runs-on: ubuntu-latest @@ -45,7 +45,7 @@ jobs: ref: ${{ inputs.branch }} - name: Install pnpm - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v4 - name: Install Node.js uses: actions/setup-node@v4 @@ -62,10 +62,25 @@ jobs: git config user.name "vue-bot" git config user.email "" - - name: Release - run: pnpm release ${{ inputs.bump != 'custom' && inputs.bump || inputs.custom_version }} --skipPrompts + - name: Run release script + id: release + run: | + pnpm release ${{ inputs.bump != 'custom' && inputs.bump || inputs.custom_version }} --skipPrompts + RELEASE_TAG=$(git describe --tags --abbrev=0) + echo "tag=$RELEASE_TAG" >> $GITHUB_OUTPUT env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Push tags run: git push -u origin ${{ inputs.branch }} --follow-tags + + - name: Create Release for Tag + id: release_tag + uses: yyx990803/release-tag@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.release.outputs.tag }} + body: | + For stable releases, please refer to [CHANGELOG.md](https://github.com/vuejs/core/blob/main/CHANGELOG.md) for details. + For pre-releases, please refer to [CHANGELOG.md](https://github.com/vuejs/core/blob/minor/CHANGELOG.md) of the `minor` branch.