-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The project intentionally no longer ships packaging instructions. I don't follow the best guidelines (e.g. go flags), and I don't want to highlight make over any other build system. As a packager you do not need to pass -ldflags "-X main.version=xxx" if you are using git-archive source tarballs, where the version is already hardcoded.
- Loading branch information
Showing
2 changed files
with
33 additions
and
58 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
default: release | ||
|
||
app := "yubikey-touch-detector" | ||
version := `git describe --tags` | ||
|
||
release: clean vendor | ||
mkdir -p dist | ||
git archive -o "dist/{{app}}-{{version}}.tar.gz" --format tar.gz --prefix "{{app}}-{{version}}/" "{{version}}" | ||
git archive -o "dist/{{app}}-{{version}}-src.tar.gz" --format tar.gz `find vendor -type f -printf '--prefix={{app}}-{{version}}/%h/ --add-file=%p '` --prefix "{{app}}-{{version}}/" "{{version}}" | ||
|
||
for file in dist/*; do \ | ||
gpg --detach-sign --armor "$file"; \ | ||
done | ||
|
||
rm -f "dist/{{app}}-{{version}}.tar.gz" | ||
|
||
run *args: | ||
go run main.go {{args}} | ||
|
||
build: | ||
# if you are building from git-archive tarballs, no need to pass -ldflags, the version is already hardcoded in main.go | ||
go build -ldflags "-X main.version={{version}}" -o {{app}} main.go | ||
scdoc < '{{app}}.1.scd' > '{{app}}.1' | ||
|
||
vendor: | ||
go mod tidy | ||
go mod vendor | ||
|
||
clean: | ||
rm -f {{app}} | ||
rm -f {{app}}.1 | ||
rm -rf dist | ||
rm -rf vendor |