|
1 | | -# Emojify Build System |
2 | | -# Build and manage the Go emoji CLI tool |
3 | | - |
4 | 1 | # Build configuration |
5 | 2 | APP_NAME := emojify |
6 | 3 | GO_MODULE := github.com/damienbutt/emojify-go |
@@ -320,28 +317,6 @@ vuln-check: |
320 | 317 | @go tool govulncheck ./... || echo "⚠️ govulncheck not found, skipping" |
321 | 318 | @echo "✅ Vulnerability check complete" |
322 | 319 |
|
323 | | -# Create a distributable package |
324 | | -.PHONY: package |
325 | | -package: build-all |
326 | | - @echo "📦 Creating distribution packages..." |
327 | | - @mkdir -p $(DIST_DIR) |
328 | | - @for binary in $(BUILD_DIR)/$(APP_NAME)-*; do \ |
329 | | - platform=$$(basename $$binary | sed 's/$(APP_NAME)-//'); \ |
330 | | - mkdir -p $(DIST_DIR)/$$platform; \ |
331 | | - cp $$binary $(DIST_DIR)/$$platform/$(APP_NAME)$$(echo $$platform | grep -q windows && echo .exe || echo ""); \ |
332 | | - cp README.md $(DIST_DIR)/$$platform/; \ |
333 | | - cp LICENSE $(DIST_DIR)/$$platform/; \ |
334 | | - cd $(DIST_DIR) && tar -czf $(APP_NAME)-$(VERSION)-$$platform.tar.gz $$platform/; \ |
335 | | - cd ..; \ |
336 | | - done |
337 | | - @echo "✅ Distribution packages created in $(DIST_DIR)/" |
338 | | - |
339 | | -# Test local package generation with GoReleaser |
340 | | -.PHONY: test-local-release |
341 | | -test-local-release: |
342 | | - @echo "🚀 Testing local package generation..." |
343 | | - @go tool goreleaser release --config .goreleaser-local.yml --snapshot --clean --skip=publish |
344 | | - |
345 | 320 | # Generate man page |
346 | 321 | .PHONY: man |
347 | 322 | man: |
@@ -376,41 +351,6 @@ goreleaser-test: |
376 | 351 | @echo "🧪 Running comprehensive GoReleaser test suite..." |
377 | 352 | @./scripts/test-goreleaser.sh |
378 | 353 |
|
379 | | -.PHONY: goreleaser-build |
380 | | -goreleaser-build: |
381 | | - @echo "🔨 Building with GoReleaser..." |
382 | | - @go tool goreleaser build --snapshot --clean || echo "⚠️ goreleaser not found" |
383 | | - |
384 | | -.PHONY: goreleaser-test-release-notes |
385 | | -goreleaser-test-release-notes: |
386 | | - @echo "📝 Testing release notes generation..." |
387 | | - @if [ -z "$(VERSION)" ]; then echo "⚠️ VERSION is required. Usage: make goreleaser-test-release-notes VERSION=v1.0.0"; exit 1; fi |
388 | | - @echo "📋 Generating release notes for $(VERSION)..." |
389 | | - @go tool git-chglog --tag-filter-pattern $(VERSION) --output RELEASE_NOTES.md $(VERSION) |
390 | | - @echo "✅ Release notes generated: RELEASE_NOTES.md" |
391 | | - @echo "📄 Content preview:" |
392 | | - @head -20 RELEASE_NOTES.md |
393 | | - |
394 | | -.PHONY: goreleaser-release |
395 | | -goreleaser-release: |
396 | | - @echo "🚀 Creating release with GoReleaser..." |
397 | | - @if [ -z "$(VERSION)" ]; then echo "⚠️ VERSION is required. Usage: make goreleaser-release VERSION=v1.0.0"; exit 1; fi |
398 | | - @echo "📝 Generating release notes for $(VERSION)..." |
399 | | - @go tool git-chglog --tag-filter-pattern $(VERSION) --output RELEASE_NOTES.md $(VERSION) |
400 | | - @go tool goreleaser release --clean --release-notes RELEASE_NOTES.md || echo "⚠️ goreleaser not found" |
401 | | - |
402 | | -.PHONY: goreleaser-release-with-changelog |
403 | | -goreleaser-release-with-changelog: |
404 | | - @echo "🚀 Creating release with GoReleaser and committing changelog..." |
405 | | - @echo "📋 Getting next tag..." |
406 | | - @TAG=$$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0") && \ |
407 | | - NEXT_TAG=$$(echo $$TAG | sed 's/v//') && \ |
408 | | - NEXT_TAG="v$$(echo $$NEXT_TAG | awk -F. '{$$NF = $$NF + 1;} 1' | sed 's/ /./g')" && \ |
409 | | - echo "📦 Releasing $$NEXT_TAG..." && \ |
410 | | - go tool goreleaser release --clean && \ |
411 | | - echo "📝 Committing updated changelog..." && \ |
412 | | - ./scripts/commit-changelog.sh "$$NEXT_TAG" |
413 | | - |
414 | 354 | # Changelog generation targets |
415 | 355 | .PHONY: changelog |
416 | 356 | changelog: |
@@ -515,12 +455,8 @@ help: |
515 | 455 | @echo "📦 Release targets:" |
516 | 456 | @echo " goreleaser-check Check GoReleaser configuration" |
517 | 457 | @echo " goreleaser-test Run comprehensive GoReleaser test suite" |
518 | | - @echo " goreleaser-build Build with GoReleaser" |
519 | | - @echo " goreleaser-release Create release with GoReleaser" |
520 | | - @echo " goreleaser-release-with-changelog Create release and commit changelog" |
521 | 458 | @echo " changelog Generate CHANGELOG.md for next version" |
522 | 459 | @echo " changelog-preview Preview changelog for next version" |
523 | | - @echo " package Create distribution packages" |
524 | 460 | @echo "" |
525 | 461 | @echo "🔄 Utility targets:" |
526 | 462 | @echo " update-emoji Update emoji data from GitHub" |
|
0 commit comments