-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
19 lines (15 loc) · 924 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
VERSION = $(shell crystal eval 'require "yaml"; s = YAML.parse(File.read("./shard.yml")); puts s["version"]')
CONST_VERSION = $(shell crystal eval 'require "./src/immutable/version"; puts Immutable::VERSION')
GIT_STATUS = $(shell git status -s)
docsite:
crystal docs && git checkout gh-pages && mkdir -p api && cp -r docs/. api && git add api && git commit -m "generate docs" && git push && git checkout master
test:
crystal spec
release: test
@test "$(VERSION)" == "$(CONST_VERSION)" || { echo "Error: version in shards.yml does not match version in code"; exit 1; }
@test "$(GIT_STATUS)" == "" || { echo "Error: uncommitted changes"; exit 1; }
git fetch && git tag v$(VERSION) origin/master && git push origin v$(VERSION)
open https://github.com/lucaong/immutable/releases/new?tag=v$(VERSION)
benchmark:
mkdir -p ./tmp && crystal build -o ./tmp/benchmarks --release ./benchmarks/benchmarks.cr
./tmp/benchmarks