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.

107 lines
2.7 KiB

  1. ---
  2. name: "tendermint-windows"
  3. enable_cache: true
  4. distro: "ubuntu"
  5. suites:
  6. - "bionic"
  7. architectures:
  8. - "amd64"
  9. packages:
  10. - "bsdmainutils"
  11. - "build-essential"
  12. - "ca-certificates"
  13. - "curl"
  14. - "debhelper"
  15. - "dpkg-dev"
  16. - "devscripts"
  17. - "fakeroot"
  18. - "git"
  19. - "golang-any"
  20. - "xxd"
  21. - "quilt"
  22. remotes:
  23. - "url": "https://github.com/tendermint/tendermint.git"
  24. "dir": "tendermint"
  25. files:
  26. - "go1.13.3.linux-amd64.tar.gz"
  27. script: |
  28. set -e -o pipefail
  29. GO_SRC_RELEASE=go1.13.3.linux-amd64
  30. GO_SRC_TARBALL="${GO_SRC_RELEASE}.tar.gz"
  31. # Compile go and configure the environment
  32. export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
  33. export BUILD_DIR=`pwd`
  34. tar xf "${GO_SRC_TARBALL}"
  35. rm -f "${GO_SRC_TARBALL}"
  36. [ -d go/ ]
  37. export GOOS=windows
  38. export GOROOT=${BUILD_DIR}/go
  39. export GOPATH=${BUILD_DIR}/gopath
  40. mkdir -p ${GOPATH}/bin
  41. export PATH_orig=${PATH}
  42. export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
  43. export ARCHS='386 amd64'
  44. export GO111MODULE=on
  45. # Make release tarball
  46. pushd tendermint
  47. VERSION=$(git describe --tags | sed 's/^v//')
  48. COMMIT=$(git rev-parse --short=8 HEAD)
  49. DISTNAME=tendermint-${VERSION}
  50. git archive --format tar.gz --prefix ${DISTNAME}/ -o ${DISTNAME}.tar.gz HEAD
  51. SOURCEDIST=`pwd`/`echo tendermint-*.tar.gz`
  52. popd
  53. # Correct tar file order
  54. mkdir -p temp
  55. pushd temp
  56. tar xf $SOURCEDIST
  57. rm $SOURCEDIST
  58. find tendermint-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > $SOURCEDIST
  59. popd
  60. # Prepare GOPATH and install deps
  61. distsrc=${GOPATH}/src/github.com/tendermint/tendermint
  62. mkdir -p ${distsrc}
  63. pushd ${distsrc}
  64. tar --strip-components=1 -xf $SOURCEDIST
  65. go mod download
  66. popd
  67. # Configure LDFLAGS for reproducible builds
  68. LDFLAGS="-extldflags=-static -buildid=${VERSION} -s -w \
  69. -X github.com/tendermint/tendermint/version.GitCommit=${COMMIT}"
  70. # Extract release tarball and build
  71. for arch in ${ARCHS}; do
  72. INSTALLPATH=`pwd`/installed/${DISTNAME}-${arch}
  73. mkdir -p ${INSTALLPATH}
  74. # Build tendermint binary
  75. pushd ${distsrc}
  76. GOARCH=${arch} GOROOT_FINAL=${GOROOT} go build -a \
  77. -trimpath \
  78. -gcflags=all=-trimpath=${GOPATH} \
  79. -asmflags=all=-trimpath=${GOPATH} \
  80. -mod=readonly -tags "tendermint" \
  81. -ldflags="${LDFLAGS}" \
  82. -o ${INSTALLPATH}/tendermint.exe ./cmd/tendermint/
  83. popd # ${distsrc}
  84. pushd ${INSTALLPATH}
  85. find -type f | sort | tar \
  86. --no-recursion --mode='u+rw,go+r-w,a+X' \
  87. --numeric-owner --sort=name \
  88. --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-windows-${arch}.tar.gz
  89. popd # installed
  90. done
  91. rm -rf ${distsrc}
  92. mkdir -p $OUTDIR/src
  93. mv $SOURCEDIST $OUTDIR/src