File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -10,3 +10,32 @@ jarvis: $(BUILD_FILES)
10
10
test :
11
11
go test ./...
12
12
.PHONY : test
13
+
14
+ # We use a trick to capture the second and subsequent words from the command line:
15
+ # make release v0.0.33 "some text"
16
+ #
17
+ # - $(word 2, $(MAKECMDGOALS)) is the second “goal”: v0.0.33
18
+ # - $(wordlist 3, ..., $(MAKECMDGOALS)) takes everything after the second goal,
19
+
20
+ VERSION := $(word 2, $(MAKECMDGOALS ) )
21
+ RELEASE_TEXT := $(wordlist 3, $(words $(MAKECMDGOALS ) ) , $(MAKECMDGOALS ) )
22
+
23
+ .PHONY : release
24
+ release :
25
+ @if [ -z " $( VERSION) " ]; then \
26
+ echo " ERROR: Missing version. Usage: make release v0.0.33 \" Release text\" " ; \
27
+ exit 1; \
28
+ fi
29
+ @if [ -z " $( RELEASE_TEXT) " ]; then \
30
+ echo " ERROR: Missing release text. Usage: make release v0.0.33 \" Release text\" " ; \
31
+ exit 1; \
32
+ fi
33
+ @echo " Tagging version: $( VERSION) with message: $( RELEASE_TEXT) "
34
+ git tag -a " $( VERSION) " -m " $( RELEASE_TEXT) "
35
+ # If you want to push the tag right away, un-comment the next line:
36
+ # git push origin "$(VERSION)"
37
+ goreleaser1.17 release --clean --skip-publish
38
+
39
+ # This is the "phony target" trick: any unknown goal (like v0.0.33) goes here
40
+ % :
41
+ @:
You can’t perform that action at this time.
0 commit comments