update justfile package command

- include screenshots (moved to their own dir), completions
- build for x86_64, arm, and arm64
This commit is contained in:
Lilian Jónsdóttir 2024-07-30 22:03:52 -07:00
parent d4f086ab54
commit 747a24ebd6
5 changed files with 27 additions and 10 deletions

2
.gitignore vendored
View file

@ -1,2 +1,2 @@
bin/ bin/
dist/*.tar.gz dist/

View file

@ -117,6 +117,6 @@ See also gt(1) or `gt --help`.
## Screenshots ## Screenshots
![trashing screenshot](./dist/Screenshot01.png) ![trashing screenshot](./screenshots/Screenshot01.png)
![list screenshot](./dist/Screenshot02.png) ![list screenshot](./screenshots/Screenshot02.png)

View file

@ -5,6 +5,12 @@ dist_dir := "dist"
cmd := "." cmd := "."
output := "." / build_dir / binary output := "." / build_dir / binary
dist := "." / dist_dir / binary dist := "." / dist_dir / binary
contrib_dir := "." / "contrib"
screenshots_dir := "screenshots"
archive_base := dist_dir / binary + "-" + version
linux_archive := archive_base + "-x86_64.tar"
arm64_archive := archive_base + "-arm64.tar"
arm_archive := archive_base + "-arm.tar"
# do the thing # do the thing
default: test check install default: test check install
@ -13,12 +19,24 @@ default: test check install
build: build:
go build -o {{output}} {{cmd}} go build -o {{output}} {{cmd}}
package: package $CGO_ENABLED="0": man
go build -o {{binary}} go build -o {{binary}} {{cmd}}
distrobox enter alpine -- go build -o {{binary}}-musl {{cmd}} tar cafv {{linux_archive}} {{binary}} {{binary}}.1 README.md LICENSE {{screenshots_dir}}
tar cafv {{dist_dir}}/{{binary}}-{{version}}-x86_64.tar.gz {{binary}} README.md LICENSE tar rafv {{linux_archive}} -C {{contrib_dir}} "completions"
tar cafv {{dist_dir}}/{{binary}}-{{version}}-x86_64-musl.tar.gz {{binary}}-musl README.md LICENSE gzip -f {{linux_archive}}
rm {{binary}} {{binary}}-musl rm {{binary}}
GOARCH="arm" GOARM="7" go build -o {{binary}} {{cmd}}
tar cafv {{arm_archive}} {{binary}} {{binary}}.1 README.md LICENSE {{screenshots_dir}}
tar rafv {{arm_archive}} -C {{contrib_dir}} "completions"
gzip -f {{arm_archive}}
rm {{binary}}
GOARCH="arm64" go build -o {{binary}} {{cmd}}
tar cafv {{arm64_archive}} {{binary}} {{binary}}.1 README.md LICENSE {{screenshots_dir}}
tar rafv {{arm64_archive}} -C {{contrib_dir}} "completions"
gzip -f {{arm64_archive}}
rm {{binary}}
# run from source # run from source
run: run:
@ -44,7 +62,6 @@ install-man:
# clean up after yourself # clean up after yourself
clean: clean:
-rm {{output}} -rm {{output}}
-rm {{output}}-musl
-rm {{dist_dir}}/*.tar.gz -rm {{dist_dir}}/*.tar.gz
# run go tests # run go tests

View file

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

View file

Before

Width:  |  Height:  |  Size: 324 KiB

After

Width:  |  Height:  |  Size: 324 KiB