From f3d54599359be482dbea81c46dc1b538cf28621a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Ruiz?= Date: Mon, 8 Apr 2024 09:06:20 +0200 Subject: [PATCH] feat: setup release --- .gitignore | 2 ++ .goreleaser.yaml | 79 ++++++++++++++++++++++++++++++++++++++++++++++++ build/Dockerfile | 3 ++ go.mod | 8 +++-- go.sum | 5 +-- 5 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 .gitignore create mode 100644 .goreleaser.yaml create mode 100644 build/Dockerfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cde0123 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..e749360 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,79 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines below are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 1 + +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy + +builds: + - main: ./cmd/omnivore-as-rss/omnivore-as-rss.go + env: + - CGO_ENABLED=0 + binary: omnivore-to-rss + goos: + - linux + - windows + - darwin + goarch: + - arm + - amd64 + goarm: + - 7 + +dockers: +- image_templates: + - "rruizt/omnivore-to-rss:{{ .Version }}-amd64" + use: buildx + dockerfile: build/Dockerfile + build_flag_templates: + - "--platform=linux/amd64" + +- image_templates: + - "rruizt/omnivore-to-rss:{{ .Version }}-armv7" + use: buildx + goarch: arm + goarm: 7 + dockerfile: build/Dockerfile + build_flag_templates: + - "--platform=linux/arm/v7" + +docker_manifests: +- name_template: "rruizt/omnivore-to-rss:{{ .Version }}" + image_templates: + - "rruizt/omnivore-to-rss:{{ .Version }}-amd64" + - "rruizt/omnivore-to-rss:{{ .Version }}-armv7" +- name_template: "rruizt/omnivore-to-rss:latest" + image_templates: + - "rruizt/omnivore-to-rss:{{ .Version }}-amd64" + - "rruizt/omnivore-to-rss:{{ .Version }}-armv7" + + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" diff --git a/build/Dockerfile b/build/Dockerfile new file mode 100644 index 0000000..bba6a2b --- /dev/null +++ b/build/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine +ENTRYPOINT [ "usr/bin/omnivore-to-rss" ] +COPY omnivore-to-rss /usr/bin/omnivore-to-rss \ No newline at end of file diff --git a/go.mod b/go.mod index 33e4e2b..429b032 100644 --- a/go.mod +++ b/go.mod @@ -2,10 +2,12 @@ module omnivore-as-rss go 1.19 +require ( + github.com/gorilla/feeds v1.1.2 + github.com/hasura/go-graphql-client v0.12.1 +) + require ( github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/feeds v1.1.2 // indirect - github.com/hasura/go-graphql-client v0.12.1 // indirect - golang.org/x/text v0.14.0 // indirect nhooyr.io/websocket v1.8.10 // indirect ) diff --git a/go.sum b/go.sum index 032f11a..55172b0 100644 --- a/go.sum +++ b/go.sum @@ -4,7 +4,8 @@ github.com/gorilla/feeds v1.1.2 h1:pxzZ5PD3RJdhFH2FsJJ4x6PqMqbgFk1+Vez4XWBW8Iw= github.com/gorilla/feeds v1.1.2/go.mod h1:WMib8uJP3BbY+X8Szd1rA5Pzhdfh+HCCAYT2z7Fza6Y= github.com/hasura/go-graphql-client v0.12.1 h1:tL+BCoyubkYYyaQ+tJz+oPe/pSxYwOJHwe5SSqqi6WI= github.com/hasura/go-graphql-client v0.12.1/go.mod h1:F4N4kR6vY8amio3gEu3tjSZr8GPOXJr3zj72DKixfLE= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q= nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c=