From 20a64061c611cfcbaf3e7bb43436e9fbc82808ec Mon Sep 17 00:00:00 2001 From: Alessandro Sebastiani Date: Tue, 6 Oct 2020 18:19:37 +0200 Subject: [PATCH] feat: goreleaser configuration --- .goreleaser.yml | 48 +++++++++++++++++++++++++++++++++++++++++++ Dockerfile.goreleaser | 6 ++++++ 2 files changed, 54 insertions(+) create mode 100644 .goreleaser.yml create mode 100644 Dockerfile.goreleaser diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..c441fe8 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,48 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +before: + hooks: + - go mod download +builds: +- + id: publiccode-validator + binary: publiccode-validator + main: ./src + ldflags: + - -s -w -X main.version={{.Version}} -X main.date={{.Date}} + env: + - CGO_ENABLED=0 + # https://github.com/italia/publiccode-parser-go/issues/50 + ignore: + - goos: darwin + goarch: 386 +archives: +- replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' +dockers: + - + goos: linux + goarch: amd64 + binaries: + - publiccode-validator + builds: + - publiccode-validator + skip_push: false + dockerfile: Dockerfile.goreleaser + image_templates: + - "italia/publiccode-validator:latest" + - "italia/publiccode-validator:{{ .Tag }}" diff --git a/Dockerfile.goreleaser b/Dockerfile.goreleaser new file mode 100644 index 0000000..2029782 --- /dev/null +++ b/Dockerfile.goreleaser @@ -0,0 +1,6 @@ +FROM alpine + +COPY publiccode-validator / + +# Run the compiled binary. +CMD ["/publiccode-validator"] \ No newline at end of file