release.yml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. name: Release
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. branch:
  6. description: 'Branch to publish'
  7. required: true
  8. default: 'main'
  9. type: choice
  10. options:
  11. - main
  12. - minor
  13. bump:
  14. description: 'Bump version'
  15. required: true
  16. default: 'patch'
  17. type: choice
  18. options:
  19. - patch
  20. - minor
  21. - prepatch
  22. - preminor
  23. - custom
  24. custom_version:
  25. description: 'Custom version'
  26. required: false
  27. default: ''
  28. type: string
  29. jobs:
  30. release:
  31. # prevents this action from running on forks
  32. if: github.repository == 'vuejs/core'
  33. runs-on: ubuntu-latest
  34. permissions:
  35. contents: write
  36. id-token: write
  37. # Use Release environment for deployment protection
  38. environment: Release
  39. steps:
  40. - name: Checkout
  41. uses: actions/checkout@v4
  42. with:
  43. ref: ${{ inputs.branch }}
  44. - name: Install pnpm
  45. uses: pnpm/action-setup@v4
  46. - name: Install Node.js
  47. uses: actions/setup-node@v4
  48. with:
  49. node-version-file: '.node-version'
  50. registry-url: 'https://registry.npmjs.org'
  51. cache: 'pnpm'
  52. - name: Install deps
  53. run: pnpm install
  54. - name: Configure git user as vue bot
  55. run: |
  56. git config user.name "vue-bot"
  57. git config user.email "<bot@vuejs.org>"
  58. - name: Import GPG key
  59. uses: crazy-max/ghaction-import-gpg@v6
  60. with:
  61. gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
  62. passphrase: ${{ secrets.GPG_PASSPHRASE }}
  63. git_user_signingkey: true
  64. git_commit_gpgsign: true
  65. - name: Run release script
  66. id: release
  67. run: |
  68. pnpm release ${{ inputs.bump != 'custom' && inputs.bump || inputs.custom_version }} --skipPrompts
  69. RELEASE_TAG=$(git describe --tags --abbrev=0)
  70. echo "tag=$RELEASE_TAG" >> $GITHUB_OUTPUT
  71. env:
  72. NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  73. - name: Push tags
  74. run: git push -u origin ${{ inputs.branch }} --follow-tags
  75. - name: Create Release for Tag
  76. id: release_tag
  77. uses: yyx990803/release-tag@master
  78. env:
  79. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  80. with:
  81. tag_name: ${{ steps.release.outputs.tag }}
  82. body: |
  83. For stable releases, please refer to [CHANGELOG.md](https://github.com/vuejs/core/blob/main/CHANGELOG.md) for details.
  84. For pre-releases, please refer to [CHANGELOG.md](https://github.com/vuejs/core/blob/minor/CHANGELOG.md) of the `minor` branch.