This repository has been archived by the owner on Jun 27, 2020. It is now read-only.
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
Showing
15 changed files
with
10,959 additions
and
189 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,5 +1,2 @@ | ||
build | ||
build/** | ||
.vscode | ||
.vscode/** | ||
bindata_assetfs.go | ||
.vscode |
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,19 @@ | ||
language: go | ||
go: | ||
- 1.8.3 | ||
|
||
script: | ||
- make clean | ||
- make build-deps | ||
- make deps | ||
- make generate | ||
- make test | ||
- make build | ||
|
||
deploy: | ||
provider: script | ||
script: /bin/bash $TRAVIS_BUILD_DIR/release.sh | ||
skip_cleanup: true | ||
on: | ||
tags: true | ||
branch: master |
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,32 @@ | ||
.PHONY: default | ||
default: clean build-deps deps generate test build | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf build BookBrowser | ||
|
||
.PHONY: build-deps | ||
build-deps: | ||
go get -v "github.com/kardianos/govendor" | ||
go get -v "github.com/aktau/github-release" | ||
|
||
.PHONY: deps | ||
deps: | ||
govendor sync | ||
|
||
.PHONY: generate | ||
generate: | ||
go generate | ||
|
||
.PHONY: test | ||
test: | ||
go test -v . | ||
|
||
.PHONY: build | ||
build: | ||
mkdir -p build | ||
go build -ldflags "-X main.curversion=dev" -o "build/BookBrowser" | ||
|
||
.PHONY: install | ||
install: | ||
go install |
Large diffs are not rendered by default.
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
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,75 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
command -v github-release >/dev/null 2>&1 || { echo >&2 "Please install github-release."; exit 1; } | ||
|
||
if [[ -z "$GITHUB_TOKEN" ]]; then | ||
if [[ "$SKIP_UPLOAD" != "true" ]]; then | ||
echo "Github token not set" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
rm -rf build | ||
mkdir -p build | ||
|
||
if [[ -z "$(git describe --abbrev=0 --tags 2>/dev/null)" ]]; then | ||
echo "No tags found" | ||
export NO_TAGS=true | ||
export APP_VERSION=v0.0.1 | ||
else | ||
export NO_TAGS=false | ||
export APP_VERSION="$(git name-rev --name-only --tags HEAD | sed "s/undefined/$(git describe --abbrev=0 --tags)+$(git rev-parse --short HEAD)-dev/")" | ||
fi | ||
|
||
echo "APP_VERSION: $APP_VERSION" | ||
|
||
echo "## Changes for $APP_VERSION" | tee -a build/release-notes.md | ||
if [[ "$NO_TAGS" == "true" ]]; then | ||
echo "$(git log --oneline)" | tee -a build/release-notes.md | ||
else | ||
echo "$(git log $(git describe --tags --abbrev=0 HEAD^)..HEAD --oneline)" | tee -a build/release-notes.md | ||
fi | ||
echo "## Usage" | tee -a build/release-notes.md | ||
echo "1. Download the binary for your platform below" | tee -a build/release-notes.md | ||
echo "2. Copy it to the directory with your books" | tee -a build/release-notes.md | ||
echo "3. Run it" | tee -a build/release-notes.md | ||
|
||
for GOOS in linux windows darwin; do | ||
for GOARCH in amd64 386; do | ||
echo "Building BookBrowser $APP_VERSION for $GOOS $GOARCH" | ||
GOOS=$GOOS GOARCH=$GOOARCH go build -ldflags "-X main.version=$APP_VERSION" -o "build/BookBrowser-$GOOS-$(echo $GOARCH|sed 's/386/32bit/g'|sed 's/amd64/64bit/g')$(echo $GOOS|sed 's/windows/.exe/g'|sed 's/linux//g'|sed 's/darwin//g')" | ||
done | ||
done | ||
|
||
|
||
if [[ "$SKIP_UPLOAD" != "true" ]]; then | ||
echo "Creating release" | ||
echo "Deleting old release if it exists" | ||
GITHUB_TOKEN=$GITHUB_TOKEN github-release delete \ | ||
--user geek1011 \ | ||
--repo BookBrowser \ | ||
--tag $APP_VERSION >/dev/null 2>/dev/null || true | ||
echo "Creating new release" | ||
GITHUB_TOKEN=$GITHUB_TOKEN github-release release \ | ||
--user geek1011 \ | ||
--repo BookBrowser \ | ||
--tag $APP_VERSION \ | ||
--name "BookBrowser $APP_VERSION" \ | ||
--description "$(cat build/release-notes.md)" | ||
|
||
for f in build/kepubify-*;do | ||
fn="$(basename $f)" | ||
echo "Uploading $fn" | ||
GITHUB_TOKEN=$GITHUB_TOKEN github-release upload \ | ||
--user geek1011 \ | ||
--repo BookBrowser \ | ||
--tag $APP_VERSION \ | ||
--name "$fn" \ | ||
--file "$f" \ | ||
--replace | ||
done | ||
fi |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.