diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3803dc6..59e8477 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.ROBOT_PACKAGE_WRITER }} - run: npm run lint - publish: + publish_to_github: if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest needs: @@ -50,10 +50,37 @@ jobs: run: npm install - name: Build run: npm run build + - name: Publish package + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish_to_npm: + # if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + needs: + - build_and_lint + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: "https://registry.npmjs.org" + cache: npm + - name: restore_cache + uses: actions/cache@v3 + with: + key: npm-v1-{{ hashFiles(".nvmrc") }}-{{ hashFiles("package-lock.json") }} + restore-keys: npm-v1-{{ hashFiles(".nvmrc") }} + path: node_modules + - name: Install Dependencies + run: npm install + - name: Build + run: npm run build - name: Publish package run: npm publish --access=public env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} storybook_publish: if: github.ref == 'refs/heads/master' diff --git a/package.json b/package.json index 0441f38..37e8155 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,6 @@ "README.md", "LICENSE" ], - "publishConfig": { - "registry": "https://npm.pkg.github.com/gocardless" - }, "scripts": { "build": "rm -rf dist && rollup -c", "lint": "eslint '{src,examples}/**/*.{ts,tsx,js,jsx}' --ignore-path .gitignore",