Skip to content

Commit

Permalink
Merge branch 'master' into minimal
Browse files Browse the repository at this point in the history
  • Loading branch information
janeczku committed Jun 6, 2016
2 parents 281b073 + 6c004b6 commit 51cd374
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.6
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"github.com/janeczku/go-dnsmasq/server"
)

// var Version string
const Version = "1.0.5"
// set at build time
var Version = "dev"

var (
nameservers = []string{}
Expand Down
10 changes: 9 additions & 1 deletion scripts/build
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash
set -e

if [ -z "$1" ]; then
echo "The version number must be passed to this script"
exit 1
fi
VERSION=$1

echo "building binary $VERSION"

BUILD_IMAGE_NAME="go-dnsmasq-build"
# GOARCH=${GOARCH:-"386 amd64 arm"}
GOOS=${GOOS:-"darwin linux"}
Expand All @@ -23,6 +31,6 @@ docker run --rm \
-os "$GOOS" \
-arch "$GOARCH" \
-output="go-dnsmasq_{{.OS}}-{{.Arch}}" \
-ldflags="-w -s" \
-ldflags "-w -s -X main.Version=$VERSION" \
-tags="netgo" \
-rebuild
10 changes: 9 additions & 1 deletion scripts/build-min
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash
set -e

if [ -z "$1" ]; then
echo "The version number must be passed to this script"
exit 1
fi
VERSION=$1

echo "building binary $VERSION"

BUILD_IMAGE_NAME="go-dnsmasq-build"
GOOS=${GOOS:-"darwin linux"}
# GOARCH=${GOARCH:-"386 amd64 arm"}
Expand All @@ -23,7 +31,7 @@ docker run --rm \
-os "$GOOS" \
-arch "$GOARCH" \
-output="go-dnsmasq-min_{{.OS}}-{{.Arch}}" \
-ldflags="-w -s" \
-ldflags "-w -s -X main.Version=$VERSION" \
-tags="netgo" \
-rebuild

Expand Down
14 changes: 7 additions & 7 deletions scripts/release
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash
set -e
if [ -z "$1" ]; then
echo "Pass the version number as the first arg. E.g.: scripts/release 1.2.3"
exit 1
fi
VERSION=$1

if [ -z "$GITHUB_TOKEN" ]; then
echo "GITHUB_TOKEN must be set for github-release"
exit 1
fi

VERSION=$(cat VERSION)

echo "making release version $VERSION"

git checkout master

git tag -f $VERSION
Expand All @@ -22,8 +22,8 @@ git push -f --tags

git checkout master

scripts/build
scripts/build-min
scripts/build $VERSION
scripts/build-min $VERSION

# UPX compression
echo "Packing binaries with UPX..."
Expand Down

0 comments on commit 51cd374

Please sign in to comment.