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.

106 lines
2.6 KiB

  1. ---
  2. name: "tendermint-linux"
  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 GOROOT=${BUILD_DIR}/go
  38. export GOPATH=${BUILD_DIR}/gopath
  39. mkdir -p ${GOPATH}/bin
  40. export PATH_orig=${PATH}
  41. export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
  42. export ARCHS='386 amd64 arm arm64'
  43. export GO111MODULE=on
  44. # Make release tarball
  45. pushd tendermint
  46. VERSION=$(git describe --tags | sed 's/^v//')
  47. COMMIT=$(git rev-parse --short=8 HEAD)
  48. DISTNAME=tendermint-${VERSION}
  49. git archive --format tar.gz --prefix ${DISTNAME}/ -o ${DISTNAME}.tar.gz HEAD
  50. SOURCEDIST=`pwd`/`echo tendermint-*.tar.gz`
  51. popd
  52. # Correct tar file order
  53. mkdir -p temp
  54. pushd temp
  55. tar xf $SOURCEDIST
  56. rm $SOURCEDIST
  57. find tendermint-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > $SOURCEDIST
  58. popd
  59. # Prepare GOPATH and install deps
  60. distsrc=${GOPATH}/src/github.com/tendermint/tendermint
  61. mkdir -p ${distsrc}
  62. pushd ${distsrc}
  63. tar --strip-components=1 -xf $SOURCEDIST
  64. go mod download
  65. popd
  66. # Configure LDFLAGS for reproducible builds
  67. LDFLAGS="-extldflags=-static -buildid=${VERSION} -s -w \
  68. -X github.com/tendermint/tendermint/version.GitCommit=${COMMIT}"
  69. # Extract release tarball and build
  70. for arch in ${ARCHS}; do
  71. INSTALLPATH=`pwd`/installed/${DISTNAME}-${arch}
  72. mkdir -p ${INSTALLPATH}
  73. # Build tendermint binary
  74. pushd ${distsrc}
  75. GOARCH=${arch} GOROOT_FINAL=${GOROOT} go build -a \
  76. -trimpath \
  77. -gcflags=all=-trimpath=${GOPATH} \
  78. -asmflags=all=-trimpath=${GOPATH} \
  79. -mod=readonly -tags "tendermint" \
  80. -ldflags="${LDFLAGS}" \
  81. -o ${INSTALLPATH}/tendermint ./cmd/tendermint/
  82. popd # ${distsrc}
  83. pushd ${INSTALLPATH}
  84. find -type f | sort | tar \
  85. --no-recursion --mode='u+rw,go+r-w,a+X' \
  86. --numeric-owner --sort=name \
  87. --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-linux-${arch}.tar.gz
  88. popd # installed
  89. done
  90. rm -rf ${distsrc}
  91. mkdir -p $OUTDIR/src
  92. mv $SOURCEDIST $OUTDIR/src