Browse Source

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

main
xiaoqidun 1 year ago
parent
commit
609710a0eb
  1. 8
      .drone.yml
  2. 4
      build.sh

8
.drone.yml

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

4
build.sh

@ -0,0 +1,4 @@
#!/bin/sh
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
Loading…
Cancel
Save