From 007032ab1fc4d0e204b2c88817c61f19028ddc8d Mon Sep 17 00:00:00 2001 From: Artur Troian Date: Thu, 29 Sep 2022 13:13:23 -0400 Subject: [PATCH] build(release): update goreleaser-cross v1.19.1 release darwin universal binaries Signed-off-by: Artur Troian --- .env | 2 +- .github/workflows/release.yaml | 4 ++- .goreleaser.yaml | 48 +++++++++++++++++++++++++++--- make/init.mk | 2 ++ make/releasing.mk | 54 +++++++++++++--------------------- 5 files changed, 70 insertions(+), 40 deletions(-) diff --git a/.env b/.env index 6b862600db..fc47292491 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ -GOLANG_VERSION=1.17.6 +GOLANG_VERSION=1.19.1 KIND_VERSION=0.11.1 GO111MODULE=on ROOT_DIR=${AKASH_ROOT} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7e2674ced4..e39668d14f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -39,7 +39,7 @@ jobs: run: make release-dry-run GORELEASER_SKIP_VALIDATE=true - if: startsWith(github.ref,'refs/tags/v') name: release dry-run - run: make release-dry-run + run: make release env: RELEASE_TAG: ${{ steps.branch_name.outputs.RELEASE_TAG }} - if: startsWith(github.ref,'refs/tags/v') && github.repository == 'ovrclk/akash' @@ -54,5 +54,7 @@ jobs: sudo rm -rf dist make release env: + GORELEASER_RELEASE: true MAINNET: ${{ steps.branch_name.outputs.MAINNET }} RELEASE_TAG: ${{ steps.branch_name.outputs.RELEASE_TAG }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index d1474d85cf..5e3daeb733 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -95,11 +95,17 @@ builds: - "{{ .Env.BUILD_VARS }}" - "{{ .Env.STRIP_FLAGS }}" - "-linkmode={{ .Env.LINKMODE }}" -archives: - - id: akash - builds: +universal_binaries: + - id: akash-darwin-universal + ids: - akash-darwin-amd64 - akash-darwin-arm64 + replace: true + name_template: "{{.ProjectName}}" +archives: + - id: w/version + builds: + - akash-darwin-universal - akash-linux-amd64 - akash-linux-arm64 - akash-windows-amd64 @@ -108,6 +114,30 @@ archives: format: zip files: - none* + - id: wo/version + builds: + - akash-darwin-universal + - akash-linux-amd64 + - akash-linux-arm64 + - akash-windows-amd64 + name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" + wrap_in_directory: true + format: zip + files: + - none* +brews: + - name: "{{ .Env.HOMEBREW_NAME }}" + ids: + - wo/version + tap: + owner: ovrclk + name: homebrew-tap + homepage: "https://akash.network" + description: "Blockchain-powered decentralized compute platform" + custom_block: | + {{ .Env.HOMEBREW_CUSTOM }} + install: | + bin.install "akash" dockers: - dockerfile: _build/Dockerfile.akash @@ -159,13 +189,23 @@ docker_manifests: - ghcr.io/ovrclk/{{ .ProjectName }}:latest-arm64 nfpms: - - vendor: "Overclock Labs Inc." + - id: w/version + vendor: "Overclock Labs Inc." homepage: "http://ovrclk.com" maintainer: "Akash Network " formats: - deb - rpm license: Apache 2.0 + - id: wo/version + vendor: "Overclock Labs Inc." + homepage: "https://ovrclk.com" + maintainer: "Overclock Labs Inc. " + file_name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" + formats: + - deb + - rpm + license: Apache 2.0 release: github: diff --git a/make/init.mk b/make/init.mk index ef1f66790a..b573f0ca8a 100644 --- a/make/init.mk +++ b/make/init.mk @@ -11,6 +11,8 @@ BINS := $(AKASH) GO := GO111MODULE=$(GO111MODULE) go +GO_MOD_NAME := $(shell go list -m 2>/dev/null) + # setup .cache bins first in paths to have precedence over already installed same tools for system wide use PATH := "$(PATH):$(AKASH_DEVCACHE_BIN):$(AKASH_DEVCACHE_NODE_BIN)" diff --git a/make/releasing.mk b/make/releasing.mk index dcbdf7ba77..6ec237ea8e 100644 --- a/make/releasing.mk +++ b/make/releasing.mk @@ -3,6 +3,17 @@ GORELEASER_DEBUG ?= false GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser-cross:v$(GOLANG_VERSION) GON_CONFIGFILE ?= gon.json +ifeq ($(GORELEASER_RELEASE),true) + GORELEASER_SKIP_VALIDATE := false + GORELEASER_SKIP_PUBLISH := release --skip-publish=false + GORELEASER_RELEASE_ENV := --env-file .release-env +else + GORELEASER_SKIP_PUBLISH := --skip-publish=true + GORELEASER_SKIP_VALIDATE ?= false + GORELEASER_RELEASE_ENV := + GITHUB_TOKEN= +endif + ifeq ($(OS),Windows_NT) DETECTED_OS := Windows else @@ -61,37 +72,8 @@ docker-image: gen-changelog: $(GIT_CHGLOG) @echo "generating changelog to .cache/changelog" ./script/genchangelog.sh "$(RELEASE_TAG)" .cache/changelog.md - -.PHONY: release-dry-run -release-dry-run: modvendor gen-changelog - docker run \ - --rm \ - --privileged \ - -e STABLE=$(IS_STABLE) \ - -e MOD="$(GO_MOD)" \ - -e BUILD_TAGS="$(BUILD_TAGS)" \ - -e BUILD_VARS="$(GORELEASER_BUILD_VARS)" \ - -e STRIP_FLAGS="$(GORELEASER_STRIP_FLAGS)" \ - -e LINKMODE="$(GO_LINKMODE)" \ - -e HOMEBREW_NAME="$(GORELEASER_HOMEBREW_NAME)" \ - -e HOMEBREW_CUSTOM="$(GORELEASER_HOMEBREW_CUSTOM)" \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v `pwd`:/go/src/github.com/ovrclk/akash \ - -w /go/src/github.com/ovrclk/akash \ - $(GORELEASER_IMAGE) \ - -f "$(GORELEASER_CONFIG)" \ - --skip-validate=$(GORELEASER_SKIP_VALIDATE) \ - --debug=$(GORELEASER_DEBUG) \ - --rm-dist \ - --skip-publish \ - --release-notes=/go/src/github.com/ovrclk/akash/.cache/changelog.md - .PHONY: release release: modvendor gen-changelog - @if [ ! -f ".release-env" ]; then \ - echo "\033[91m.release-env is required for release\033[0m";\ - exit 1;\ - fi docker run \ --rm \ --privileged \ @@ -103,12 +85,16 @@ release: modvendor gen-changelog -e LINKMODE="$(GO_LINKMODE)" \ -e HOMEBREW_NAME="$(GORELEASER_HOMEBREW_NAME)" \ -e HOMEBREW_CUSTOM="$(GORELEASER_HOMEBREW_CUSTOM)" \ - --env-file .release-env \ + -e GITHUB_TOKEN="$(GITHUB_TOKEN)" \ + -e GORELEASER_CURRENT_TAG="$(RELEASE_TAG)" \ + $(GORELEASER_RELEASE_ENV) \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v `pwd`:/go/src/github.com/ovrclk/akash \ - -w /go/src/github.com/ovrclk/akash \ + -v `pwd`:/go/src/$(GO_MOD_NAME) \ + -w /go/src/$(GO_MOD_NAME) \ $(GORELEASER_IMAGE) \ - -f "$(GORELEASER_CONFIG)" release \ + -f "$(GORELEASER_CONFIG)" \ + $(GORELEASER_SKIP_PUBLISH) \ + --skip-validate=$(GORELEASER_SKIP_VALIDATE) \ --debug=$(GORELEASER_DEBUG) \ --rm-dist \ - --release-notes=/go/src/github.com/ovrclk/akash/.cache/changelog.md + --release-notes=/go/src/$(GO_MOD_NAME)/.cache/changelog.md