Skip to content

Commit

Permalink
update goreleaser to the latest version supporting go 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Oct 27, 2023
1 parent 60181eb commit 216e705
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 12 deletions.
46 changes: 37 additions & 9 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
project_name: cronn
dist: .bin
builds:
- env:
- id: cronn
binary: "cronn"
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
- freebsd
goarch:
- amd64
- arm
Expand All @@ -15,24 +18,49 @@ builds:
goarch: arm
- goos: freebsd
goarch: arm64
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
dir: app
ldflags: "-s -w -X main.revision={{.Tag}}-{{.ShortCommit}}-{{.CommitDate}}"

archives:
- name_template: "{{.ProjectName}}_{{.Tag}}_{{.Os}}_{{.Arch}}"
replacements:
386: i386
amd64: x86_64
darwin: macos
- id: cronn
name_template: >-
{{.ProjectName}}_
{{- .Tag}}_
{{- if eq .Os "darwin"}}macos
{{- else if eq .Os "windows"}}win
{{- else}}{{.Os}}{{end}}_
{{- if eq .Arch "amd64"}}x86_64
{{- else if eq .Arch "386"}}i386
{{- else}}{{.Arch}}{{end}}
format_overrides:
- goos: windows
format: zip
files:
- LICENSE
- README.md
rlcp: true

nfpms:
brews:
-
name: cronn
tap:
owner: umputun
name: homebrew-apps
branch: master
commit_author:
name: umputun
email: umputun@gmail.com
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
homepage: "https://cronn.umputun.dev"
description: "Cronn is a crontab jobs scheduler with some nice extras. It allows to run commands on specified time intervals and can be used directly as well as from a container."
license: "MIT"

nfpms:
- id: cronn
package_name: cronn
file_name_template: "{{.ProjectName}}_{{.Tag}}_{{.Os}}_{{.Arch}}"
vendor: Umputun
Expand All @@ -53,4 +81,4 @@ nfpms:
dst: /etc/cronntab
scripts:
postinstall: "scripts/postinstall.sh"
preremove: "scripts/preremove.sh"
preremove: "scripts/preremove.sh"
5 changes: 3 additions & 2 deletions Dockerfile.artifacts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM goreleaser/goreleaser:v1.10.3 as build
FROM goreleaser/goreleaser:v1.21.2 as build

WORKDIR /build
ADD . /build

RUN goreleaser --snapshot --skip-publish --rm-dist
RUN ls -la /build/.bin/*

FROM alpine
COPY --from=build /build/dist/ /dist/
COPY --from=build /build/.bin/ /dist/
RUN \
mkdir -p /artifacts && \
cp /dist/*.gz /artifacts/ && \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ docker:

dist:
- @mkdir -p dist
docker build -f Dockerfile.artifacts -t cronn.bin .
docker build -f Dockerfile.artifacts -t cronn.bin --progress=plain .
- @docker rm -f cronn.bin 2>/dev/null || exit 0
docker run -d --name=cronn.bin cronn.bin
docker cp cronn.bin:/artifacts dist/
Expand Down

0 comments on commit 216e705

Please sign in to comment.