<commit_before>platform: linux
image: docker:///cloudfoundry/cli-ci

inputs:
- name: cli
  path: gopath/src/github.com/cloudfoundry/cli

outputs:
- name: cross-compiled

run:
  path: bash
  args:
  - -c
  - |
    set -ex

    cwd=$PWD

    export GOPATH=$PWD/gopath
    export PATH=$GOPATH/bin:$PATH

    go version

    pushd $GOPATH/src/github.com/cloudfoundry/cli
      bin/replace-sha

      echo "Building 32-bit Linux"
      GOARCH=386 GOOS=linux go build -ldflags '-extldflags "-static"' -o out/cf-cli_linux_i686 ./main

      echo "Building 32-bit Windows"
      GOARCH=386 GOOS=windows go build -o out/cf-cli_win32.exe ./main

      echo "Building 64-bit Linux"
      GOARCH=amd64 GOOS=linux go build -ldflags '-extldflags "-static"' -o out/cf-cli_linux_x86-64 ./main

      echo "Building 64-bit Windows"
      GOARCH=amd64 GOOS=windows go build -o out/cf-cli_winx64.exe ./main

      echo "Creating tarball"
      tar -cvzf $cwd/cross-compiled/cf-cli-binaries.tgz -C out .
    popd<commit_msg>Use all these magic flags to build static binaries<commit_after>platform: linux
image: docker:///cloudfoundry/cli-ci

inputs:
- name: cli
  path: gopath/src/github.com/cloudfoundry/cli

outputs:
- name: cross-compiled

run:
  path: bash
  args:
  - -c
  - |
    set -ex

    cwd=$PWD

    export GOPATH=$PWD/gopath
    export PATH=$GOPATH/bin:$PATH

    go version

    pushd $GOPATH/src/github.com/cloudfoundry/cli
      bin/replace-sha

      echo "Building 32-bit Linux"
      CGO_ENABLED=0 GOARCH=386 GOOS=linux go build -a -tags netgo -installsuffix netgo -ldflags '-extldflags "-static"' -o out/cf-cli_linux_i686 ./main

      echo "Building 32-bit Windows"
      GOARCH=386 GOOS=windows go build -o out/cf-cli_win32.exe ./main

      echo "Building 64-bit Linux"
      CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -a -tags netgo -installsuffix netgo -ldflags '-extldflags "-static"' -o out/cf-cli_linux_x86-64 ./main

      echo "Building 64-bit Windows"
      GOARCH=amd64 GOOS=windows go build -o out/cf-cli_winx64.exe ./main

      echo "Creating tarball"
      tar -cvzf $cwd/cross-compiled/cf-cli-binaries.tgz -C out .
    popd
{'fraction_non_alphanumeric': 0.11468531468531469, 'fraction_numerical': 0.027972027972027972, 'mean_word_length': 2.693631669535284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5419717', 'n_tokens_mistral': 858, 'n_tokens_neox': 766, 'n_words': 195}