-
Notifications
You must be signed in to change notification settings - Fork 55
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
12 changed files
with
116 additions
and
275 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,3 +1,4 @@ | ||
*.coverprofile | ||
creds.yml | ||
secrets.bass | ||
/node_modules |
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,11 @@ | ||
(def repo | ||
"https://github.com/vito/booklit") | ||
|
||
(def git | ||
(load (.git "alpine/git"))) | ||
|
||
(defn ls-remote [ref] | ||
(git:ls-remote repo ref)) | ||
|
||
(defn checkout [sha] | ||
(git:checkout repo sha)) |
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,31 +1,24 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bass | ||
|
||
set -e -u | ||
(def [ref version] | ||
(case *args* | ||
[] ["HEAD" "0.0.0-dev"] | ||
[r] [r "0.0.0-dev"] | ||
_ *args*)) | ||
|
||
export GOPATH=$PWD/gopath | ||
export PATH=$PWD/gopath/bin:$PATH | ||
(def project | ||
(load (*dir*/../project))) | ||
|
||
assets=$PWD/assets | ||
(def booklit | ||
(load (*dir*/booklit))) | ||
|
||
version="0.0.0-dev" | ||
if [ -d version ]; then | ||
version="$(cat version/version)" | ||
fi | ||
(defn final-inspection [bin] | ||
(from "ubuntu" | ||
($ ls -alh $bin) | ||
($ ldd $bin) | ||
($ $bin --version))) | ||
|
||
pushd booklit | ||
for os in linux darwin windows; do | ||
ext="" | ||
if [ "$os" = "windows" ]; then | ||
ext=".exe" | ||
fi | ||
|
||
echo "building $os binary..." | ||
GOOS=$os go build \ | ||
--ldflags "-X github.com/vito/booklit.Version=${version}" \ | ||
-o $assets/booklit_${os}_amd64${ext} \ | ||
github.com/vito/booklit/cmd/booklit | ||
done | ||
popd | ||
|
||
echo "printing version..." | ||
./assets/booklit_$(go env GOOS)_$(go env GOARCH) --version | ||
(let [src (booklit:checkout ref) | ||
binaries (project:build-all src version)] | ||
(run (final-inspection binaries:linux)) | ||
(emit binaries *stdout*)) |
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 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,14 @@ | ||
#!/usr/bin/env bass | ||
|
||
(provide [fetch] | ||
(import (load (*dir*/../project)) | ||
*root*) | ||
|
||
(def booklit | ||
(load (*dir*/booklit))) | ||
|
||
(defn fetch [version] | ||
(let [version-info (booklit:checkout (booklit:ls-remote "version")) | ||
info (subpath version-info (string->dir version))] | ||
{:title (trim (read info/name)) | ||
:notes info/notes.md}))) |
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,27 @@ | ||
#!/usr/bin/env bass | ||
|
||
(def [sha version] *args*) | ||
|
||
(import (load (*dir*/secrets)) | ||
*access-token*) | ||
|
||
(def release-info | ||
(load (*dir*/release-info))) | ||
|
||
(def git | ||
(load (.git "alpine/git"))) | ||
|
||
(def tabs | ||
(let [repo "https://github.com/vito/tabs"] | ||
(git:checkout repo (git:ls-remote repo "main")))) | ||
|
||
(def release | ||
(load (tabs/gh/release "vito/booklit" *access-token*))) | ||
|
||
(let [test (run ($ *dir*/test $sha)) | ||
binaries (run ($ *dir*/build $sha $version)) | ||
assets (values (next binaries)) | ||
info (release-info:fetch version)] | ||
(log (release:create! version sha assets | ||
{:title info:title | ||
:notes-file info:notes}))) |
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,25 +1,12 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bass | ||
|
||
set -e -u | ||
(def [sha & testflags] | ||
*args*) | ||
|
||
export GOPATH=$PWD/gopath | ||
export PATH=$PWD/gopath/bin:$PATH | ||
(def project | ||
(load (*dir*/../project))) | ||
|
||
cd booklit | ||
(def booklit | ||
(load (*dir*/booklit))) | ||
|
||
echo "installing ginkgo..." | ||
go install github.com/onsi/ginkgo/ginkgo | ||
|
||
function emit_coveralls() { | ||
if [ -n "$COVERALLS_TOKEN" ]; then | ||
echo "emitting code coverage..." | ||
go get github.com/mattn/goveralls | ||
goveralls -service concourse \ | ||
-coverprofile <(find . -name '*.coverprofile' | xargs cat | grep -v 'booklit.peg.go\|render/bindata.go') | ||
fi | ||
} | ||
|
||
trap emit_coveralls EXIT | ||
|
||
echo "running tests..." | ||
./scripts/test -p "$@" | ||
(run (project:test (booklit:checkout sha) testflags)) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.