oficina / sheets Public

Merge branch 'release-target' into main

claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 1fae2b25a8d3b2ac64c0a1d5e0c14ff4d4b95700 parent fa8b940parent 36c55ae
2 files changed, +26 −5
  • .gitignore +1 −0
  • Makefile +25 −5

CI passed — run details

diff --git a/.gitignore b/.gitignore
index d30a32e..189890a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,4 @@
.claude/worktrees
.claude/HANDOFF.md
/sheets-arm64
+/releases/
diff --git a/Makefile b/Makefile
index 04e4959..d02bb33 100644
--- a/Makefile
+++ b/Makefile
@@ -18,14 +18,34 @@ build:
#
# A dirty tree is refused: the sha would name a commit that is not what
# is in the binary, which is worse than no stamp at all.
-RELEASE_OUT ?= ./sheets-arm64
+#
+# The stamp was a short sha because there were no tags to describe. Now
+# that a release IS a tag, git describe --tags --always answers with the
+# tag when the build sits on one and falls back to the same short sha
+# when it does not, so nothing is lost and a published binary reports
+# the name it was published under.
+#
+# The artifact lands in releases/ under the name the publish step
+# expects: `amadan release create` uploads a file under its basename,
+# and that basename is what appears on the release page permanently.
+APP := sheets
+RELEASE_GOOS ?= linux
+RELEASE_GOARCH ?= arm64
+RELEASE_BIN := releases/$(APP)-$(RELEASE_GOOS)-$(RELEASE_GOARCH)
+VERSION ?= $(shell git describe --tags --always 2>/dev/null)
+
release:
@git diff --quiet && git diff --cached --quiet || \
{ echo "refusing to build a release from a dirty tree"; exit 1; }
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -trimpath \
- -ldflags "-s -w -X github.com/carlosframework/rastrillo.BuildVersion=$$(git rev-parse --short HEAD)" \
- -o $(RELEASE_OUT) ./cmd/sheets
- @echo "built $(RELEASE_OUT) stamped $$(git rev-parse --short HEAD)"
+ @test -n "$(VERSION)" || \
+ { echo "make release: no version to stamp; commit, or name it: make release VERSION=v0.1.0"; exit 1; }
+ @mkdir -p releases
+ CGO_ENABLED=0 GOOS=$(RELEASE_GOOS) GOARCH=$(RELEASE_GOARCH) go build -trimpath \
+ -ldflags "-s -w -X github.com/carlosframework/rastrillo.BuildVersion=$(VERSION)" \
+ -o $(RELEASE_BIN) ./cmd/$(APP)
+ @echo "built $(RELEASE_BIN) reporting version $(VERSION)"
+ @echo "publish it with:"
+ @echo " amadan release create -repo oficina/$(APP) -notes-file NOTES.md $(VERSION) $(RELEASE_BIN)"
# The gate, split into named targets so CI can report them individually
# (.amadan/ci.d calls these one at a time, each its own step). `make