From 9ed68dccb57a17804daebe4a325f52c7afa57b02 Mon Sep 17 00:00:00 2001 From: Vehbi Sinan Tunalioglu Date: Mon, 18 Jul 2022 11:21:32 +0800 Subject: [PATCH] chore(build): improve release artifact 1. Rename properly 2. Compress binary --- release.sh | 14 +++++++++++++- shell.nix | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/release.sh b/release.sh index 471f8ef..f19b897 100644 --- a/release.sh +++ b/release.sh @@ -49,6 +49,18 @@ git push --follow-tags origin main ## Build application: nix-build --arg doStatic true +## Get compiled output file path: +_infile="result/bin/deback" + +## Get compressed, renamed output file path: +_outfile="deback-v${_VERSION_NEXT}-$(uname -s)-$(uname -m)-static" + +## Compress file: +upx -o "${_outfile}" "${_infile}" + ## Release gh release create "v${_VERSION_NEXT}" --generate-notes -gh release upload "v${_VERSION_NEXT}" result/bin/deback +gh release upload "v${_VERSION_NEXT}" "${_outfile}" + +## Remove outfile: +rm "${_outfile}" diff --git a/shell.nix b/shell.nix index 95ffdec..875c3c3 100644 --- a/shell.nix +++ b/shell.nix @@ -31,9 +31,11 @@ pkgs.mkShell { pkgs.lolcat ## Release stuff: + pkgs.busybox pkgs.gh pkgs.git pkgs.git-chglog + pkgs.upx ## Haskell stuff: ghc