-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (67 loc) · 1.66 KB
/
build.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: build
on:
workflow_call:
inputs:
cache:
description: "(boolean) enable actions/cache for pnpm"
required: false
default: true
type: boolean
node_version:
description: "(string) "
required: false
default: "lts/*"
type: string
runs_on:
description: "(string) "
required: false
default: "ubuntu-latest"
type: string
pnpm_version:
description: "(string) "
required: false
default: "latest"
type: string
permissions:
contents: read
env:
default_node_version: "lts/*"
default_pnpm_version: "latest"
artifact_name: build_${{ github.sha }}
jobs:
build:
name: build
runs-on: ${{ inputs.runs_on }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: ${{ env.default_pnpm_version }}
- uses: actions/setup-node@v4
name: Setup Node without cache
if: ${{ !inputs.cache }}
with:
node-version: ${{ inputs.node_version }}
- uses: actions/setup-node@v4
name: Setup Node with cache
if: ${{ inputs.cache }}
with:
node-version: ${{ inputs.node_version }}
cache: pnpm
- name: Install Dependencies
run: pnpm i
- name: Build
run: |
pnpm run build
- name: pack
run: |
pnpm run build:ext
- uses: actions/upload-artifact@v4
with:
retention-days: 1
compression-level: 1
name: ${{ env.artifact_name }}
path: |
dist
LICENSE