File tree Expand file tree Collapse file tree 6 files changed +25
-8
lines changed Expand file tree Collapse file tree 6 files changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,23 @@ jobs:
18
18
- name : checkout
19
19
uses : actions/checkout@master
20
20
with :
21
- ref : ${{ github.ref }}
21
+ fetch-depth : 0
22
22
- name : Set up Go
23
23
uses : actions/setup-go@v2
24
24
with :
25
25
go-version : 1.17
26
+ - name : Cache Go modules
27
+ uses : actions/cache@v2
28
+ with :
29
+ path : ~/go/pkg/mod
30
+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
31
+ restore-keys : |
32
+ ${{ runner.os }}-go-
26
33
- name : build and test binary
27
34
run : make ci
28
- - name : docker build
29
- run : make local-docker-build
35
+ - name : GoReleaser Build
36
+ uses : goreleaser/goreleaser-action@v2
37
+ with :
38
+ distribution : goreleaser
39
+ version : latest
40
+ args : release --skip-publish --snapshot --rm-dist
Original file line number Diff line number Diff line change 21
21
uses : actions/setup-go@v2
22
22
with :
23
23
go-version : 1.17
24
+ - name : Cache Go modules
25
+ uses : actions/cache@v2
26
+ with :
27
+ path : ~/go/pkg/mod
28
+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
29
+ restore-keys : |
30
+ ${{ runner.os }}-go-
24
31
- name : Docker Login
25
32
uses : docker/login-action@v1
26
33
with :
Original file line number Diff line number Diff line change 2
2
.idea
3
3
4
4
# Build / CI artifacts
5
- bin
5
+ / ci-result-to-slack
6
6
coverage.out
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ project_name: ci-result-to-slack
2
2
builds :
3
3
- env : [CGO_ENABLED=0]
4
4
main : ./cmd/ci-result-to-slack
5
- binary : bin/ci-result-to-slack
6
5
goos :
7
6
- linux
8
7
- windows
Original file line number Diff line number Diff line change 1
1
FROM gcr.io/distroless/base-debian11
2
2
3
- COPY ./bin/ ci-result-to-slack /ci-result-to-slack
3
+ COPY ./ci-result-to-slack /ci-result-to-slack
4
4
5
5
ENTRYPOINT ["/ci-result-to-slack" ]
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ ci: build test
8
8
9
9
build : clean
10
10
@echo " Building..."
11
- CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -o bin/ $(BINARY_NAME ) ./cmd/$(BINARY_NAME ) /main.go
11
+ CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -o $(BINARY_NAME ) ./cmd/$(BINARY_NAME ) /main.go
12
12
13
13
test : clean
14
14
@echo " Running unit tests..."
23
23
24
24
clean :
25
25
@echo " Cleaning..."
26
- rm -rf ./bin/ $(BINARY_NAME )
26
+ rm -rf .$(BINARY_NAME )
27
27
rm -rf coverage.out
28
28
29
29
local-docker-test : # # Build and run unit tests in docker container like CI without building the container
You can’t perform that action at this time.
0 commit comments