-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (35 loc) · 1.08 KB
/
publish-release.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
name: Publish Release
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
registry-url: https://registry.npmjs.org/
- name: Install lib dependencies
run: npm install
- name: Serve test server
run: npx nx serve-test halstack-react-hal
- name: Test lib
run: npx nx test halstack-react-hal
- name: Stop json-server
run: kill $(lsof -t -i:3000)
- name: Build library
run: npx nx build halstack-react-hal
- name: Copy README
run: npx nx run copy
- name: Publish RELEASE to npm
run: |
sed -i "s#\"version\": \"0.0.0\"#\"version\": \"${TAG_NAME}\"#" ./lib/dist/package.json
cd lib/dist
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
TAG_NAME: ${{ github.event.release.tag_name }}