fix: goreleaser build without embed UI (#176)
This commit is contained in:
parent
1ad11f38ef
commit
78f517c2cb
|
@ -30,8 +30,6 @@ jobs:
|
|||
node-version: 18.x
|
||||
cache: 'npm'
|
||||
cache-dependency-path: console/atest-ui/package-lock.json
|
||||
- name: Build
|
||||
run: make build-embed-ui
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2.9.1
|
||||
with:
|
||||
|
|
|
@ -4,6 +4,7 @@ before:
|
|||
hooks:
|
||||
# You may remove this if you don't use go modules.
|
||||
- go mod tidy
|
||||
- make embed-ui
|
||||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
|
|
8
Makefile
8
Makefile
|
@ -5,19 +5,23 @@ build:
|
|||
mkdir -p bin
|
||||
rm -rf bin/atest
|
||||
go build -o bin/atest main.go
|
||||
build-embed-ui:
|
||||
embed-ui:
|
||||
cd console/atest-ui && npm i && npm run build-only
|
||||
cp console/atest-ui/dist/index.html cmd/data/index.html
|
||||
cp console/atest-ui/dist/assets/*.js cmd/data/index.js
|
||||
cp console/atest-ui/dist/assets/*.css cmd/data/index.css
|
||||
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
|
||||
clean-embed-ui:
|
||||
echo -n '' > cmd/data/index.html
|
||||
echo -n '' > cmd/data/index.js
|
||||
echo -n '' > cmd/data/index.css
|
||||
build-embed-ui: embed-ui
|
||||
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
|
||||
make clean-embed-ui
|
||||
build-win-embed-ui:
|
||||
BINARY=atest.exe OS=windows make build-embed-ui
|
||||
goreleaser:
|
||||
goreleaser build --rm-dist --snapshot
|
||||
make clean-embed-ui
|
||||
build-image:
|
||||
${IMG_TOOL} build -t ghcr.io/linuxsuren/api-testing:master . \
|
||||
--build-arg GOPROXY=https://goproxy.cn,direct \
|
||||
|
|
4
go.sum
4
go.sum
|
@ -6,8 +6,8 @@ github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj
|
|||
github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM=
|
||||
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
|
||||
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
|
||||
github.com/antonmedv/expr v1.12.1 h1:GTGrGN1kxxb+le0uQKaFRK8By4cvq1sleUCGE/U6hHg=
|
||||
github.com/antonmedv/expr v1.12.1/go.mod h1:FPC8iWArxls7axbVLsW+kpg1mz29A1b2M6jt+hZfDkU=
|
||||
github.com/antonmedv/expr v1.14.0 h1:C4BHw+0cVyKy/ndU3uqYo6TV5rCtq/SY2Wdlwanvo/Q=
|
||||
github.com/antonmedv/expr v1.14.0/go.mod h1:FPC8iWArxls7axbVLsW+kpg1mz29A1b2M6jt+hZfDkU=
|
||||
github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY=
|
||||
github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
|
|
Loading…
Reference in New Issue