From 09fc4b4111d6c19b059aece305f07c212f995db2 Mon Sep 17 00:00:00 2001 From: Artur Troian Date: Tue, 4 Oct 2022 11:20:10 -0400 Subject: [PATCH] build(release): update goreleaser to v1.11.4 (#25) release binaries w/ and wo/ version in the file name Signed-off-by: Artur Troian --- .env | 4 +-- .github/workflows/release.yaml | 3 ++- .goreleaser.yaml | 25 +++++++++++++++++-- cluster/hostname.go | 6 ++--- cluster/kube/inventory_test.go | 9 ++++--- make/releasing.mk | 36 +++++++++++---------------- pkg/apis/akash.network/v1/doc.go | 25 +++++++++---------- pkg/apis/akash.network/v2beta1/doc.go | 25 +++++++++---------- testutil/provider/provider.go | 15 ++++++----- version/version.go | 12 ++++----- 10 files changed, 85 insertions(+), 75 deletions(-) diff --git a/.env b/.env index e75d20c0c..ed5f8dea5 100644 --- a/.env +++ b/.env @@ -1,7 +1,7 @@ -GOLANG_VERSION=1.18.3 +GOLANG_VERSION=1.19.1 KIND_VERSION=0.14.0 KINDEST_VERSION=v1.22.2 -GORELEASER_VERSION=v1.6.3 +GORELEASER_VERSION=v1.11.4 GO111MODULE=on ROOT_DIR=${AP_ROOT} AP_DEVCACHE_BASE=${AP_ROOT}/.cache diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7bdcfe8a1..91f7bb292 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -37,7 +37,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/provider-services' @@ -46,5 +46,6 @@ jobs: sudo rm -rf dist make release env: + GORELEASER_RELEASE: true RELEASE_TAG: ${{ steps.branch_name.outputs.RELEASE_TAG }} GITHUB_TOKEN: ${{ secrets.GORELEASER_ACCESS_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 330b0ee1d..ac824f22b 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -37,8 +37,9 @@ universal_binaries: ids: - provider-services-darwin replace: true + name_template: "{{.ProjectName}}" archives: - - id: provider-services + - id: provider-services-version builds: - darwin-universal - provider-services-linux @@ -47,6 +48,15 @@ archives: format: zip files: - none* + - id: provider-services + builds: + - darwin-universal + - provider-services-linux + name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" + wrap_in_directory: true + format: zip + files: + - none* dockers: - dockerfile: Dockerfile @@ -100,9 +110,20 @@ docker_manifests: - ghcr.io/ovrclk/{{ .ProjectName }}:latest-arm64 nfpms: - - vendor: "Overclock Labs Inc." + - id: w/version + vendor: "Overclock Labs Inc." + homepage: "https://ovrclk.com" + maintainer: "Overclock Labs Inc. " + file_name_template: "{{ .ConventionalFileName }}" + 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 diff --git a/cluster/hostname.go b/cluster/hostname.go index b0f5f3ba2..739ea92eb 100644 --- a/cluster/hostname.go +++ b/cluster/hostname.go @@ -15,10 +15,8 @@ import ( "github.com/pkg/errors" ) -/** -This type exists to identify the target of a reservation. The lease ID type is not used directly because -there is no need to consider order ID or provider ID for the purposes oft this -*/ +// hostnameID type exists to identify the target of a reservation. The lease ID type is not used directly because +// there is no need to consider order ID or provider ID for the purposes oft this type hostnameID struct { owner sdktypes.Address dseq uint64 diff --git a/cluster/kube/inventory_test.go b/cluster/kube/inventory_test.go index 706ad0104..04866b078 100644 --- a/cluster/kube/inventory_test.go +++ b/cluster/kube/inventory_test.go @@ -514,10 +514,11 @@ func TestInventoryMultipleReplicasOutOfCapacity4(t *testing.T) { } // multipleReplicasGenNodes generates four nodes with following CPUs available -// node1: 68780 -// node2: 68800 -// node3: 119525 -// node4: 119495 +// +// node1: 68780 +// node2: 68800 +// node3: 119525 +// node4: 119495 func multipleReplicasGenNodes() []v1.Node { nodeCapacity := make(v1.ResourceList) nodeCapacity[v1.ResourceCPU] = *(resource.NewMilliQuantity(119800, resource.DecimalSI)) diff --git a/make/releasing.mk b/make/releasing.mk index a37070f90..ec22abe4e 100644 --- a/make/releasing.mk +++ b/make/releasing.mk @@ -1,7 +1,16 @@ -GORELEASER_SKIP_VALIDATE ?= false +GORELEASER_RELEASE ?= false GORELEASER_DEBUG ?= false GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser:$(GORELEASER_VERSION) +ifeq ($(GORELEASER_RELEASE),true) + GORELEASER_SKIP_VALIDATE := false + GORELEASER_SKIP_PUBLISH := release --skip-publish=false +else + GORELEASER_SKIP_PUBLISH := --skip-publish=true + GORELEASER_SKIP_VALIDATE ?= false + GITHUB_TOKEN= +endif + ifeq ($(OS),Windows_NT) $(error Windows, really?) else @@ -54,26 +63,6 @@ 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 \ - -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)" \ - -v /var/run/docker.sock:/var/run/docker.sock $(AKASH_BIND_LOCAL) \ - -v $(shell pwd):/go/src/$(GO_MOD_NAME) \ - -w /go/src/$(GO_MOD_NAME) \ - $(GORELEASER_IMAGE) \ - -f "$(GORELEASER_CONFIG)" \ - --skip-validate=$(GORELEASER_SKIP_VALIDATE) \ - --debug=$(GORELEASER_DEBUG) \ - --rm-dist \ - --skip-publish \ - --release-notes=/go/src/$(GO_MOD_NAME)/.cache/changelog.md - .PHONY: release release: modvendor gen-changelog docker run \ @@ -87,11 +76,14 @@ release: modvendor gen-changelog -e HOMEBREW_NAME="$(GORELEASER_HOMEBREW_NAME)" \ -e HOMEBREW_CUSTOM="$(GORELEASER_HOMEBREW_CUSTOM)" \ -e GITHUB_TOKEN="$(GITHUB_TOKEN)" \ + -e GORELEASER_CURRENT_TAG="$(RELEASE_TAG)" \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $(shell 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/$(GO_MOD_NAME)/.cache/changelog.md diff --git a/pkg/apis/akash.network/v1/doc.go b/pkg/apis/akash.network/v1/doc.go index ad2a21f58..080f98cb6 100644 --- a/pkg/apis/akash.network/v1/doc.go +++ b/pkg/apis/akash.network/v1/doc.go @@ -8,18 +8,17 @@ // Contains the Stack Definition Language(pkg: github.com/ovrclk/akash/sdl) Manifest // declarations which are written to Kubernetes CRDs for storage. // -// Manifest { -// ManifestSpec { -// k8s.TypeMeta -// LeaseID -// ManifestGroup +// Manifest { +// ManifestSpec { // k8s.TypeMeta -// Name -// []*ManifestService -// ManifestService analogous to a running container. -// ManifestStatus -// State -// Message -// } -// +// LeaseID +// ManifestGroup +// k8s.TypeMeta +// Name +// []*ManifestService +// ManifestService analogous to a running container. +// ManifestStatus +// State +// Message +// } package v1 diff --git a/pkg/apis/akash.network/v2beta1/doc.go b/pkg/apis/akash.network/v2beta1/doc.go index 9a228a727..be4052541 100644 --- a/pkg/apis/akash.network/v2beta1/doc.go +++ b/pkg/apis/akash.network/v2beta1/doc.go @@ -8,18 +8,17 @@ // Contains the Stack Definition Language(pkg: github.com/ovrclk/akash/sdl) Manifest // declarations which are written to Kubernetes CRDs for storage. // -// Manifest { -// ManifestSpec { -// k8s.TypeMeta -// LeaseID -// ManifestGroup +// Manifest { +// ManifestSpec { // k8s.TypeMeta -// Name -// []*ManifestService -// ManifestService analogous to a running container. -// ManifestStatus -// State -// Message -// } -// +// LeaseID +// ManifestGroup +// k8s.TypeMeta +// Name +// []*ManifestService +// // ManifestService analogous to a running container. +// ManifestStatus +// State +// Message +// } package v2beta1 diff --git a/testutil/provider/provider.go b/testutil/provider/provider.go index 3e40826dc..2e785237e 100644 --- a/testutil/provider/provider.go +++ b/testutil/provider/provider.go @@ -40,14 +40,13 @@ func releaseCmdLock() { cmdLock <- struct{}{} } -/* -TestSendManifest for integration testing -this is similar to cli command exampled below -akash provider send-manifest --owner
\ - --dseq 7 \ - --provider
./../_run/kube/deployment.yaml \ - --home=/tmp/akash_integration_TestE2EApp_324892307/.akashctl --node=tcp://0.0.0.0:41863 -*/ +// TestSendManifest for integration testing +// this is similar to cli command exampled below +// +// akash provider send-manifest --owner
\ +// --dseq 7 \ +// --provider
./../_run/kube/deployment.yaml \ +// --home=/tmp/akash_integration_TestE2EApp_324892307/.akashctl --node=tcp://0.0.0.0:41863 func TestSendManifest(clientCtx client.Context, id mtypes.BidID, sdlPath string, extraArgs ...string) (sdktest.BufferWriter, error) { args := []string{ fmt.Sprintf("--dseq=%v", id.DSeq), diff --git a/version/version.go b/version/version.go index c47ce651b..09559392e 100644 --- a/version/version.go +++ b/version/version.go @@ -4,17 +4,17 @@ // produces apps versioning information based on flags // passed at compile time. // -// Configure the version command +// # Configure the version command // // The version command can be just added to your cobra root command. // At build time, the variables Name, Version, Commit, and BuildTags // can be passed as build flags as shown in the following example: // -// go build -X github.com/ovrclk/provider-services/version.Name=provider-services \ -// -X github.com/ovrclk/provider-services/version.AppName=provider-services \ -// -X github.com/ovrclk/provider-services/version.Version=1.0 \ -// -X github.com/ovrclk/provider-services/version.Commit=f0f7b7dab7e36c20b757cebce0e8f4fc5b95de60 \ -// -X "github.com/ovrclk/provider-services/version.BuildTags=linux darwin amd64" +// go build -X github.com/ovrclk/provider-services/version.Name=provider-services \ +// -X github.com/ovrclk/provider-services/version.AppName=provider-services \ +// -X github.com/ovrclk/provider-services/version.Version=1.0 \ +// -X github.com/ovrclk/provider-services/version.Commit=f0f7b7dab7e36c20b757cebce0e8f4fc5b95de60 \ +// -X "github.com/ovrclk/provider-services/version.BuildTags=linux darwin amd64" package version import (