release-tag.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. name: Create Release Tag
  2. on:
  3. push:
  4. tags:
  5. - 'v*.*.*' # Push events to matching v*, i.e. v1.0, v20.15.10
  6. env:
  7. HUSKY: '0'
  8. permissions:
  9. pull-requests: write
  10. contents: write
  11. jobs:
  12. build:
  13. name: Create Release
  14. if: github.repository == 'vbenjs/vue-vben-admin'
  15. runs-on: ubuntu-latest
  16. strategy:
  17. matrix:
  18. node-version: [20]
  19. steps:
  20. - name: Checkout code
  21. uses: actions/checkout@v4
  22. with:
  23. fetch-depth: 0
  24. # - name: Checkout code
  25. # uses: actions/checkout@v4
  26. # with:
  27. # fetch-depth: 0
  28. # - name: Install pnpm
  29. # uses: pnpm/action-setup@v4
  30. # - name: Use Node.js ${{ matrix.node-version }}
  31. # uses: actions/setup-node@v4
  32. # with:
  33. # node-version: ${{ matrix.node-version }}
  34. # cache: "pnpm"
  35. # - name: Install dependencies
  36. # run: pnpm install --frozen-lockfile
  37. # - name: Test and Build
  38. # run: |
  39. # pnpm run test
  40. # pnpm run build
  41. - name: version
  42. id: version
  43. run: |
  44. tag=${GITHUB_REF/refs\/tags\//}
  45. version=${tag#v}
  46. major=${version%%.*}
  47. echo "tag=${tag}" >> $GITHUB_OUTPUT
  48. echo "version=${version}" >> $GITHUB_OUTPUT
  49. echo "major=${major}" >> $GITHUB_OUTPUT
  50. - uses: release-drafter/release-drafter@v6
  51. with:
  52. version: ${{ steps.version.outputs.version }}
  53. publish: true
  54. env:
  55. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  56. # - name: force update major tag
  57. # run: |
  58. # git tag v${{ steps.version.outputs.major }} ${{ steps.version.outputs.tag }} -f
  59. # git push origin refs/tags/v${{ steps.version.outputs.major }} -f
  60. # - name: Create Release for Tag
  61. # id: release_tag
  62. # uses: ncipollo/release-action@v1
  63. # with:
  64. # token: ${{ secrets.GITHUB_TOKEN }}
  65. # generateReleaseNotes: "true"
  66. # body: |
  67. # > Please refer to [CHANGELOG.md](https://github.com/vbenjs/vue-vben-admin/blob/main/CHANGELOG.md) for details.