github.com/liamawhite/cli-with-i18n@v6.32.1-0.20171122084555-dede0a5c3448+incompatible/ci/cli/tasks/build-osx-binary.yml (about)

     1  ---
     2  platform: darwin
     3  
     4  inputs:
     5  - name: cli
     6    path: gopath/src/code.cloudfoundry.org/cli
     7  - name: i18n-data
     8  
     9  outputs:
    10  - name: osx-compiled
    11  
    12  run:
    13    path: bash
    14    args:
    15    - -c
    16    - |
    17      set -ex
    18  
    19      cwd=$PWD
    20  
    21      export GOPATH=$PWD/gopath
    22      export PATH=$GOPATH/bin:$PATH
    23  
    24      go version
    25  
    26      mv i18n-data/i18n_resources.go $GOPATH/src/code.cloudfoundry.org/cli/i18n/resources
    27  
    28      pushd $GOPATH/src/code.cloudfoundry.org/cli
    29        BUILD_VERSION=$(cat ci/VERSION)
    30        BUILD_SHA=$(git rev-parse --short HEAD)
    31        BUILD_DATE=$(date -u +"%Y-%m-%d")
    32  
    33        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}"
    34  
    35        echo "Building 64-bit Darwin"
    36        GOARCH=amd64 GOOS=darwin go build -ldflags "-w -s ${VERSION_LDFLAGS}" -o out/cf-cli_osx .
    37  
    38        echo "Creating tarball"
    39        tar -cvzf $cwd/osx-compiled/cf-cli-osx-binary.tgz -C out .
    40      popd