release-tag.yml 2.2 KB

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