Skip to content

Commit

Permalink
Add goreleaser configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
legal90 committed May 21, 2020
1 parent 1c6b46c commit c640507
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

project_name: awscurl

before:
hooks:
- go mod download

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
ignore:
- goos: windows
goarch: 386
- goos: darwin
goarch: 386

archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip

checksum:
name_template: 'checksums.txt'

dockers:
- image_templates:
- 'legal90/{{.ProjectName}}:{{ .Tag }}'
- 'legal90/{{.ProjectName}}:latest'
dockerfile: Dockerfile
binaries:
- '{{.ProjectName}}'
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
# Skips the docker push. Could be useful if you also do draft releases.
# If set to auto, the release will not be pushed to the docker repository
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1
# Defaults to false.
skip_push: auto

snapshot:
name_template: "{{ .Tag }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This Dockerfile is supposed to be used by the `goreleaser` tool
# We don't build any go files in the docker build phase
# and just merely copy the binary to a scratch image
FROM scratch
COPY awscurl /bin/awscurl
ENTRYPOINT ["/bin/awscurl"]

0 comments on commit c640507

Please sign in to comment.