diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d13b34..c10fe62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,11 +20,12 @@ jobs: - name: gofmt run: test -z "$(gofmt -l .)" || { gofmt -l .; exit 1; } - run: go vet ./... - - run: go test ./... + - run: go test -race ./... release: # A v* tag builds the release binaries and publishes them, on GitHub - # only: Forgejo reads this directory too and has its own releases. + # only. Forgejo has its own releases, and skips this file anyway: see + # .forgejo/workflows/README.md. if: startsWith(github.ref, 'refs/tags/v') && github.server_url == 'https://github.com' needs: test runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 28fb534..97efa38 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,13 @@ -VERSION ?= $(shell date +%Y.%m.%d) +# The nearest tag, so self-update can tell a newer release apart; a date +# would read as version 2026.10.29 and outrank every release. +VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev) interzone: CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=$(VERSION)" -o interzone . -.PHONY: interzone +test: + test -z "$$(gofmt -l .)" || { gofmt -l .; exit 1; } + go vet ./... + go test -race ./... + +.PHONY: interzone test