Skip to content

Commit 7e42e91

Browse files
Fixing publish action (#5)
* Setting overwrite to true on go publisher * Fixing publish action
1 parent 0a4670a commit 7e42e91

File tree

5 files changed

+1611
-19
lines changed

5 files changed

+1611
-19
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,11 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
15-
goos: [linux, windows, darwin]
16-
goarch: ["386", amd64, arm64]
17-
exclude:
18-
- goarch: "386"
19-
goos: darwin
20-
- goarch: arm64
21-
goos: windows
14+
goos: [linux, darwin]
15+
goarch: [amd64, arm64]
2216
steps:
2317
- uses: actions/checkout@v3
24-
- uses: wangyoucao577/go-release-action@v1.35
18+
- uses: wangyoucao577/go-release-action@v1.28
2519
with:
2620
github_token: ${{ secrets.GITHUB_TOKEN }}
2721
goos: ${{ matrix.goos }}

Makefile

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,60 @@
11
# Go parameters
22
GOCMD=GO111MODULE=on go
33
GOBUILD=$(GOCMD) build
4+
GOBUILDRACE=$(GOCMD) build -race
45
GOINSTALL=$(GOCMD) install
56
GOCLEAN=$(GOCMD) clean
67
GOTEST=$(GOCMD) test
78
GOGET=$(GOCMD) get
89
GOMOD=$(GOCMD) mod
910
GOFMT=$(GOCMD) fmt
11+
BIN_NAME=pubsub-sub-bench
12+
DISTDIR = ./dist
1013

11-
.PHONY: all test coverage
12-
all: test coverage build
14+
# Build-time GIT variables
15+
ifeq ($(GIT_SHA),)
16+
GIT_SHA:=$(shell git rev-parse HEAD)
17+
endif
18+
19+
ifeq ($(GIT_DIRTY),)
20+
GIT_DIRTY:=$(shell git diff --no-ext-diff 2> /dev/null | wc -l)
21+
endif
22+
23+
LDFLAGS = "-X 'main.GitSHA1=$(GIT_SHA)' -X 'main.GitDirty=$(GIT_DIRTY)'"
24+
25+
.PHONY: all test coverage build checkfmt fmt
26+
all: test coverage build checkfmt fmt
1327

1428
build:
15-
$(GOBUILD) .
29+
$(GOBUILD) \
30+
-ldflags=$(LDFLAGS) .
31+
32+
build-race:
33+
$(GOBUILDRACE) \
34+
-ldflags=$(LDFLAGS) .
35+
36+
checkfmt:
37+
@echo 'Checking gofmt';\
38+
bash -c "diff -u <(echo -n) <(go fmt .)";\
39+
EXIT_CODE=$$?;\
40+
if [ "$$EXIT_CODE" -ne 0 ]; then \
41+
echo '$@: Go files must be formatted with gofmt'; \
42+
fi && \
43+
exit $$EXIT_CODE
44+
45+
lint:
46+
$(GOGET) github.com/golangci/golangci-lint/cmd/golangci-lint
47+
golangci-lint run
48+
49+
fmt:
50+
$(GOFMT) .
1651

1752
get:
1853
$(GOGET) -t -v ./...
1954

20-
fmt:
55+
test: get
2156
$(GOFMT) ./...
22-
23-
test: get fmt
24-
$(GOTEST) -count=1 ./...
57+
$(GOTEST) -race -covermode=atomic ./...
2558

2659
coverage: get test
2760
$(GOTEST) -race -coverprofile=coverage.txt -covermode=atomic .
28-

go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ module github.com/RedisLabs/pubsub-sub-bench
22

33
go 1.13
44

5-
require github.com/mediocregopher/radix/v3 v3.5.2
5+
require (
6+
github.com/golangci/golangci-lint v1.50.1 // indirect
7+
github.com/mediocregopher/radix/v3 v3.5.2
8+
)

0 commit comments

Comments
 (0)