File tree Expand file tree Collapse file tree 4 files changed +82
-23
lines changed Expand file tree Collapse file tree 4 files changed +82
-23
lines changed Original file line number Diff line number Diff line change 33LICENSE.md
44README.md
55docs
6- .github
6+ .github
7+ .goreleaser.yaml
Original file line number Diff line number Diff line change 1919 go-version : 1.19
2020
2121 - name : Build
22- run : go build -v ./...
23-
24- ci :
25- runs-on : ubuntu-latest
26- steps :
27- - uses : actions/checkout@v3
28- - name : Build image
29- run : |
30- # Login dockerhub
31- pwd="${{ secrets.dockerhub }}"
32- docker login -u="plazzari" -p="${pwd}"
33-
34- # Get version
35- VERSION=$(awk -F '[="]' '/^const version/ {print $3}' cmd/core.go)
36-
37- # Build docker images
38- docker build . --tag "plazzari/play:${VERSION}"
39- docker tag "plazzari/play:${VERSION}" plazzari/play:latest
40-
41- # Deploy docker images
42- docker push "plazzari/play:${VERSION}"
43- docker push plazzari/play:latest
22+ run : go build -v ./...
Original file line number Diff line number Diff line change 1+ name : goreleaser
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+
8+ permissions :
9+ contents : write
10+
11+ jobs :
12+ goreleaser :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout
16+ 17+ with :
18+ fetch-depth : 0
19+
20+ - name : Set up Go
21+ uses : actions/setup-go@v4
22+ with :
23+ go-version : " stable"
24+
25+ - name : Run GoReleaser
26+ uses :
goreleaser/[email protected] 27+ with :
28+ version : latest
29+ args : release --clean
30+ env :
31+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
32+
33+ docker :
34+ runs-on : ubuntu-latest
35+ steps :
36+ - uses : actions/checkout@v3
37+ - name : Build and release docker image
38+ run : |
39+ # Login dockerhub
40+ pwd="${{ secrets.dockerhub }}"
41+ docker login -u="plazzari" -p="${pwd}"
42+
43+ # Get version
44+ VERSION=$(awk -F '[="]' '/^const version/ {print $3}' cmd/core.go)
45+
46+ # Build docker images
47+ docker build . --tag "plazzari/play:${VERSION}"
48+ docker tag "plazzari/play:${VERSION}" plazzari/play:latest
49+
50+ # Deploy docker images
51+ docker push "plazzari/play:${VERSION}"
52+ docker push plazzari/play:latest
Original file line number Diff line number Diff line change 1+ before :
2+ hooks :
3+ - go mod tidy
4+ builds :
5+ - env :
6+ - CGO_ENABLED=0
7+ goos :
8+ - linux
9+ - windows
10+ - darwin
11+ archives :
12+ - format : zip
13+ name_template : ' {{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}'
14+ checksum :
15+ name_template : ' checksums.txt'
16+ snapshot :
17+ name_template : " {{ incpatch .Version }}-next"
18+ changelog :
19+ sort : asc
20+ filters :
21+ exclude :
22+ - ' .*Docker.*'
23+ - ' .*README.*'
24+ - ' .*[Dd]ocumentation.*'
25+ - ' .*[Pp]ipelines.*'
26+ - ' .*gitignore.*'
27+ - ' .*dockerignore.*'
You can’t perform that action at this time.
0 commit comments