From da8108f19d506ac3f4e1fa3b0c6a11e82ea09631 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Wed, 23 Nov 2016 19:40:06 -0800 Subject: [PATCH] Add recipes to build binaries for release (#131) --- justfile | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index 73f8d6a..88bff13 100644 --- a/justfile +++ b/justfile @@ -24,7 +24,7 @@ version = `sed -En 's/version[[:space:]]*=[[:space:]]*"([^"]+)"/v\1/p' Cargo.tom publish: lint clippy test git branch | grep '* master' git diff --no-ext-diff --quiet --exit-code - git co -b {{version}} + git checkout -b {{version}} git push github cargo publish git tag -a {{version}} -m {{version}} @@ -32,6 +32,30 @@ publish: lint clippy test git push origin --tags @echo 'Remember to merge the {{version}} branch on GitHub!' +build-binary-mac VERSION: + just build-binary {{VERSION}} x86_64-apple-darwin + +build-binary-linux VERSION: + just build-binary {{VERSION}} x86_64-unknown-linux-musl + +build-binary VERSION TARGET: + git diff --no-ext-diff --quiet --exit-code + git checkout {{VERSION}} + cargo build --release --target={{TARGET}} + rm -rf tmp/just-{{VERSION}}-{{TARGET}} + rm -rf tmp/just-{{VERSION}}-{{TARGET}}.tar.gz + mkdir tmp/just-{{VERSION}}-{{TARGET}} + cp \ + GRAMMAR.md \ + LICENSE.md \ + README.md \ + target/release/just \ + tmp/just-{{VERSION}}-{{TARGET}} + cd tmp && tar cvfz \ + just-{{VERSION}}-{{TARGET}}.tar.gz \ + just-{{VERSION}}-{{TARGET}} + open tmp + # clean up feature branch BRANCH done BRANCH: git checkout {{BRANCH}}