1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-02-07 13:41:38 +02:00

Update release process to use makefile go version check (#1027)

Co-authored-by: Nick Meves <nick.meves@greenhouse.io>
This commit is contained in:
Joel Speed 2021-02-06 23:19:33 +00:00 committed by GitHub
parent c9d9769f6f
commit b97c83297e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 10 deletions

View File

@ -82,7 +82,7 @@ test: lint
GO111MODULE=on $(GO) test $(TESTCOVER) -v -race ./...
.PHONY: release
release: lint test
release: validate-go-version lint test
BINARY=${BINARY} VERSION=${VERSION} ./dist.sh
.PHONY: validate-go-version

11
dist.sh
View File

@ -7,13 +7,6 @@ if [[ -z ${BINARY} ]] || [[ -z ${VERSION} ]]; then
exit 1
fi
# Check for Go version 1.14.*
GO_VERSION=$(go version | awk '{print $3}')
if [[ ! "${GO_VERSION}" =~ ^go1.14.* ]]; then
echo "Go version must be >= go1.14"
exit 1
fi
ARCHS=(darwin-amd64 linux-amd64 linux-arm64 linux-armv6 freebsd-amd64 windows-amd64)
mkdir -p release
@ -28,10 +21,10 @@ for ARCH in "${ARCHS[@]}"; do
# Create architecture specific binaries
if [[ ${GO_ARCH} == "armv6" ]]; then
GO111MODULE=on GOOS=${GO_OS} GOARCH=arm GOARM=6 CGO_ENABLED=0 go build -ldflags="-X main.VERSION=${VERSION}" \
-o release/${BINARY}-${VERSION}.${ARCH}/${BINARY} github.com/oauth2-proxy/oauth2-proxy
-o release/${BINARY}-${VERSION}.${ARCH}/${BINARY} .
else
GO111MODULE=on GOOS=${GO_OS} GOARCH=${GO_ARCH} CGO_ENABLED=0 go build -ldflags="-X main.VERSION=${VERSION}" \
-o release/${BINARY}-${VERSION}.${ARCH}/${BINARY} github.com/oauth2-proxy/oauth2-proxy
-o release/${BINARY}-${VERSION}.${ARCH}/${BINARY} .
fi
cd release