release-tag.yml 2.0 KB

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