File tree 4 files changed +35
-47
lines changed 4 files changed +35
-47
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,16 @@ jobs:
29
29
- name : Upload coverage
30
30
uses : actions/upload-artifact@v3
31
31
with :
32
- name : coverage
32
+ name : coverage-${{ matrix.os }}
33
33
path : coverage.*
34
34
35
+ - run : goreleaser release --rm-dist --snapshot
36
+ if : ${{ runner.os == 'Linux' }}
37
+
35
38
- name : Upload dist
36
39
uses : actions/upload-artifact@v3
37
40
with :
38
- name : dist
41
+ name : dist-${{ matrix.os }}
39
42
path : dist
40
43
41
44
- name : Upload coverage to Codecov
44
47
file : ./coverage.out
45
48
flags : ${{ runner.os }}
46
49
47
- release-test :
48
- runs-on : ubuntu-20.04
49
- steps :
50
- - uses : actions/checkout@v3
51
- with :
52
- fetch-depth : 0
53
-
54
- - uses : actions/setup-go@v3
55
- with :
56
- go-version : 1.19
57
-
58
- - name : Release test
59
- run : make build
Original file line number Diff line number Diff line change @@ -21,14 +21,21 @@ jobs:
21
21
with :
22
22
go-version : 1.19
23
23
24
+ - run : make install
25
+
24
26
- name : Login to GitHub Container Registry
25
27
uses : docker/login-action@v2
26
28
with :
27
29
registry : ghcr.io
28
30
username : ${{ github.actor }}
29
31
password : ${{ secrets.GITHUB_TOKEN }}
30
32
31
- - name : Release
32
- run : make release
33
+ - run : goreleaser release
33
34
env :
34
35
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
36
+
37
+ - name : Upload dist
38
+ uses : actions/upload-artifact@v3
39
+ with :
40
+ name : dist
41
+ path : dist
Original file line number Diff line number Diff line change @@ -7,12 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [ Unreleased] ( https://github.com/golang-templates/seed/compare/v0.16.0...HEAD )
9
9
10
+ ### Fixed
11
+
12
+ - Improve GH workflows and Makefile. ([ #217 ] ( https://github.com/golang-templates/seed/pull/217 ) )
13
+
10
14
## [ 0.16.0] ( https://github.com/golang-templates/seed/releases/tag/v0.16.0 )
11
15
12
- ### Added
16
+ ### Added
13
17
14
- - Use go-acc. ([ #208 ] ( https://github.com/golang-templates/seed/pull/208 ) )
15
- - Add misspell. ([ #211 ] ( https://github.com/golang-templates/seed/pull/211 ) )
18
+ - Use [ go-acc] ( https://github.com/ory/go-acc ) . ([ #208 ] ( https://github.com/golang-templates/seed/pull/208 ) )
19
+ - Add [ misspell] ( https://github.com/client9/misspell ) . ([ #211 ] ( https://github.com/golang-templates/seed/pull/211 ) )
16
20
- Document docker vs Git Bash workaround. ([ #212 ] ( https://github.com/golang-templates/seed/pull/212 ) )
17
21
18
22
### Changed
@@ -39,7 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
39
43
40
44
## [ 0.15.0] ( https://github.com/golang-templates/seed/releases/tag/v0.15.0 )
41
45
42
- ### Added
46
+ ### Added
43
47
44
48
- Add [ CHANGELOG.md] ( CHANGELOG.md ) based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.1.0/ ) . ([ #131 ] ( https://github.com/golang-templates/seed/pull/131 ) )
45
49
- Add [ CODE_OF_CONDUCT.md] ( CODE_OF_CONDUCT.md ) based on [ Contributor Covenant] ( https://www.contributor-covenant.org/version/2/0/code_of_conduct/ ) . ([ #133 ] ( https://github.com/golang-templates/seed/pull/133 ) )
Original file line number Diff line number Diff line change 1
1
SHELL := /bin/bash
2
2
3
3
.DEFAULT_GOAL := dev
4
-
5
4
.PHONY : dev
6
5
dev : # # dev build
7
- dev : clean mod-tidy install misspell generate lint test
6
+ dev : mod-tidy install misspell generate lint test build
8
7
9
8
.PHONY : ci
10
9
ci : # # CI build
11
10
ci : dev diff
12
11
12
+ .PHONY : help
13
+ help :
14
+ @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
15
+
13
16
.PHONY : clean
14
17
clean : # # remove files created during build pipeline
15
18
$(call print-target)
16
19
rm -rf dist
17
20
rm -f coverage.*
21
+ rm -f ' "$(shell go env GOCACHE)/../golangci-lint"'
22
+ go clean -i -cache -testcache -modcache -fuzzcache -x
18
23
19
24
.PHONY : mod-tidy
20
25
mod-tidy : # # go mod tidy
@@ -48,36 +53,18 @@ test: ## go test
48
53
go-acc --covermode=atomic --output=coverage.out ./... -- -race
49
54
go tool cover -html=coverage.out -o coverage.html
50
55
56
+ .PHONY : build
57
+ build : # # goreleaser build
58
+ build :
59
+ $(call print-target)
60
+ goreleaser build --rm-dist --single-target --snapshot
61
+
51
62
.PHONY : diff
52
63
diff : # # git diff
53
64
$(call print-target)
54
65
git diff --exit-code
55
66
RES=$$(git status --porcelain ) ; if [ -n " $$ RES" ]; then echo $$ RES && exit 1 ; fi
56
67
57
- .PHONY : build
58
- build : # # goreleaser --snapshot --skip-publish --rm-dist
59
- build : install
60
- $(call print-target)
61
- goreleaser --snapshot --skip-publish --rm-dist
62
-
63
- .PHONY : release
64
- release : # # goreleaser --rm-dist
65
- release : install
66
- $(call print-target)
67
- goreleaser --rm-dist
68
-
69
- .PHONY : run
70
- run : # # go run
71
- @go run -race .
72
-
73
- .PHONY : go-clean
74
- go-clean : # # go clean build, test and modules caches
75
- $(call print-target)
76
- go clean -r -i -cache -testcache -modcache
77
-
78
- .PHONY : help
79
- help :
80
- @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
81
68
82
69
define print-target
83
70
@printf "Executing target: \033[36m$@ \033[0m\n"
You can’t perform that action at this time.
0 commit comments