Skip to content

Commit

Permalink
chore: Pin goreleaser version
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed May 12, 2024
1 parent 6ff87d1 commit 4ad03d7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ env:
GOFUMPT_VERSION: 0.6.0
GOLANGCI_LINT_VERSION: 1.58.1
GOLINES_VERSION: 0.12.2
GORELEASER_VERSION: 1.26.0
GOVERSIONINFO_VERSION: 1.4.0
RAGE_VERSION: 0.10.0
jobs:
Expand Down Expand Up @@ -200,7 +201,7 @@ jobs:
if: github.event_name == 'push' || needs.changes.outputs.code == 'true'
uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811
with:
version: latest
version: ${{ env.GORELEASER_VERSION }}
args: release --skip=sign --snapshot --timeout=1h
- name: upload-artifact-chezmoi-darwin-amd64
if: github.event_name == 'push' || needs.changes.outputs.code == 'true'
Expand Down Expand Up @@ -423,7 +424,7 @@ jobs:
make create-syso
- uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811
with:
version: latest
version: ${{ env.GORELEASER_VERSION }}
args: release --timeout=1h
env:
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/bin/gofumpt
/bin/golines
/bin/golangci-lint
/bin/goreleaser
/bin/goversioninfo
/chezmoi
/chezmoi.exe
Expand Down
24 changes: 19 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ FIND_TYPOS_VERSION=$(shell awk '/FIND_TYPOS_VERSION:/ { print $$2 }' .github/wor
GOFUMPT_VERSION=$(shell awk '/GOFUMPT_VERSION:/ { print $$2 }' .github/workflows/main.yml)
GOLANGCI_LINT_VERSION=$(shell awk '/GOLANGCI_LINT_VERSION:/ { print $$2 }' .github/workflows/main.yml)
GOLINES_VERSION=$(shell awk '/GOLINES_VERSION:/ { print $$2 }' .github/workflows/main.yml)
GORELEASER_VERSION=$(shell awk '/GORELEASER_VERSION:/ { print $$2 }' .github/workflows/main.yml)
GOVERSIONINFO_VERSION=$(shell awk '/GOVERSIONINFO_VERSION:/ { print $$2 }' .github/workflows/main.yml)
ifdef VERSION
GO_LDFLAGS+=-X main.version=${VERSION}
Expand Down Expand Up @@ -137,7 +138,14 @@ create-syso: ensure-goversioninfo
./bin/goversioninfo -platform-specific

.PHONY: ensure-tools
ensure-tools: ensure-actionlint ensure-find-typos ensure-gofumpt ensure-golangci-lint ensure-golines ensure-goversioninfo
ensure-tools: \
ensure-actionlint \
ensure-find-typos \
ensure-gofumpt \
ensure-golangci-lint \
ensure-golines \
ensure-goreleaser \
ensure-goversioninfo

.PHONY: ensure-actionlint
ensure-actionlint:
Expand Down Expand Up @@ -180,15 +188,21 @@ ensure-golangci-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- v${GOLANGCI_LINT_VERSION} ; \
fi

.PHONY: ensure-goreleaser
ensure-goreleaser:
if [ ! -x bin/goreleaser ] || ( ./bin/goreleaser --version | grep -Fqv "${GORELEASER_VERSION}" ) ; then \
GOBIN=$(shell pwd)/bin ${GO} install "github.com/goreleaser/goreleaser@v${GORELEASER_VERSION}" ; \
fi

.PHONY: ensure-goversioninfo
ensure-goversioninfo:
if [ ! -x bin/goversioninfo ] ; then \
GOBIN=$(shell pwd)/bin ${GO} install "github.com/josephspurrier/goversioninfo/cmd/goversioninfo@v${GOVERSIONINFO_VERSION}" ; \
fi

.PHONY: release
release:
goreleaser release \
release: ensure-goreleaser
./bin/goreleaser release \
--clean \
${GORELEASER_FLAGS}

Expand All @@ -197,8 +211,8 @@ shellcheck:
find . -type f -name \*.sh | xargs shellcheck

.PHONY: test-release
test-release:
goreleaser release \
test-release: ensure-goreleaser
./bin/goreleaser release \
--clean \
--skip=chocolatey,sign \
--snapshot \
Expand Down

0 comments on commit 4ad03d7

Please sign in to comment.