Skip to content

Commit

Permalink
fix(ci-cd): fix ci-cd bug with .npmrc (#56)
Browse files Browse the repository at this point in the history
Add a `.npmrc` to fix the publish CI/CD bug

Setting access token for publishing. 

Resolves #33

Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>
  • Loading branch information
niloysikdar committed Jul 5, 2022
1 parent 7633168 commit 015e93a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
jobs:
check-and-build:
runs-on: ${{ matrix.os }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

strategy:
matrix:
Expand All @@ -33,6 +35,9 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs: [check-and-build]
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
Expand All @@ -43,6 +48,3 @@ jobs:
- run: yarn
- run: yarn build
- run: yarn release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//registry.npmjs.org/:_authToken = ${NPM_TOKEN}
access=public
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"prepare": "husky install",
"build": "tsc -p tsconfig.json",
Expand Down

0 comments on commit 015e93a

Please sign in to comment.