-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.83 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Publish to NPM
on:
pull_request:
types:
- closed
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: 📥 Install dependencies
run: npm install
- name: 🔧 Build
run: npm run build
- name: 📦 Publish package on NPM
run: cd dist && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_ACCESS_TOKEN }}
- name: 🔔 Send Notification
env:
COMMUNITY_NOTIFICATION_CHANNEL_API_ENDPOINT:
${{ secrets.COMMUNITY_NOTIFICATION_CHANNEL_API_ENDPOINT }}
run: |
VERSION=$(jq -r '.version' dist/package.json)
VERSION_URL="https://www.npmjs.com/package/@geneui/tokens/v/$VERSION"
MESSAGE="@channel\nExciting news 🚀\n The new version [$VERSION]($VERSION_URL) of the **@geneui/tokens** is published with new features and improvements! on NPM"
curl -X POST -H "Content-Type: application/json" -d "{\"text\": \"$MESSAGE\", \"username\": \"NPM\", \"icon_url\": \"https://static-production.npmjs.com/b0f1a8318363185cc2ea6a40ac23eeb2.png\"}" $COMMUNITY_NOTIFICATION_CHANNEL_API_ENDPOINT
- name: 🚀 Run bump up commit
run: |
git config --global user.name "Hamik Hambardzumyan"
git config --global user.email "hamik.hambardzumyan@softconstruct.com"
npm run bump-up-commit