github.com/franc20/ayesa_sap@v7.0.0-beta.28.0.20200124003224-302d4d52fa6c+incompatible/ci/cli/tasks/build-osx-binary.yml (about) 1 --- 2 platform: darwin 3 4 inputs: 5 - name: cli-ci 6 - name: cli 7 path: gopath/src/code.cloudfoundry.org/cli 8 - name: i18n-data 9 10 outputs: 11 - name: osx-compiled 12 13 run: 14 path: bash 15 args: 16 - -c 17 - | 18 set -ex 19 20 cwd=$PWD 21 export GOPATH=$PWD/gopath 22 export PATH=$GOPATH/bin:$PATH 23 export TARGET_GO_VERSION=${TARGET_GO_VERSION:-"UNSET"} 24 25 if go version | grep -v "\b$TARGET_GO_VERSION\b"; then 26 echo "ERROR: expected target go version [ $TARGET_GO_VERSION ]" 27 exit 1 28 fi 29 30 go version 31 32 mv i18n-data/i18n_resources.go $GOPATH/src/code.cloudfoundry.org/cli/i18n/resources 33 34 pushd $GOPATH/src/code.cloudfoundry.org/cli 35 BUILD_VERSION=$(cat BUILD_VERSION) 36 BUILD_SHA=$(git rev-parse --short HEAD) 37 BUILD_DATE=$(date -u +"%Y-%m-%d") 38 39 VERSION_LDFLAGS="-X code.cloudfoundry.org/cli/version.binaryVersion=${BUILD_VERSION} -X code.cloudfoundry.org/cli/version.binarySHA=${BUILD_SHA} -X code.cloudfoundry.org/cli/version.binaryBuildDate=${BUILD_DATE}" 40 41 echo "Building 64-bit Darwin" 42 GOARCH=amd64 GOOS=darwin go build -ldflags "-w -s ${VERSION_LDFLAGS}" -o out/cf-cli_osx . 43 44 echo "Creating tarball" 45 tar -cvzf $cwd/osx-compiled/cf-cli-osx-binary.tgz -C out . 46 popd