Skip to content

Commit

Permalink
build(release): update goreleaser-cross v1.19.1
Browse files Browse the repository at this point in the history
release darwin universal binaries

Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed Sep 29, 2022
1 parent 03749e3 commit 007032a
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -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}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 }}
48 changes: 44 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 <[email protected]>"
formats:
- deb
- rpm
license: Apache 2.0
- id: wo/version
vendor: "Overclock Labs Inc."
homepage: "https://ovrclk.com"
maintainer: "Overclock Labs Inc. <[email protected]>"
file_name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
formats:
- deb
- rpm
license: Apache 2.0

release:
github:
Expand Down
2 changes: 2 additions & 0 deletions make/init.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

Expand Down
54 changes: 20 additions & 34 deletions make/releasing.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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

0 comments on commit 007032a

Please sign in to comment.