summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-08 08:34:47 +0000
committerGitHub <[email protected]>2020-12-08 08:34:47 +0000
commita60d0523c1afb6c1983b522d1477b8ef319d5b99 (patch)
tree8b268a842014cff3431e898e4b7f3e267ee7cd81 /build.sh
parentb22078ce707d21ac17ea1727a4174c44ef57ae69 (diff)
parentd410a76d7ccef826fc5b1921314f88a902f1d10c (diff)
Merge #433
433: Releases and binaries build automation r=48d90782 a=tarampampam This PR contains: - [x] CI steps for automatic release distributive creation and uploading to github release - [x] CI step for automatic docker image creation (on GitHub side, not `hub.docker.com`) - [x] `build.sh` script removal - [x] Binary file building in `Dockerfile` using `go build` (not `build.sh`) - [x] Docker labels with app version and build time - [x] `Makefile` cleaning - [x] `./bin/rr` now do not depends from `build.sh` file and use [`composer/package-versions-deprecated`](https://github.com/composer/package-versions-deprecated) package for "self version reading" > :warning: Steps, that must be done before merging described [here](https://github.com/spiral/roadrunner/pull/433#issuecomment-740426206) Closes #431 Co-authored-by: paramtamtam <[email protected]> Co-authored-by: Paramtamtam <[email protected]>
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh71
1 files changed, 0 insertions, 71 deletions
diff --git a/build.sh b/build.sh
deleted file mode 100755
index 64411dba..00000000
--- a/build.sh
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/bash
-cd $(dirname "${BASH_SOURCE[0]}")
-OD="$(pwd)"
-
-# Pushes application version into the build information.
-RR_VERSION=1.9.0
-
-# Hardcode some values to the core package
-LDFLAGS="$LDFLAGS -X github.com/spiral/roadrunner/cmd/rr/cmd.Version=${RR_VERSION}"
-LDFLAGS="$LDFLAGS -X github.com/spiral/roadrunner/cmd/rr/cmd.BuildTime=$(date +%FT%T%z)"
-# remove debug info from binary as well as string and symbol tables
-LDFLAGS="$LDFLAGS -s"
-
-build() {
- echo Packaging "$1" Build
- bdir=roadrunner-${RR_VERSION}-$2-$3
- rm -rf builds/"$bdir" && mkdir -p builds/"$bdir"
- GOOS=$2 GOARCH=$3 ./build.sh
-
- if [ "$2" == "windows" ]; then
- mv rr builds/"$bdir"/rr.exe
- else
- mv rr builds/"$bdir"
- fi
-
- cp README.md builds/"$bdir"
- cp CHANGELOG.md builds/"$bdir"
- cp LICENSE builds/"$bdir"
- cd builds
-
- if [ "$2" == "linux" ]; then
- tar -zcf "$bdir".tar.gz "$bdir"
- else
- zip -r -q "$bdir".zip "$bdir"
- fi
-
- rm -rf "$bdir"
- cd ..
-}
-
-# For musl build you should have musl-gcc installed. If not, please, use:
-# go build -a -ldflags "-linkmode external -extldflags '-static' -s"
-build_musl() {
- echo Packaging "$2" Build
- bdir=roadrunner-${RR_VERSION}-$1-$2-$3
- rm -rf builds/"$bdir" && mkdir -p builds/"$bdir"
- CC=musl-gcc GOARCH=amd64 go build -trimpath -ldflags "$LDFLAGS" -o "$OD/rr" cmd/rr/main.go
-
- mv rr builds/"$bdir"
-
- cp README.md builds/"$bdir"
- cp CHANGELOG.md builds/"$bdir"
- cp LICENSE builds/"$bdir"
- cd builds
- zip -r -q "$bdir".zip "$bdir"
-
- rm -rf "$bdir"
- cd ..
-}
-
-if [ "$1" == "all" ]; then
- rm -rf builds/
- build "Windows" "windows" "amd64"
- build "Mac" "darwin" "amd64"
- build "Linux" "linux" "amd64"
- build "FreeBSD" "freebsd" "amd64"
- build_musl "unknown" "musl" "amd64"
- exit
-fi
-
-CGO_ENABLED=0 go build -trimpath -ldflags "$LDFLAGS" -o "$OD/rr" cmd/rr/main.go