-
Notifications
You must be signed in to change notification settings - Fork 26
49 lines (39 loc) · 1.1 KB
/
release.yaml
File metadata and controls
49 lines (39 loc) · 1.1 KB
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
name: Build and Publish
on:
release:
types: [published]
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Remove pnpm-lock.yaml
run: rm -rf pnpm-lock.yaml
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Check if beta release
id: check-beta
run: |
if [[ ${{ github.ref_name }} =~ -beta ]]; then
echo "IS_BETA=true" >> $GITHUB_OUTPUT
else
echo "IS_BETA=false" >> $GITHUB_OUTPUT
fi
- name: Release beta package
if: steps.check-beta.outputs.IS_BETA == 'true'
run: pnpm run release:beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Release stable package
if: steps.check-beta.outputs.IS_BETA == 'false'
run: pnpm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}