Skip to content

Commit

Permalink
fix: npm token
Browse files Browse the repository at this point in the history
  • Loading branch information
shuta13 committed Apr 18, 2024
1 parent 7c5b3eb commit a9f0c35
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

jobs:
publish:
Expand Down Expand Up @@ -38,10 +39,14 @@ jobs:
npm run install:go
- name: Build
run: npm run build
- name: Create .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
- name: Publish
uses: changesets/action@v1
with:
version: ${{ github.event.inputs.tag }}
publish: npm run release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
version: npm run publish:version -- --snapshot ${{ github.event.inputs.tag }}
commit: "chore: release"
publish: npm run publish:release
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"format:ts": "run-s format:prettier format:eslint",
"format:prettier": "prettier --write \"**/*.{ts,js,json,md}\"",
"format:eslint": "eslint --fix \"**/*.{ts,js}\"",
"release": "changeset publish"
"publish:version": "changeset version",
"publish:release": "changeset publish"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
Expand Down

0 comments on commit a9f0c35

Please sign in to comment.