attempt to build release artifacts in CI (using updated Go version)

most of this is stolen from the 3.x branch

for building the release artifacts I removed the restriction of only
master branch, so we should be able to see if it works before the PR
is merged.
This commit is contained in:
Matthew Jaffee 2021-09-09 09:09:53 -05:00
parent 6a05e78066
commit 909e159aaa
3 changed files with 35 additions and 3 deletions

View file

@ -132,12 +132,23 @@ jobs:
- checkout-plus
- attach_workspace:
at: .
- run: make release
- setup_remote_docker:
version: 19.03.13 # see https://support.circleci.com/hc/en-us/articles/360050934711
- run: echo -n $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin
- run: make docker-release
- store_artifacts:
path: build
- persist_to_workspace:
root: .
paths: build
publish_release:
executor:
name: golang
steps:
- attach_workspace:
at: .
- run: go get github.com/tcnksm/ghr
- run: ghr -t ${GITHUB_PERSONAL_ACCESS_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} ./build/
prerelease-upload:
docker:
- image: circleci/python:2.7-jessie
@ -237,6 +248,22 @@ workflows:
- linter
- check-license-headers
- test-golang-1.15.5
- release:
context: molecula
requires:
- setup
filters:
tags:
only: /^v.*/
- publish_release:
context: molecula
requires:
- release
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- dockerhub-upload-unstable:
context: molecula
requires:

View file

@ -1,4 +1,4 @@
FROM golang:1.14.10 as builder
FROM golang:latest as builder
ARG BUILD_FLAGS
ARG MAKE_FLAGS

View file

@ -12,7 +12,7 @@ BUILD_TIME := $(shell date -u +%FT%T%z)
SHARD_WIDTH = 20
COMMIT := $(shell git describe --exact-match >/dev/null 2>&1 || git rev-parse --short HEAD)
LDFLAGS="-X github.com/pilosa/pilosa/v2.Version=$(VERSION) -X github.com/pilosa/pilosa/v2.BuildTime=$(BUILD_TIME) -X github.com/pilosa/pilosa/v2.Variant=$(VARIANT) -X github.com/pilosa/pilosa/v2.Commit=$(COMMIT) -X github.com/pilosa/pilosa/v2.LatticeCommit=$(LATTICE_COMMIT)"
GO_VERSION=1.14.10
GO_VERSION=1.16.7
RELEASE ?= 0
RELEASE_ENABLED = $(subst 0,,$(RELEASE))
BUILD_TAGS += $(if $(RELEASE_ENABLED),release)
@ -205,6 +205,11 @@ docker-tag-push: vendor
docker push $(DOCKER_TARGET)
@echo Pushed docker image: $(DOCKER_TARGET)
docker-release: check-clean generate-statik
$(MAKE) docker-build GOOS=linux GOARCH=amd64
$(MAKE) docker-build GOOS=darwin GOARCH=amd64
$(MAKE) docker-build GOOS=darwin GOARCH=arm64
# Compile Pilosa inside Docker container
docker-build: vendor
docker run --rm -v $(PWD):/go/src/$(CLONE_URL) -w /go/src/$(CLONE_URL) -e GOOS=$(GOOS) -e GOARCH=$(GOARCH) golang:$(GO_VERSION) make build FLAGS="$(FLAGS) -mod=vendor" RELEASE=$(RELEASE)