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
+3 -2
View File
@@ -2,7 +2,8 @@
name = "cz_conventional_commits"
tag_format = "v$version"
version_scheme = "semver"
version = "0.6.3"
version_provider = "scm"
update_changelog_on_bump = true
major_version_zero = true
changelog_file = "CHANGELOG.md"
pre_bump_hooks = ["make test"]
post_bump_hooks = ["make release"]
+1 -3
View File
@@ -34,12 +34,11 @@ builds:
archives:
- id: sonr
builds: [sonr]
name_template: >-
sonr_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
format: tar.gz
formats: ["tar.gz"]
files:
- src: README*
wrap_in_directory: true
@@ -48,7 +47,6 @@ nfpms:
- id: sonr
package_name: sonrd
file_name_template: "sonrd_{{ .Os }}_{{ .Arch }}{{ .ConventionalExtension }}"
builds: [sonr]
vendor: Sonr
homepage: "https://onsonr.dev"
maintainer: "Sonr <support@onsonr.dev>"
-24
View File
@@ -1,24 +0,0 @@
#
version: '3'
includes:
buf: .github/taskfiles/Buf.yml
bun: .github/taskfiles/Bun.yml
docker: .github/taskfiles/Docker.yml
dokku: .github/taskfiles/Dokku.yml
doppler: .github/taskfiles/Doppler.yml
gh: .github/taskfiles/Gh.yml
go: .github/taskfiles/Go.yml
goreleaser: .github/taskfiles/Goreleaser.yml
log: .github/taskfiles/Log.yml
pkl: .github/taskfiles/Pkl.yml
templ: .github/taskfiles/Templ.yaml
wrangler: .github/taskfiles/Wrangler.yml
silent: true
vars:
GREETING: Hello, World!
tasks:
default:
cmds:
- echo "{{.GREETING}}"
View File
+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: