File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ before:
1616builds :
1717 - id : smoothdb
1818 ldflags :
19- - -s -w -X main. Version={{ .Version }}
19+ - -s -w -X github.com/sted/smoothdb/version. Version={{ .Tag }}
2020 env :
2121 - CGO_ENABLED=0
2222 goarch :
Original file line number Diff line number Diff line change 11
2- VERSION =$(shell git describe --tags `git rev-list --tags --max-count=1`)
3- GO =go
4- TEST_FLAGS =-v -count=1 -race
2+ VERSION := $(shell git describe --tags --always --dirty)
3+ GO = go
4+ TEST_FLAGS = -v -count=1 -race
5+ TAG = v$(patsubst v% ,% ,$(V ) )
56
67all : build
78
@@ -24,7 +25,17 @@ prepare-postgrest-tests:
2425 psql -U postgres -c " create database pgrest" && \
2526 psql -U postgres -f ./test/postgrest/fixtures/load.sql pgrest
2627
28+ # Tag a release and push it to GitHub, where the goreleaser workflow
29+ # builds and publishes the bundles.
30+ # Usage: make release V=0.7.0
31+ release :
32+ @[ -n " $( V) " ] || { echo " usage: make release V=x.y.z" ; exit 1; }
33+ @git diff-index --quiet HEAD -- || { echo " error: working tree not clean" ; exit 1; }
34+ @[ " $$ (git branch --show-current)" = " main" ] || { echo " error: not on branch main" ; exit 1; }
35+ git tag -a $(TAG ) -m " Release $( TAG) "
36+ git push origin main $(TAG )
37+
2738clean :
28- go clean
39+ $( GO ) clean
2940
30- .PHONY : all build build-ui build-go clean test
41+ .PHONY : all build build-ui build-go test prepare-postgrest-tests release clean
You can’t perform that action at this time.
0 commit comments