Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit da9433b

Browse files
author
Developer
committed
ci: switch npm publishing to GitHub Packages
Use GITHUB_TOKEN instead of NPM_TOKEN for package publishing. Add publishConfig to package.json pointing to npm.pkg.github.com.
1 parent 28b7696 commit da9433b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ jobs:
3535
with:
3636
node-version: 20
3737
cache: "pnpm"
38-
registry-url: "https://registry.npmjs.org"
38+
registry-url: "https://npm.pkg.github.com"
39+
scope: "@etherisc"
3940

4041
- name: Install dependencies
4142
run: pnpm install
@@ -105,7 +106,7 @@ jobs:
105106
echo "Updated package.json for npm publishing:"
106107
cat package.json | jq '.name, .version, .private, .repository'
107108
108-
- name: Publish to npm
109+
- name: Publish to GitHub Packages
109110
run: |
110111
cd packages/ui-kit
111112
npm publish --access=public
@@ -114,7 +115,7 @@ jobs:
114115
mv package.json.backup package.json
115116
echo "Restored original package.json"
116117
env:
117-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
118+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118119

119120
- name: Setup Pages
120121
uses: actions/configure-pages@v4
@@ -183,7 +184,7 @@ jobs:
183184
\`\`\`
184185
185186
### 🔗 Links
186-
- **npm Package**: [npmjs.com](https://www.npmjs.com/package/@etherisc/ui-kit)
187+
- **Package**: [GitHub Packages](https://github.com/${{ github.repository }}/pkgs/npm/ui-kit)
187188
- **Demo**: [Storybook](${PAGE_URL})
188189
- **Source**: [GitHub](https://github.com/${{ github.repository }})
189190
- **Build**: \`${BUILD_HASH}\`

packages/ui-kit/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "0.8.0",
44
"type": "module",
55
"license": "Apache-2.0",
6+
"publishConfig": {
7+
"registry": "https://npm.pkg.github.com"
8+
},
69
"main": "./dist/index.cjs",
710
"module": "./dist/index.js",
811
"types": "./dist/index.d.ts",

0 commit comments

Comments
 (0)