-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
037e4af
commit 0d541cc
Showing
7 changed files
with
54 additions
and
49 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ ! "$1" =~ ^(windows|linux)$ ]]; | ||
then echo -e "\033[1;31mUsage: build.sh <linux|windows>\033[0m"; exit 1; fi | ||
|
||
set -e; trap 'echo -e "\033[1;36m$ $BASH_COMMAND\033[0m"' debug | ||
|
||
export GOOS="$1" | ||
export GOARCH="amd64" | ||
|
||
ext=$([[ "$1" == "windows" ]] && echo ".exe" || echo "") | ||
go build -ldflags="-s -w" -o "./bin/liege$ext" ./cmd/liege.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e; trap 'echo -e "\033[1;36m$ $BASH_COMMAND\033[0m"' debug | ||
|
||
if [[ -d ./bin ]]; then rm -r ./bin; fi | ||
if [[ -d ./dist ]]; then rm -r ./dist; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
VERSION_FILE="./internal/console/console.go" | ||
|
||
set -e; trap 'echo -e "\033[1;36m$ $BASH_COMMAND\033[0m"' debug | ||
|
||
version=$(grep -m 1 -oP '(?<=Version = ")[0-9.]+(?=")' $VERSION_FILE) | ||
docker push "gaelgirodon/liege:$version" | ||
docker push "gaelgirodon/liege:latest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
VERSION_FILE="./internal/console/console.go" | ||
|
||
set -e; trap 'echo -e "\033[1;36m$ $BASH_COMMAND\033[0m"' debug | ||
|
||
version=$(grep -m 1 -oP '(?<=Version = ")[0-9.]+(?=")' $VERSION_FILE) | ||
docker build --pull -t gaelgirodon/liege . | ||
docker tag gaelgirodon/liege "gaelgirodon/liege:$version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
VERSION_FILE="./internal/console/console.go" | ||
|
||
set -e; trap '[[ ! $BASH_COMMAND =~ (read|\[\[).* ]] && echo -e "\033[1;36m$ $BASH_COMMAND\033[0m"' debug | ||
|
||
old_version=$(grep -m 1 -oP '(?<=Version = ")[0-9.]+(?=")' $VERSION_FILE) | ||
v=(${old_version//./ }) | ||
new_version="${v[0]}.$((v[1] + 1)).${v[2]}" | ||
sed -i "s/$old_version/$new_version/g" $VERSION_FILE | ||
read -rp "Update the changelog..." | ||
git add CHANGELOG.md $VERSION_FILE | ||
read -rp "Commit and tag? [Yn] " yn && [[ $yn != Y* ]] && exit 0 | ||
git commit -m "Release $new_version" | ||
git tag -a "$new_version" -m "$new_version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
go test ./... -v |