-
Notifications
You must be signed in to change notification settings - Fork 8
47 lines (38 loc) · 939 Bytes
/
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
name: Publish to latest Tag
on:
push:
branches:
- main
- v1.x
jobs:
run-publish:
name: Run publish
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
steps:
- name: Check out git repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: "yarn"
registry-url: 'https://registry.npmjs.org'
- name: Install yarn dependencies
run: yarn install
- name: Build
run: yarn build
- name: Test
run: yarn test
- name: Publish
run: |
VERSION=$(node -p "require('./package.json').version" )
if [[ "$VERSION" =~ (rc) ]]; then
yarn publish:rc
else
yarn publish:latest
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}