Skip to content

Commit

Permalink
updated goreleaser (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckydev authored Dec 20, 2024
1 parent 38b38ee commit 4ea7ce5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version: 2
project_name: vergo
before:
hooks:
Expand Down Expand Up @@ -27,7 +28,7 @@ builds:
- -X "github.com/sky-uk/vergo/cmd.builtBy={{.Env.BUILT_BY}}"

snapshot:
name_template: "{{ .Env.GORELEASER_CURRENT_TAG }}"
version_template: "{{ .Env.GORELEASER_CURRENT_TAG }}"

archives:
- id: default
Expand Down
18 changes: 9 additions & 9 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.PHONY: fun-tests unit-tests test

export

GORELEASER_VERSION := 0.179.0
GORELEASER_VERSION := 2.3.0
LINTER_VERSION := 1.58.1
PATH := $(shell pwd)/bin:$(PATH)
SHELL := bash
ARCH := $(shell uname -m)
OS := $(shell uname -s)

.ONESHELL:
.SHELLFLAGS := -ec
Expand All @@ -31,7 +31,7 @@ bin/golangci-lint: bin
bin/goreleaser: bin
@test -f $@ ||
(
curl -fsL https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION}/goreleaser_`uname`_x86_64.tar.gz -o goreleaser.tgz
curl -fsL https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION}/goreleaser_${OS}_${ARCH}.tar.gz -o goreleaser.tgz
tar xvf goreleaser.tgz -C bin goreleaser
rm goreleaser.tgz
bin/goreleaser --version
Expand All @@ -53,7 +53,7 @@ release: release-test check-licenses test
BUILT_BY="`goreleaser --version | head -n1`, `go version`" \
GORELEASER_CURRENT_TAG=`bin/vergo get latest-release -p` \
GORELEASER_PREVIOUS_TAG=`bin/vergo get previous-release -p` \
goreleaser release --rm-dist
goreleaser release --clean
bin/vergo push

unit-tests: pre-check
Expand All @@ -72,10 +72,10 @@ test-compile:
build: pre-check
BUILT_BY="`goreleaser --version | head -n1`, `go version`" \
GORELEASER_CURRENT_TAG=0+`git rev-parse --short HEAD` \
goreleaser build --snapshot --rm-dist
@dist/vergo_`uname | tr A-Z a-z`_amd64/vergo version
@cp dist/vergo_`uname | tr A-Z a-z`_amd64/vergo bin/vergo
@cp dist/vergo_`uname | tr A-Z a-z`_amd64/vergo /usr/local/bin/vergo 2>/dev/null || true
goreleaser build --snapshot --clean
@dist/vergo_`uname | tr A-Z a-z`_${ARCH}/vergo version
@cp dist/vergo_`uname | tr A-Z a-z`_${ARCH}/vergo bin/vergo
@cp dist/vergo_`uname | tr A-Z a-z`_${ARCH}/vergo /usr/local/bin/vergo 2>/dev/null || true

dependency-updates:
@go list -u -f '{{if (and (not (or .Main .Indirect)) .Update)}}{{.Path}}: {{.Version}} -> {{.Update.Version}}{{end}}' -m all
Expand Down

0 comments on commit 4ea7ce5

Please sign in to comment.