From a6a62f74d1a59c3be1ec7b065741a4ce4c08b366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Tue, 30 Jul 2024 21:06:32 -0700 Subject: [PATCH] add package commands to justfile and remove the old windows binary boilerplate I had forgotten about --- .gitignore | 1 + justfile | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e660fd9..a5d8f72 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ bin/ +dist/ diff --git a/justfile b/justfile index a102772..20c66f7 100644 --- a/justfile +++ b/justfile @@ -1,7 +1,10 @@ binary := "gt" +version := "0.0.1" build_dir := "bin" +dist_dir := "dist" cmd := "." output := "." / build_dir / binary +dist := "." / dist_dir / binary # do the thing default: test check install @@ -10,9 +13,12 @@ default: test check install build: go build -o {{output}} {{cmd}} -# build windows binary -build-windows: - GOOS=windows GOARCH=amd64 go build -o {{output}}.exe {{cmd}} +package: + go build -o {{binary}} + distrobox enter alpine -- go build -o {{binary}}-musl {{cmd}} + tar cafv {{dist_dir}}/{{binary}}-{{version}}-x86_64.tar.gz {{binary}} README.md LICENSE + tar cafv {{dist_dir}}/{{binary}}-{{version}}-x86_64-musl.tar.gz {{binary}}-musl README.md LICENSE + rm {{binary}} {{binary}}-musl # run from source run: @@ -37,7 +43,9 @@ install-man: # clean up after yourself clean: - rm {{output}} + -rm {{output}} + -rm {{output}}-musl + -rm {{dist_dir}}/* # run go tests test: