-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add distribution targets to Makefile.
- Loading branch information
1 parent
c5520cb
commit a261b89
Showing
3 changed files
with
36 additions
and
7 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 |
---|---|---|
|
@@ -3,4 +3,3 @@ FROM scratch | |
ENTRYPOINT ["/ktmpl"] | ||
|
||
COPY target/x86_64-unknown-linux-musl/release/ktmpl /ktmpl | ||
|
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,15 +1,37 @@ | ||
all: cargo-build docker-build | ||
TAG = 0.2.1 | ||
|
||
cargo-build: | ||
all: dist | ||
|
||
.PHONY: target/release/ktmpl | ||
target/release/ktmpl: | ||
cargo build --release | ||
|
||
.PHONY: target/x86_64-unknown-linux-musl/release/ktmpl | ||
target/x86_64-unknown-linux-musl/release/ktmpl: | ||
docker run \ | ||
--rm \ | ||
-v ${PWD}:/volume \ | ||
-v ${HOME}/.cargo/git:/root/.cargo/git \ | ||
-v ${HOME}/.cargo/registry:/root/.cargo/registry \ | ||
-v $(PWD):/volume \ | ||
-v $(HOME)/.cargo/git:/root/.cargo/git \ | ||
-v $(HOME)/.cargo/registry:/root/.cargo/registry \ | ||
-w /volume \ | ||
-t \ | ||
clux/muslrust \ | ||
cargo build --release | ||
|
||
.PHONY: docker-build | ||
docker-build: | ||
docker build -t inquicker/ktmpl . | ||
docker build -t inquicker/ktmpl -t inquicker/ktmpl:$(TAG) . | ||
|
||
dist: dist/sha256sums.txt.sig docker-build | ||
|
||
dist/ktmpl-$(TAG)-darwin.tar.gz: target/release/ktmpl | ||
tar -c -C target/release -zvf dist/ktmpl-$(TAG)-darwin.tar.gz ktmpl | ||
|
||
dist/ktmpl-$(TAG)-linux.tar.gz: target/x86_64-unknown-linux-musl/release/ktmpl | ||
tar -c -C target/x86_64-unknown-linux-musl/release -zvf dist/ktmpl-$(TAG)-linux.tar.gz ktmpl | ||
|
||
dist/sha256sums.txt: dist/ktmpl-$(TAG)-darwin.tar.gz dist/ktmpl-$(TAG)-linux.tar.gz | ||
cd dist && shasum -a 256 * > sha256sums.txt | ||
|
||
dist/sha256sums.txt.sig: dist/sha256sums.txt | ||
cd dist && gpg2 --detach-sign sha256sums.txt |
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