-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (72 loc) · 2.07 KB
/
release-package-dev.yaml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Release Package Dev
on: workflow_dispatch
jobs:
install_dependencies:
name: Install Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: Install dependencies by lockfile
run: npm clean-install
- name: Generate Public API
run: npm run barrel
- name: Share prepared workspace with other jobs
uses: actions/cache@v3
with:
key: "workspace:${{github.sha}}"
path: ./
static_files:
name: Build Static Files
runs-on: ubuntu-latest
needs: [ install_dependencies ]
steps:
- name: Download prepared workspace
uses: actions/cache@v3
with:
key: "workspace:${{github.sha}}"
path: ./
- name: Build static files
run: npm run build
- name: Share prepared dist with other jobs
uses: actions/cache@v3
with:
key: "dist:${{github.sha}}"
path: ./dist
publish:
name: Run publish
runs-on: ubuntu-latest
needs: [ static_files ]
steps:
- name: Download prepared workspace
uses: actions/cache@v3
with:
key: "workspace:${{github.sha}}"
path: ./
- name: Download prepared dist
uses: actions/cache@v3
with:
key: "dist:${{github.sha}}"
path: ./dist
- name: Use Node.js
uses: actions/setup-node@v3
with:
always-auth: true
node-version: 18
- name: 'Authorize to NPM Registry'
run: echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_DEPLOY_TOKEN}}" >> dist/.npmrc
- name: Do prepublish
run: |
export VERSION=$(git describe --abbrev=0 --tags)
npm run build:prepublish
env:
GIT_COMMIT_HASH: ${{github.sha}}
IS_DEV_PUBLISH: true
- name: Publish
run: cd dist && npm publish --access public --tag dev