Skip to content

Commit

Permalink
build(embed): create the github action to publish on npm
Browse files Browse the repository at this point in the history
build(embed): create the github action to publish on npm

build(embed): create the github action to publish on npm
  • Loading branch information
tericcabrel committed Aug 26, 2022
1 parent 090be5e commit 235bc37
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish-embed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Sharingan embed assets to npmjs
on:
push:
branches: [main]
paths:
- 'packages/embed/src/scripts/**'
- 'packages/embed/src/styles/**'
pull_request:
branches: [ main ]
paths:
- 'packages/embed/src/scripts/**'
- 'packages/embed/src/styles/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- name: Install projects dependencies
uses: bahmutov/npm-install@v1

- name: Publish to NPM
run: |
yarn build
cp package.publish.json build/package.json
cd build
yarn publish
working-directory: packages/embed
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion packages/embed/package.publish.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sharingan-embed",
"version": "1.0.1",
"version": "1.0.2",
"repository": "https://github.com/tericcabrel/sharingan.git",
"author": "Eric Cabrel TIOGO <[email protected]>",
"license": "MIT"
Expand Down
2 changes: 1 addition & 1 deletion packages/embed/src/scripts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const init = () => {
try {
await navigator.clipboard.writeText(rawContent);
} catch (error) {
console.warn('Copy failed:', error);
console.warn('Copy error:', error);
}
}

Expand Down

0 comments on commit 235bc37

Please sign in to comment.