From c640507a9d5eb8c8c36d4560b24701c9d1bbcb3d Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Thu, 21 May 2020 11:52:05 +0200 Subject: [PATCH] Add goreleaser configuration --- .goreleaser.yml | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 6 +++++ 2 files changed, 68 insertions(+) create mode 100644 .goreleaser.yml create mode 100644 Dockerfile diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..244bf2a --- /dev/null +++ b/.goreleaser.yml @@ -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:' diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..54508c0 --- /dev/null +++ b/Dockerfile @@ -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"]