workflow: auto create gh release tag in release

This commit is contained in:
Evan You 2024-08-06 22:24:19 +08:00
parent a6c411371b
commit 9e7aa04edb
No known key found for this signature in database
GPG Key ID: 00E9AB7A6704CE0A
1 changed files with 19 additions and 4 deletions

View File

@ -29,7 +29,7 @@ on:
type: string type: string
jobs: jobs:
publish: release:
# prevents this action from running on forks # prevents this action from running on forks
if: github.repository == 'vuejs/core' if: github.repository == 'vuejs/core'
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -45,7 +45,7 @@ jobs:
ref: ${{ inputs.branch }} ref: ${{ inputs.branch }}
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v2 uses: pnpm/action-setup@v4
- name: Install Node.js - name: Install Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
@ -62,10 +62,25 @@ jobs:
git config user.name "vue-bot" git config user.name "vue-bot"
git config user.email "<bot@vuejs.org>" git config user.email "<bot@vuejs.org>"
- name: Release - name: Run release script
run: pnpm release ${{ inputs.bump != 'custom' && inputs.bump || inputs.custom_version }} --skipPrompts 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: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Push tags - name: Push tags
run: git push -u origin ${{ inputs.branch }} --follow-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.