From 4dd9dd0e07ba04da2e4283c7e811e4b909ecab08 Mon Sep 17 00:00:00 2001 From: Niloy Sikdar Date: Wed, 6 Jul 2022 00:01:11 +0530 Subject: [PATCH] fix(ci-cd): fix ci-cd bug with .npmrc add a .npmrc to fix the publish ci cd bug fix #33 Signed-off-by: Niloy Sikdar --- .github/workflows/main.yml | 8 +++++--- .npmrc | 2 ++ package.json | 3 --- 3 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 .npmrc diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2b92439..21f9498 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,6 +9,8 @@ on: jobs: check-and-build: runs-on: ${{ matrix.os }} + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} strategy: matrix: @@ -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 @@ -43,6 +48,3 @@ jobs: - run: yarn - run: yarn build - run: yarn release - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..a43a121 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +//registry.npmjs.org/:_authToken = ${NPM_TOKEN} +access=public \ No newline at end of file diff --git a/package.json b/package.json index 1be61c0..a395dcd 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,6 @@ "files": [ "dist" ], - "publishConfig": { - "access": "public" - }, "scripts": { "prepare": "husky install", "build": "tsc -p tsconfig.json",