File tree Expand file tree Collapse file tree 1 file changed +27
-6
lines changed Expand file tree Collapse file tree 1 file changed +27
-6
lines changed Original file line number Diff line number Diff line change 1
1
name : release
2
2
3
3
on :
4
- push :
5
- tags :
6
- - " v*"
4
+ pull_request_target :
5
+ types : [closed]
6
+ branches :
7
+ - main
7
8
8
9
# Remove default permissions of GITHUB_TOKEN for security
9
10
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
10
11
permissions : {}
11
12
12
13
jobs :
13
14
release :
14
- if : github.repository_owner == 'nuxt'
15
+ if : github.repository == 'nuxt/bridge' && github.event.pull_request.merged == true && (startsWith(github.event.pull_request.head.ref, 'v3.') || startsWith(github.event.pull_request.head.ref, 'v4.'))
16
+ concurrency :
17
+ group : release
15
18
permissions :
19
+ contents : write
16
20
id-token : write
17
21
runs-on : ubuntu-latest
18
22
timeout-minutes : 20
27
31
registry-url : " https://registry.npmjs.org/"
28
32
cache : " pnpm"
29
33
30
- - name : Install dependencies
34
+ - name : 📦 Install dependencies
31
35
run : pnpm install
32
36
33
- - name : Release
37
+ - name : 🛠 Build and release project
34
38
run : ./scripts/release.sh
39
+ env :
40
+ TAG : latest
41
+
42
+ - name : 🏷️ Create tag
43
+ env :
44
+ TAG_NAME : ${{ github.event.pull_request.head.ref }}
45
+ run : |
46
+ git tag "$TAG_NAME"
47
+ git push origin "$TAG_NAME"
48
+
49
+ - name : 🛳️ Create GitHub release
50
+ env :
51
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52
+ TAG_NAME : ${{ github.event.pull_request.head.ref }}
53
+ RELEASE_NAME : ${{ github.event.pull_request.head.ref }}
54
+ BODY : ${{ github.event.pull_request.body }}
55
+ run : gh release create "$TAG_NAME" --title "$RELEASE_NAME" --notes "$BODY"
You can’t perform that action at this time.
0 commit comments