-
-
Notifications
You must be signed in to change notification settings - Fork 46
110 lines (93 loc) · 3.01 KB
/
build.yml
File metadata and controls
110 lines (93 loc) · 3.01 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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: PR Build
on:
pull_request:
jobs:
hister:
name: Hister binary build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Check for Go/frontend changes
id: changes
run: |
FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- '*.go' 'go.mod' 'go.sum' 'webui/**' 'package.json' 'package-lock.json')
if [ -z "$FILES" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Set up Go
if: steps.changes.outputs.skip != 'true'
uses: actions/setup-go@v6.3.0
with:
go-version: 'stable'
- name: Set up Node
if: steps.changes.outputs.skip != 'true'
uses: actions/setup-node@v6.4.0
with:
node-version: latest
- name: Build SPA
if: steps.changes.outputs.skip != 'true'
run: npm ci && sh webui/build.sh
- name: Build Go binary
if: steps.changes.outputs.skip != 'true'
run: go build ./...
website:
name: Website build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Check for website/component changes
id: changes
run: |
FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- 'webui/website/**' 'webui/components/**' 'package.json' 'package-lock.json')
if [ -z "$FILES" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Set up Node
if: steps.changes.outputs.skip != 'true'
uses: actions/setup-node@v6.4.0
with:
node-version: latest
- name: Install dependencies
if: steps.changes.outputs.skip != 'true'
run: npm ci
- name: Build website
if: steps.changes.outputs.skip != 'true'
run: npm run build -w @hister/website
ext:
name: Browser extension build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Check for ext/component changes
id: changes
run: |
FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- 'webui/ext/**' 'webui/components/**' 'package.json' 'package-lock.json')
if [ -z "$FILES" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Set up Node
if: steps.changes.outputs.skip != 'true'
uses: actions/setup-node@v6.4.0
with:
node-version: latest
- name: Install dependencies
if: steps.changes.outputs.skip != 'true'
run: npm ci
- name: Build extension
if: steps.changes.outputs.skip != 'true'
run: npm run build -w @hister/ext