File tree Expand file tree Collapse file tree 1 file changed +23
-6
lines changed
Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Original file line number Diff line number Diff line change 11name : release
22
33on :
4- push :
5- tags :
6- - " v*"
4+ pull_request_target :
5+ types : [closed]
6+ branches :
7+ - main
8+ - 3.x
79
810# Remove default permissions of GITHUB_TOKEN for security
911# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
1012permissions : {}
1113
1214jobs :
1315 release :
14- if : github.repository == 'nuxt/nuxt' && (startsWith(github.event.head_commit.message , 'v3.') || startsWith(github.event.head_commit.message , 'v4.'))
16+ if : github.repository == 'nuxt/nuxt' && github.event.pull_request.merged == true && (startsWith(github.event.pull_request.head.ref , 'v3.') || startsWith(github.event.pull_request.head.ref , 'v4.'))
1517 concurrency :
1618 group : release
1719 permissions :
20+ contents : write
1821 id-token : write
1922 runs-on : ubuntu-latest
2023 timeout-minutes : 20
@@ -29,14 +32,28 @@ jobs:
2932 registry-url : " https://registry.npmjs.org/"
3033 cache : " pnpm"
3134
32- - name : Install dependencies
35+ - name : 📦 Install dependencies
3336 run : pnpm install
3437
3538 - name : Build (stub)
3639 run : pnpm dev:prepare
3740
38- - name : Release
41+ - name : 🛠 Build and release project
3942 run : ./scripts/release.sh
4043 env :
4144 NODE_AUTH_TOKEN : ${{secrets.RELEASE_NODE_AUTH_TOKEN}}
4245 NPM_CONFIG_PROVENANCE : true
46+
47+ - name : 🏷️ Create tag
48+ run : |
49+ TAG_NAME=${{ github.event.pull_request.head.ref }}
50+ git tag $TAG_NAME
51+ git push origin $TAG_NAME
52+
53+ - name : 🛳️ Create GitHub release
54+ run : gh release create $TAG_NAME --title "$RELEASE_NAME" --notes "$BODY"
55+ env :
56+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
57+ TAG_NAME : ${{ github.event.pull_request.head.ref }}
58+ RELEASE_NAME : ${{ github.event.pull_request.head.ref }}
59+ BODY : ${{ github.event.pull_request.body }}
You can’t perform that action at this time.
0 commit comments