Skip to content

Commit

Permalink
ci: publish npm package using github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
samshara committed Apr 27, 2023
1 parent 2174954 commit a9c9d6c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

version: 2
updates:
- package-ecosystem: "yarn"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish

on:
release:
types: [publised]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn build

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: yarn build
- run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ npm install ifrc-go-icons

Each icon can be imported as a react component.
```js
import { MenuLineIcon } from 'ifrc-go-icons';
import { MenuLineIcon } from '@ifrc-go/icons';

function MyComponent() {
return (
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ifrc-go-icons",
"name": "@ifrc-go/icons",
"version": "1.0.0",
"description": "IFRC-GO icons library for React.",
"keywords": [
Expand Down Expand Up @@ -27,7 +27,7 @@
"types": "./dist/*.d.ts"
},
"scripts": {
"prepack": "npm run build",
"prepack": "yarn build",
"build": "rimraf ./dist && node ./scripts/build.js"
},
"peerDependencies": {
Expand Down

0 comments on commit a9c9d6c

Please sign in to comment.