Skip to content

Commit 80c3bfb

Browse files
committed
Merge branch 'master' into pk910/refactoring
2 parents 7b85738 + 1c7c3df commit 80c3bfb

File tree

3 files changed

+86
-56
lines changed

3 files changed

+86
-56
lines changed

.github/workflows/_shared-build.yaml

Lines changed: 71 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,32 @@ on:
4242

4343
# shared build jobs
4444
jobs:
45+
build_frontend:
46+
name: Build frontend
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
50+
with:
51+
ref: ${{ inputs.ref }}
52+
53+
- name: Set up Node.js
54+
uses: actions/setup-node@v4
55+
with:
56+
node-version: '20'
57+
58+
- name: Build frontend
59+
run: make ui
60+
61+
# upload artifacts
62+
- name: "Upload artifact: frontend"
63+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
64+
with:
65+
path: ./pkg/web/static/
66+
name: frontend
67+
4568
build_linux_amd64_binary:
4669
name: Build linux/amd64 binary
70+
needs: [build_frontend]
4771
runs-on: ubuntu-latest
4872
steps:
4973
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
@@ -55,12 +79,13 @@ jobs:
5579
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
5680
with:
5781
go-version: 1.25.x
58-
- name: Set up Node.js
59-
uses: actions/setup-node@v4
82+
83+
# download frontend artifacts
84+
- name: Download frontend artifacts
85+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
6086
with:
61-
node-version: '20'
62-
cache: 'npm'
63-
cache-dependency-path: web-ui/package-lock.json
87+
name: frontend
88+
path: ./pkg/web/static
6489

6590
# setup project dependencies
6691
- name: Get dependencies
@@ -71,7 +96,6 @@ jobs:
7196
- name: Build linux amd64 binary
7297
run: |
7398
make docs
74-
make ui
7599
make build
76100
env:
77101
RELEASE: ${{ inputs.release }}
@@ -82,10 +106,11 @@ jobs:
82106
with:
83107
path: ./bin/*
84108
name: assertoor_linux_amd64
85-
109+
86110
build_linux_arm64_binary:
87111
name: Build linux/arm64 binary
88-
runs-on: ubuntu-latest
112+
needs: [build_frontend]
113+
runs-on: ubuntu-24.04-arm
89114
steps:
90115
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
91116
with:
@@ -96,18 +121,13 @@ jobs:
96121
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
97122
with:
98123
go-version: 1.25.x
99-
- name: Set up Node.js
100-
uses: actions/setup-node@v4
101-
with:
102-
node-version: '20'
103-
cache: 'npm'
104-
cache-dependency-path: web-ui/package-lock.json
105124

106-
# setup cross build libs
107-
- name: Get cross build dependencies
108-
run: |
109-
sudo apt-get update
110-
sudo apt-get -y install gcc-aarch64-linux-gnu libstdc++-11-dev-arm64-cross libstdc++-12-dev-arm64-cross
125+
# download frontend artifacts
126+
- name: Download frontend artifacts
127+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
128+
with:
129+
name: frontend
130+
path: ./pkg/web/static
111131

112132
# setup project dependencies
113133
- name: Get dependencies
@@ -118,8 +138,7 @@ jobs:
118138
- name: Build linux arm64 binary
119139
run: |
120140
make docs
121-
make ui
122-
make build GOARCH=arm64 CC=/usr/bin/aarch64-linux-gnu-gcc
141+
make build
123142
env:
124143
RELEASE: ${{ inputs.release }}
125144

@@ -132,6 +151,7 @@ jobs:
132151

133152
build_windows_binary:
134153
name: Build windows/amd64 binary
154+
needs: [build_frontend]
135155
runs-on: windows-latest
136156
steps:
137157
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
@@ -143,12 +163,13 @@ jobs:
143163
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
144164
with:
145165
go-version: 1.25.x
146-
- name: Set up Node.js
147-
uses: actions/setup-node@v4
166+
167+
# download frontend artifacts
168+
- name: Download frontend artifacts
169+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
148170
with:
149-
node-version: '20'
150-
cache: 'npm'
151-
cache-dependency-path: web-ui/package-lock.json
171+
name: frontend
172+
path: ./pkg/web/static
152173

153174
# setup project dependencies
154175
- name: Get dependencies
@@ -159,7 +180,6 @@ jobs:
159180
- name: Build windows binary
160181
run: |
161182
make docs
162-
make ui
163183
make build
164184
env:
165185
RELEASE: ${{ inputs.release }}
@@ -173,7 +193,8 @@ jobs:
173193

174194
build_darwin_amd64_binary:
175195
name: Build macos/amd64 binary
176-
runs-on: macos-latest
196+
needs: [build_frontend]
197+
runs-on: macos-15-intel
177198
steps:
178199
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
179200
with:
@@ -184,12 +205,13 @@ jobs:
184205
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
185206
with:
186207
go-version: 1.25.x
187-
- name: Set up Node.js
188-
uses: actions/setup-node@v4
208+
209+
# download frontend artifacts
210+
- name: Download frontend artifacts
211+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
189212
with:
190-
node-version: '20'
191-
cache: 'npm'
192-
cache-dependency-path: web-ui/package-lock.json
213+
name: frontend
214+
path: ./pkg/web/static
193215

194216
# setup project dependencies
195217
- name: Get dependencies
@@ -200,7 +222,6 @@ jobs:
200222
- name: Build macos amd64 binary
201223
run: |
202224
make docs
203-
make ui
204225
make build
205226
env:
206227
RELEASE: ${{ inputs.release }}
@@ -214,7 +235,8 @@ jobs:
214235

215236
build_darwin_arm64_binary:
216237
name: Build macos/arm64 binary
217-
runs-on: macos-latest
238+
needs: [build_frontend]
239+
runs-on: macos-26
218240
steps:
219241
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
220242
with:
@@ -225,12 +247,13 @@ jobs:
225247
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
226248
with:
227249
go-version: 1.25.x
228-
- name: Set up Node.js
229-
uses: actions/setup-node@v4
250+
251+
# download frontend artifacts
252+
- name: Download frontend artifacts
253+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
230254
with:
231-
node-version: '20'
232-
cache: 'npm'
233-
cache-dependency-path: web-ui/package-lock.json
255+
name: frontend
256+
path: ./pkg/web/static
234257

235258
# setup project dependencies
236259
- name: Get dependencies
@@ -241,8 +264,7 @@ jobs:
241264
- name: Build macos arm64 binary
242265
run: |
243266
make docs
244-
make ui
245-
make build GOARCH=arm64
267+
make build
246268
env:
247269
RELEASE: ${{ inputs.release }}
248270

@@ -288,7 +310,7 @@ jobs:
288310
run: |
289311
chmod +x ./bin/*
290312
ls -lach ./bin
291-
313+
292314
# build amd64 image
293315
- name: Build amd64 docker image
294316
run: |
@@ -300,12 +322,12 @@ jobs:
300322
run: |
301323
docker push ${{ inputs.docker_repository }}:${{ inputs.docker_tag_prefix }}-amd64
302324
docker push ${{ inputs.docker_repository }}:${{ inputs.docker_tag_prefix }}-${{ steps.vars.outputs.sha_short }}-amd64
303-
325+
304326
build_arm64_docker_image:
305327
name: Build arm64 docker image
306328
needs: [build_linux_arm64_binary]
307329
if: ${{ inputs.docker }}
308-
runs-on: ubuntu-latest
330+
runs-on: ubuntu-24.04-arm
309331
steps:
310332
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
311333
with:
@@ -315,8 +337,6 @@ jobs:
315337
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
316338

317339
# prepare docker
318-
- name: Set up Docker QEMU
319-
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
320340
- name: Set up Docker Buildx
321341
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
322342
- name: Login to Docker Hub
@@ -337,7 +357,7 @@ jobs:
337357
run: |
338358
chmod +x ./bin/*
339359
ls -lach ./bin
340-
360+
341361
# build arm64 image
342362
- name: Build arm64 docker image
343363
run: |
@@ -371,7 +391,7 @@ jobs:
371391
with:
372392
username: ${{ secrets.DOCKERHUB_USERNAME }}
373393
password: ${{ secrets.DOCKERHUB_TOKEN }}
374-
394+
375395
# build multiarch image
376396
- name: Build multiarch docker manifest
377397
run: |
@@ -406,7 +426,7 @@ jobs:
406426
with:
407427
username: ${{ secrets.DOCKERHUB_USERNAME }}
408428
password: ${{ secrets.DOCKERHUB_TOKEN }}
409-
429+
410430
# build multiarch image
411431
- name: "Build additional docker manifest: ${{ matrix.tag }}"
412432
run: |
@@ -424,4 +444,4 @@ jobs:
424444
run: |
425445
docker manifest push ${{ inputs.docker_repository }}:${{ matrix.tag }}-amd64
426446
docker manifest push ${{ inputs.docker_repository }}:${{ matrix.tag }}-arm64
427-
docker manifest push ${{ inputs.docker_repository }}:${{ matrix.tag }}
447+
docker manifest push ${{ inputs.docker_repository }}:${{ matrix.tag }}

.github/workflows/_shared-check.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
name: Reusable check workflow
33
on:
44
workflow_call:
5+
inputs:
6+
ref:
7+
description: 'The branch, tag or SHA to check'
8+
default: ''
9+
required: false
10+
type: string
511

612
# shared check jobs
713
jobs:
@@ -10,13 +16,15 @@ jobs:
1016
runs-on: ubuntu-latest
1117
steps:
1218
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
19+
with:
20+
ref: ${{ inputs.ref }}
1321

1422
# setup global dependencies
1523
- name: Set up go
1624
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
1725
with:
1826
go-version: 1.25.x
19-
27+
2028
- name: Verify dependencies
2129
run: go mod verify
2230

@@ -78,13 +86,13 @@ jobs:
7886
runs-on: ubuntu-latest
7987
steps:
8088
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
89+
with:
90+
ref: ${{ inputs.ref }}
8191

8292
- name: Set up Node.js
8393
uses: actions/setup-node@v4
8494
with:
85-
node-version: '20'
86-
cache: 'npm'
87-
cache-dependency-path: web-ui/package-lock.json
95+
node-version: '22'
8896

8997
- name: Install dependencies
9098
run: cd web-ui && npm ci
@@ -93,4 +101,4 @@ jobs:
93101
run: cd web-ui && npm run lint
94102

95103
- name: Run type check
96-
run: cd web-ui && npm run typecheck
104+
run: cd web-ui && npm run typecheck

.github/workflows/build-dev.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ jobs:
6666
needs: [prinfo]
6767
if: ${{ needs.prinfo.outputs.run_builds == 'true' }}
6868
uses: ./.github/workflows/_shared-check.yaml
69+
with:
70+
ref: ${{ needs.prinfo.outputs.commit_ref }}
6971

7072
build_binaries:
7173
name: "Build Assertoor"

0 commit comments

Comments
 (0)