Skip to content

Commit

Permalink
build(release): update goreleaser to v1.11.4 (#25)
Browse files Browse the repository at this point in the history
release binaries w/ and wo/ version in the file name

Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian authored Oct 4, 2022
1 parent 17e54f0 commit 09fc4b4
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 75 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 }}
25 changes: 23 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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. <[email protected]>"
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. <[email protected]>"
file_name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
formats:
- deb
- rpm
Expand Down
6 changes: 2 additions & 4 deletions cluster/hostname.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions cluster/kube/inventory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
36 changes: 14 additions & 22 deletions make/releasing.mk
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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
25 changes: 12 additions & 13 deletions pkg/apis/akash.network/v1/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 12 additions & 13 deletions pkg/apis/akash.network/v2beta1/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 7 additions & 8 deletions testutil/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 <address> \
--dseq 7 \
--provider <address> ./../_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 <address> \
// --dseq 7 \
// --provider <address> ./../_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),
Expand Down
12 changes: 6 additions & 6 deletions version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 09fc4b4

Please sign in to comment.