-
Notifications
You must be signed in to change notification settings - Fork 8
54 lines (54 loc) · 1.5 KB
/
npm-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
50
51
52
53
54
name: Publish Package to npmjs
on:
workflow_dispatch:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14.17.3'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install -g [email protected]
- name: Compile projects
run: |
echo "PUB_VERSION: $PUB_VERSION"
chmod +x .github/workflows/build.sh
.github/workflows/build.sh
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
PUB_VERSION: ${{ vars.PUB_VERSION }}
- name: Publish package for core
run: |
echo 'Publishing core to npmjs'
cd ./build/core
npm publish --access public
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish package for services
run: |
echo 'Published services to npmjs'
cd ./build/services
for service in `ls .`
do
cd "./$service"
npm publish --access public
cd ..
done
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish package for all
run: |
echo 'Published all to npmjs'
cd ./all
npm publish --access public
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}