-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (39 loc) · 1.07 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
name: Publish
on:
release:
types: [ released ]
env:
NODE_VERSION: 18
jobs:
publish:
name: Publish
runs-on: ubuntu-22.04
needs: unit
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore yarn cache
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install NPM Packages
run: yarn install --immutable
- name: Install NPM credentials
run: yarn config set npmAuthToken $NPM_TOKEN --home
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH }}
- name: Build
run: yarn build
- name: Publish
run: npm publish