build-macos.bash 862 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. set -euo pipefail
  3. # Copyright (C) 2016 The Syncthing Authors.
  4. #
  5. # This Source Code Form is subject to the terms of the Mozilla Public
  6. # License, v. 2.0. If a copy of the MPL was not distributed with this file,
  7. # You can obtain one at https://mozilla.org/MPL/2.0/.
  8. # This script should be run by Jenkins as './src/github.com/syncthing/syncthing/jenkins/build-macos.bash',
  9. # that is, it should be run from $GOPATH.
  10. . src/github.com/syncthing/syncthing/jenkins/common.bash
  11. init
  12. # after init we are in the source directory
  13. clean
  14. fetchExtra
  15. build
  16. test
  17. platforms=(
  18. darwin-amd64 darwin-386
  19. )
  20. # Mac builds always require cgo
  21. export CGO_ENABLED=1
  22. echo Building
  23. for plat in "${platforms[@]}"; do
  24. echo Building "$plat"
  25. goos="${plat%-*}"
  26. goarch="${plat#*-}"
  27. go run build.go -goos "$goos" -goarch "$goarch" tar
  28. mv *.tar.gz "$WORKSPACE"
  29. echo
  30. done