feat: automate release process with conventional commits

This commit is contained in:
Prad N
2025-03-21 21:26:26 -04:00
parent 8b4d51ee30
commit bf4a7440be
5 changed files with 18 additions and 32 deletions
+14 -3
View File
@@ -312,6 +312,20 @@ sh-testnet: mod-tidy
### extra utils ###
###############################################################################
can-release:
@echo "Checking if we can release..."
@git diff --exit-code
@git diff --cached --exit-code
@git tag -l | grep -q -F $(VERSION)
@test -z "$$(git ls-files --exclude-standard --others)" || (echo "There are uncommitted files. Please commit or stash them before release."; exit 1)
should-release:
@echo "Checking if we should release..."
@git diff --exit-code
@git diff --cached --exit-code
@git tag -l | grep -q -F $(VERSION)
@test -z "$$(git ls-files --exclude-standard --others)" || (echo "There are uncommitted files. Please commit or stash them before release."; exit 1)
push-docker:
@docker build -t ghcr.io/onsonr/sonr:latest .
@docker tag ghcr.io/onsonr/sonr:latest ghcr.io/onsonr/sonr:$(VERSION)
@@ -330,15 +344,12 @@ push-docker:
@docker push ghcr.io/onsonr/sonr:latest
release:
@go install github.com/goreleaser/goreleaser/v2@latest
@RELEASE_DATE=$(RELEASE_DATE) goreleaser release --clean
release-dry:
@go install github.com/goreleaser/goreleaser/v2@latest
@RELEASE_DATE=$(RELEASE_DATE) goreleaser release --snapshot --clean --skip=publish
release-check:
@go install github.com/goreleaser/goreleaser/v2@latest
@RELEASE_DATE=$(RELEASE_DATE) goreleaser check
validate-tag: