Skip to content

Commit 78f517c

Browse files
authored
fix: goreleaser build without embed UI (#176)
1 parent 1ad11f3 commit 78f517c

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

.github/workflows/release.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ jobs:
3030
node-version: 18.x
3131
cache: 'npm'
3232
cache-dependency-path: console/atest-ui/package-lock.json
33-
- name: Build
34-
run: make build-embed-ui
3533
- name: Run GoReleaser
3634
uses: goreleaser/[email protected]
3735
with:

.goreleaser.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ before:
44
hooks:
55
# You may remove this if you don't use go modules.
66
- go mod tidy
7+
- make embed-ui
78
builds:
89
- env:
910
- CGO_ENABLED=0

Makefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@ build:
55
mkdir -p bin
66
rm -rf bin/atest
77
go build -o bin/atest main.go
8-
build-embed-ui:
8+
embed-ui:
99
cd console/atest-ui && npm i && npm run build-only
1010
cp console/atest-ui/dist/index.html cmd/data/index.html
1111
cp console/atest-ui/dist/assets/*.js cmd/data/index.js
1212
cp console/atest-ui/dist/assets/*.css cmd/data/index.css
13-
GOOS=${OS} go build -ldflags "-w -s -X github.com/linuxsuren/api-testing/pkg/version.version=$(shell git rev-parse --short HEAD)" -o bin/${BINARY} main.go
13+
clean-embed-ui:
1414
echo -n '' > cmd/data/index.html
1515
echo -n '' > cmd/data/index.js
1616
echo -n '' > cmd/data/index.css
17+
build-embed-ui: embed-ui
18+
GOOS=${OS} go build -ldflags "-w -s -X github.com/linuxsuren/api-testing/pkg/version.version=$(shell git rev-parse --short HEAD)" -o bin/${BINARY} main.go
19+
make clean-embed-ui
1720
build-win-embed-ui:
1821
BINARY=atest.exe OS=windows make build-embed-ui
1922
goreleaser:
2023
goreleaser build --rm-dist --snapshot
24+
make clean-embed-ui
2125
build-image:
2226
${IMG_TOOL} build -t ghcr.io/linuxsuren/api-testing:master . \
2327
--build-arg GOPROXY=https://goproxy.cn,direct \

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj
66
github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM=
77
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
88
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
9-
github.com/antonmedv/expr v1.12.1 h1:GTGrGN1kxxb+le0uQKaFRK8By4cvq1sleUCGE/U6hHg=
10-
github.com/antonmedv/expr v1.12.1/go.mod h1:FPC8iWArxls7axbVLsW+kpg1mz29A1b2M6jt+hZfDkU=
9+
github.com/antonmedv/expr v1.14.0 h1:C4BHw+0cVyKy/ndU3uqYo6TV5rCtq/SY2Wdlwanvo/Q=
10+
github.com/antonmedv/expr v1.14.0/go.mod h1:FPC8iWArxls7axbVLsW+kpg1mz29A1b2M6jt+hZfDkU=
1111
github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY=
1212
github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE=
1313
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=

0 commit comments

Comments
 (0)