From e5f97ee2f061c2a5d9033c3b0a5dd51023bb36a1 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Wed, 13 Mar 2024 22:36:46 +0100 Subject: [PATCH] Updated .goreleaser and added Dockerfile and LICENSE --- .goreleaser.yaml | 57 ++++++++++++++++++++++++++++++++++++------------ Dockerfile | 3 +++ LICENSE | 21 ++++++++++++++++++ 3 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 Dockerfile create mode 100644 LICENSE diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 7dbdf48..ed0e247 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -6,10 +6,9 @@ version: 1 before: hooks: - # You may remove this if you don't use go modules. - go mod tidy - # you may remove this if you don't need go generate - - go generate ./... + - go mod download + - go mod verify builds: - env: @@ -21,20 +20,30 @@ builds: - freebsd - openbsd - netbsd + goarch: + - 386 + - arm + - arm64 + - amd64 + - ppc64le + - s390x + goarm: + - 6 + - 7 + goamd64: + - v1 + - v2 + - v3 main: ./cmd/apg binary: apg + ldflags: + - -w -s -extldflags "-static" + ignore: + - goos: darwin + goarch: 386 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 @@ -48,23 +57,33 @@ changelog: nfpms: - vendor: Winni Neessen + homepage: https://src.neessen.cloud/wneessen/apg-go maintainer: Winni Neessen + description: |- + A "Automated Password Generator"-clone written in Go + license: MIT formats: - apk - deb - rpm - termux.deb - archlinux + file_name_template: >- + {{- trimsuffix .ConventionalFileName .ConventionalExtension -}} + {{- if and (eq .Arm "6") (eq .ConventionalExtension ".deb") }}6{{ end -}} + {{- if not (eq .Amd64 "v1")}}{{ .Amd64 }}{{ end -}} + {{- .ConventionalExtension -}} dmg: - replace: true universal_binaries: + - replace: true report_sizes: true signs: - - artifacts: checksum + - artifacts: all stdin: "{{ .Env.GPG_PASSWORD }}" args: ["-u", "wn@neessen.dev", "--output", "${signature}", "--detach-sign", "${artifact}"] @@ -77,4 +96,14 @@ gitea_urls: dockers: - image_templates: - - wneessen/apg-go \ No newline at end of file + - wneessen/apg-go + build_flag_templates: + - "--network=host" + +docker_signs: + - artifacts: all + stdin: '{{ .Env.COSIGN_PWD }}' + cmd: cosign + +gomod: + mod: mod diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0f9b91d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM scratch +ENTRYPOINT ["/apg"] +COPY apg / diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..de8cc50 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021-2024 Winni Neessen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.