Skip to content

Commit

Permalink
chore: workflow to publish to registries
Browse files Browse the repository at this point in the history
  • Loading branch information
devbabs committed Mar 23, 2024
1 parent 241662a commit 06e2498
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/publish-to-gh-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish to GitHub Packages

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install

- name: Publish to GitHub Packages
run: npm publish --registry=https://npm.pkg.github.com/devbabs
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/publish-to-npmjs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish to npm

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install

- name: Publish to npm
run: npm publish --registry=https://registry.npmjs.org/ --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
scope: '@devbabs'
- run: npm ci
- run: npm publish
env:
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"homepage": "https://github.com/devbabs/react-native-toast-alert#readme",
"publishConfig": {
"registry": "https://npm.pkg.github.com/devbabs"
"registry": "https://npm.pkg.github.com/@devbabs"
},
"devDependencies": {
"@commitlint/config-conventional": "^17.0.2",
Expand Down

0 comments on commit 06e2498

Please sign in to comment.