Skip to content

Commit

Permalink
fix: publish to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Robson committed Aug 15, 2023
1 parent 2457dac commit f69a52f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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'
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f69a52f

Please sign in to comment.