feat(构建脚本): 添加构建脚本

This commit is contained in:
xiaoqidun 2020-09-24 01:58:17 +08:00
parent d1284d6df6
commit 609710a0eb
2 changed files with 6 additions and 6 deletions

View File

@ -4,15 +4,11 @@ type: docker
name: goenv
- name: build1
pull: if-not-exists
image: ghcr.io/xiaoqidun/build
- build -f build.sh -i goenv.go -o release/goenv
- name: build2
- name: build
pull: if-not-exists
image: xiaoqidun/goenv
- chmod +x build.sh
- ./build.sh
- name: upload
pull: if-not-exists

build.sh Normal file
View File

@ -0,0 +1,4 @@
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o release/goenv_linux_amd64 -trimpath -ldflags '-s -w' goenv.go
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o release/goenv_darwin_amd64 -trimpath -ldflags '-s -w' goenv.go
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o release/goenv_windows_amd64.exe -trimpath -ldflags '-s -w' goenv.go