-
Notifications
You must be signed in to change notification settings - Fork 15
49 lines (49 loc) · 1.57 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
43
44
45
46
47
48
49
name: Publish package to NPM
on:
push:
tags: ['v*.*']
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
scope: '@aws'
- run: npm ci
- name: Build mynah-ui
run: npm run build
- name: Run tests
run: npm run tests:unit && npm run tests:e2e
- name: Check lint
run: npm run lint
- name: Build demo app
run: npm run packdemo
- name: Get release info
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload demo app to assets
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./example/mynah-ui-demo.zip
asset_name: mynah-ui-demo.zip
asset_content_type: application/zip
- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Update Channels
uses: fjogeleit/http-request-action@v1
with:
url: '${{ secrets.SLACK_ENDPOINT }}'
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"version": "${{ steps.get_release.outputs.tag_name }}", "url": "${{ steps.get_release.outputs.html_url }}"}'