Release #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Branch to publish' | |
required: true | |
default: 'main' | |
type: choice | |
options: | |
- main | |
- minor | |
bump: | |
description: 'Bump version' | |
required: true | |
default: 'patch' | |
type: choice | |
options: | |
- patch | |
- minor | |
- prepatch | |
- preminor | |
- custom | |
custom_version: | |
description: 'Custom version' | |
required: false | |
default: '' | |
type: string | |
jobs: | |
publish: | |
# prevents this action from running on forks | |
if: github.repository == 'vuejs/core' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
# Use Release environment for deployment protection | |
environment: Release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.branch }} | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
registry-url: 'https://registry.npmjs.org' | |
cache: 'pnpm' | |
- name: Install deps | |
run: pnpm install | |
- name: Configure git user as vue bot | |
run: | | |
git config user.name "vue-bot" | |
git config user.email "<[email protected]>" | |
- name: Release | |
run: pnpm release ${{ inputs.bump != 'custom' && inputs.bump || inputs.custom_version }} --skipPrompts | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Push tags | |
run: git push -u origin ${{ inputs.branch }} --follow-tags |