Skip to content

Commit

Permalink
build(release): update goreleaser to v1.11.4
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 committed Sep 29, 2022
1 parent 17e54f0 commit af95296
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 26 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
53 changes: 32 additions & 21 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,25 +63,25 @@ 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-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
Expand All @@ -91,7 +100,9 @@ release: modvendor gen-changelog
-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

0 comments on commit af95296

Please sign in to comment.