Skip to content

Commit 8b74d1b

Browse files
authored
Create npm-publish.yml
1 parent fb2a8d0 commit 8b74d1b

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/npm-publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish package to NPM
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v1
14+
with:
15+
node-version: 12
16+
registry-url: https://registry.npmjs.org/
17+
- run: yarn
18+
- run: yarn build
19+
- run: yarn publish --access=public
20+
env:
21+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22+
notify:
23+
needs: publish
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
- run: echo ::set-env name=EMOJI_PACKAGE::$'\xf0\x9f\x93\xa6'
28+
- run: echo ::set-env name=PACKAGE_NAME::$(node -p "require('./package.json').name")
29+
- run: echo ::set-env name=PACKAGE_VERSION::$(node -p "require('./package.json').version")
30+
- run: echo ::set-env name=MESSAGE::"$EMOJI_PACKAGE [$PACKAGE_NAME](https://npmjs.com/package/$PACKAGE_NAME) $PACKAGE_VERSION was published"
31+
- run: curl -X POST ${{ secrets.CODEX_BOT_NOTIFY_EDITORJS_PUBLIC_CHAT }} -d "message=$MESSAGE" -d parse_mode=Markdown -d disable_web_page_preview=true

0 commit comments

Comments
 (0)