Skip to content

Commit

Permalink
Build with go 1.20.4 (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc authored May 4, 2023
1 parent 8b3009d commit fa0e7d2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-binary-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.3
go-version: 1.20.4

- name: Build all versions
run: |
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ permissions:

jobs:
build:
strategy:
matrix:
go-version: ["1.20.3"]

name: "Build + tests"
runs-on: ubuntu-latest

Expand All @@ -25,10 +21,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up Go ${{ matrix.go-version }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
go-version: 1.20.4

- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.3
go-version: 1.20.4

- name: Cache virtualenvs
id: cache-pipenv
Expand Down
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
BUILD_REQUIRE_GO_MAJOR ?= 1
BUILD_REQUIRE_GO_MINOR ?= 20

GOCMD=go
GOBUILD=$(GOCMD) build
GOTEST=$(GOCMD) test
Expand All @@ -7,7 +10,7 @@ GO_MODULE_NAME=github.com/crowdsecurity/cs-firewall-bouncer
TARBALL_NAME=$(BINARY_NAME).tgz

ifdef BUILD_STATIC
$(warning WARNING: The BUILD_STATIC variable is deprecated and has no effect. Builds are static by default since v1.5.0.)
$(warning WARNING: The BUILD_STATIC variable is deprecated and has no effect. Builds are static by default now.)
endif

# Versioning information can be overridden in the environment
Expand Down Expand Up @@ -62,7 +65,7 @@ binary: goversion
$(GOBUILD) $(LD_OPTS) $(BUILD_VENDOR_FLAGS) -o $(BINARY_NAME)

.PHONY: build
build: goversion clean binary
build: clean binary

#
# Unit and integration tests
Expand All @@ -73,7 +76,7 @@ lint:
golangci-lint run

.PHONY: test
test:
test: goversion
@$(GOTEST) $(LD_OPTS) ./...

.PHONY: func-tests
Expand All @@ -87,7 +90,7 @@ func-tests: build

RELDIR = $(BINARY_NAME)-$(BUILD_VERSION)

# Called during release, to reuse the directory for other platforms
# Called during platform-all, to reuse the directory for other platforms
.PHONY: clean-release-dir
clean-release-dir:
@$(RM) -r $(RELDIR)
Expand Down Expand Up @@ -119,5 +122,4 @@ release: clean tarball
platform-all: goversion clean
python3 .github/release.py run-build $(BINARY_NAME)

# Check if go is the right version
include mk/goversion.mk
4 changes: 0 additions & 4 deletions mk/goversion.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@

BUILD_REQUIRE_GO_MAJOR ?= 1
BUILD_REQUIRE_GO_MINOR ?= 20

BUILD_GOVERSION = $(subst go,,$(shell go env GOVERSION))

go_major_minor = $(subst ., ,$(BUILD_GOVERSION))
Expand Down

0 comments on commit fa0e7d2

Please sign in to comment.