release-tag.yml 2.0 KB

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