| 1 |
# SPDX-FileCopyrightText: 2024 Shun Sakai |
| 2 |
# |
| 3 |
# SPDX-License-Identifier: Apache-2.0 OR MIT |
| 4 |
|
| 5 |
alias fmt := golangci-lint-fmt |
| 6 |
alias lint := golangci-lint-run |
| 7 |
alias build-cmd := build-cmd-debug |
| 8 |
|
| 9 |
# Run default recipe |
| 10 |
_default: |
| 11 |
just -l |
| 12 |
|
| 13 |
# Remove generated artifacts |
| 14 |
clean: |
| 15 |
go clean |
| 16 |
|
| 17 |
# Run tests |
| 18 |
test: |
| 19 |
go test ./... |
| 20 |
|
| 21 |
# Run `golangci-lint` |
| 22 |
golangci-lint: golangci-lint-fmt golangci-lint-run |
| 23 |
|
| 24 |
# Run the formatter |
| 25 |
golangci-lint-fmt: |
| 26 |
golangci-lint fmt |
| 27 |
|
| 28 |
# Run the linter |
| 29 |
golangci-lint-run: |
| 30 |
golangci-lint run |
| 31 |
|
| 32 |
# Run `pkgsite` |
| 33 |
pkgsite: |
| 34 |
pkgsite -http "0.0.0.0:8080" |
| 35 |
|
| 36 |
# Build `glzip` command in debug mode |
| 37 |
build-cmd-debug $CGO_ENABLED="0": |
| 38 |
go build ./cmd/glzip |
| 39 |
|
| 40 |
# Build `glzip` command in release mode |
| 41 |
build-cmd-release $CGO_ENABLED="0": |
| 42 |
go build -ldflags="-s -w" -trimpath ./cmd/glzip |
| 43 |
|
| 44 |
# Build `glzip(1)` |
| 45 |
build-man: |
| 46 |
asciidoctor -b manpage docs/man/man1/glzip.1.adoc |
| 47 |
|
| 48 |
# Run the linter for GitHub Actions workflow files |
| 49 |
lint-github-actions: |
| 50 |
actionlint -verbose |
| 51 |
|
| 52 |
# Run the formatter for the README |
| 53 |
fmt-readme: |
| 54 |
npx prettier -w README.md |
| 55 |
|
| 56 |
# Increment the version |
| 57 |
bump part: |
| 58 |
bump-my-version bump {{ part }} |