Skip to content

Commit 52e4276

Browse files
committed
feat: update Makefile
1 parent 61e8dad commit 52e4276

1 file changed

Lines changed: 38 additions & 4 deletions

File tree

Makefile

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ APP_IDENTITY ?= $(shell security find-identity -v -p codesigning 2>/dev/null \
1212
| grep -o '"Developer ID Application: [^"]*"' | head -1 | tr -d '"')
1313
export APP_IDENTITY
1414

15+
# GitHub repo for fork releases (override: make sign-and-release GH_REPO="org/repo")
16+
GH_REPO ?= johnlarkin1/CodexBar
17+
1518
.PHONY: help build build-release test run run-test lint format \
16-
sign package release appcast check-release validate-changelog \
17-
check-upstream clean
19+
sign package release sign-and-release appcast check-release \
20+
validate-changelog check-upstream clean
1821

1922
# ── Default ──────────────────────────────────────────────────────────
2023
help: ## Show available targets
@@ -51,8 +54,39 @@ sign: ## Sign + notarize for distribution
5154
package: ## Build release binary and create CodexBar.app bundle
5255
./Scripts/package_app.sh
5356

54-
release: ## Full release pipeline
55-
./Scripts/release.sh
57+
release: ## Full release pipeline (DISABLED — use sign-and-release instead)
58+
@echo "ERROR: 'make release' is disabled to prevent accidental pushes to upstream (steipete/CodexBar)." >&2; \
59+
echo "Use 'make sign-and-release' to release to $(GH_REPO)." >&2; \
60+
exit 1
61+
62+
_guard-no-upstream: ## (internal) Block releases targeting upstream
63+
@if echo "$(GH_REPO)" | grep -qi 'steipete/CodexBar'; then \
64+
echo "ERROR: Refusing to release to upstream steipete/CodexBar. Set GH_REPO to your fork." >&2; \
65+
exit 1; \
66+
fi
67+
68+
sign-and-release: _guard-no-upstream sign ## Sign, notarize, tag, and create GitHub release on fork
69+
@TAG="v$(MARKETING_VERSION)"; \
70+
ZIP="CodexBar-$(MARKETING_VERSION).zip"; \
71+
DSYM_ZIP="CodexBar-$(MARKETING_VERSION).dSYM.zip"; \
72+
if [ ! -f "$$ZIP" ]; then \
73+
echo "ERROR: $$ZIP not found. Did sign-and-notarize.sh succeed?" >&2; \
74+
exit 1; \
75+
fi; \
76+
echo "Tagging $$TAG and pushing to $(GH_REPO)..."; \
77+
git tag -f "$$TAG"; \
78+
git push -f origin "$$TAG"; \
79+
echo "Creating GitHub release on $(GH_REPO)..."; \
80+
NOTES="CodexBar $(MARKETING_VERSION) (build $(BUILD_NUMBER))"; \
81+
if [ -f CHANGELOG.md ]; then \
82+
SECTION=$$(awk '/^## \[?$(MARKETING_VERSION)\]?/{found=1;next} /^## /{if(found)exit} found' CHANGELOG.md); \
83+
if [ -n "$$SECTION" ]; then NOTES="$$SECTION"; fi; \
84+
fi; \
85+
gh release create "$$TAG" "$$ZIP" "$$DSYM_ZIP" \
86+
--repo "$(GH_REPO)" \
87+
--title "CodexBar $(MARKETING_VERSION)" \
88+
--notes "$$NOTES"; \
89+
echo "Release $(MARKETING_VERSION) published to $(GH_REPO)."
5690

5791
appcast: ## Generate Sparkle appcast (requires args: make appcast ARGS="<zip> <url>")
5892
@if [ -z "$(ARGS)" ]; then \

0 commit comments

Comments
 (0)