-
-
Notifications
You must be signed in to change notification settings - Fork 107
55 lines (46 loc) · 1.35 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
50
51
52
53
54
55
name: Publish NPM Package
on:
push:
branches: ['dev']
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: '18.4.0'
registry-url: 'https://registry.npmjs.org'
- name: Install PNPM
uses: pnpm/action-setup@v2
with:
version: '8.6.0'
- name: Get cached dependencies
# cache is automatically saved after this job completes. jobs depending on this one will get the latest cached files
id: cache-step
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies
if: steps.cache-step.outputs.cache-hit != 'true'
run: |
echo $NODE_ENV
pnpm install --frozen-lockfile
- name: Build
run: |
echo $NODE_ENV
pnpm build:server
pnpm build:prod
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
node .github/rev-version.js
npm publish