You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
564 B

4 years ago
  1. workspace:
  2. base: /go
  3. matrix:
  4. GO_VERSION:
  5. - "1.11"
  6. GOOS:
  7. - linux
  8. - windows
  9. - darwin
  10. GOARCH:
  11. - amd64
  12. pipeline:
  13. build:
  14. image: golang:${GO_VERSION}
  15. pull: true
  16. environment:
  17. - CGO_ENABLED=0
  18. commands:
  19. - export FILENAME=${DRONE_REPO_NAME}-${GOOS}-${GOARCH}
  20. - if [ "$GOOS" = "windows" ]; then export FILENAME=$FILENAME.exe; fi
  21. - go build -ldflags "-s -w" -o dist/$FILENAME
  22. release:
  23. image: plugins/github-release
  24. secrets: [ github_token ]
  25. files:
  26. - dist/*
  27. when:
  28. event: tag