@@ -53,13 +53,21 @@ jobs:
53
53
npm publish --access public
54
54
55
55
# Publish to GitHub Packages
56
+ - name : Setup Node.js for GitHub Packages
57
+ if : startsWith(github.ref, 'refs/tags/replayer-adapter-nodejs-v')
58
+ uses : actions/setup-node@v4
59
+ with :
60
+ node-version : ' 18'
61
+ registry-url : ' https://npm.pkg.github.com'
62
+ scope : ' @phuongdnguyen'
63
+
56
64
- name : Publish to GitHub Packages
57
65
if : startsWith(github.ref, 'refs/tags/replayer-adapter-nodejs-v')
58
66
run : |
59
67
cd replayer-adapter-nodejs
60
- echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc
61
- echo "@phuongdnguyen:registry=https://npm.pkg.github.com" >> .npmrc
62
68
npm publish
69
+ env :
70
+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
63
71
64
72
# Manual publish to both registries
65
73
- name : Manual publish to NPM Registry
@@ -72,16 +80,24 @@ jobs:
72
80
fi
73
81
npm publish --access public
74
82
83
+ - name : Setup Node.js for GitHub Packages (Manual)
84
+ if : github.event_name == 'workflow_dispatch'
85
+ uses : actions/setup-node@v4
86
+ with :
87
+ node-version : ' 18'
88
+ registry-url : ' https://npm.pkg.github.com'
89
+ scope : ' @phuongdnguyen'
90
+
75
91
- name : Manual publish to GitHub Packages
76
92
if : github.event_name == 'workflow_dispatch'
77
93
run : |
78
94
cd replayer-adapter-nodejs
79
- echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc
80
- echo "@phuongdnguyen:registry=https://npm.pkg.github.com" >> .npmrc
81
95
if [ -n "${{ github.event.inputs.version }}" ]; then
82
96
npm version ${{ github.event.inputs.version }} --no-git-tag-version
83
97
fi
84
98
npm publish
99
+ env :
100
+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
85
101
86
102
- name : Create GitHub Release
87
103
if : startsWith(github.ref, 'refs/tags/replayer-adapter-nodejs-v')
0 commit comments