From e00d17ab40a29e108ecefaf1f500f078a8422011 Mon Sep 17 00:00:00 2001 From: jon4hz Date: Sun, 1 Sep 2024 18:20:58 +0200 Subject: [PATCH] ci: fix goreleaser config --- .goreleaser.yml | 129 +++++++++++++++++++++++++----------------------- 1 file changed, 68 insertions(+), 61 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 4d84ca3..406356d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,4 +1,6 @@ --- +version: 2 + variables: main: "." binary_name: "fztea" @@ -8,19 +10,19 @@ variables: license: "MIT" homepage: "https://jon4hz.io" aur_package: |- - # bin - install -Dm755 "./fztea" "${pkgdir}/usr/bin/fztea" - # license - install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/fztea/LICENSE" - # completions - mkdir -p "${pkgdir}/usr/share/bash-completion/completions/" - mkdir -p "${pkgdir}/usr/share/zsh/site-functions/" - mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/" - install -Dm644 "./completions/fztea.bash" "${pkgdir}/usr/share/bash-completion/completions/fztea" - install -Dm644 "./completions/fztea.zsh" "${pkgdir}/usr/share/zsh/site-functions/_fztea" - install -Dm644 "./completions/fztea.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/fztea.fish" - # man pages - install -Dm644 "./manpages/fztea.1.gz" "${pkgdir}/usr/share/man/man1/fztea.1.gz" + # bin + install -Dm755 "./fztea" "${pkgdir}/usr/bin/fztea" + # license + install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/fztea/LICENSE" + # completions + mkdir -p "${pkgdir}/usr/share/bash-completion/completions/" + mkdir -p "${pkgdir}/usr/share/zsh/site-functions/" + mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/" + install -Dm644 "./completions/fztea.bash" "${pkgdir}/usr/share/bash-completion/completions/fztea" + install -Dm644 "./completions/fztea.zsh" "${pkgdir}/usr/share/zsh/site-functions/_fztea" + install -Dm644 "./completions/fztea.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/fztea.fish" + # man pages + install -Dm644 "./manpages/fztea.1.gz" "${pkgdir}/usr/share/man/man1/fztea.1.gz" before: hooks: @@ -29,13 +31,18 @@ before: - ./scripts/manpages.sh builds: - - - id: default + - id: default env: - CGO_ENABLED=0 - main: '{{ .Var.main }}' - binary: '{{ .Var.binary_name }}' - ldflags: -s -w -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Version={{ .Version }} -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Commit={{ .Commit }} -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Date={{ .Date }} -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.BuiltBy=goreleaser + main: "{{ .Var.main }}" + binary: "{{ .Var.binary_name }}" + ldflags: + - -s + - -w + - -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Version={{ .Version }} + - -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Commit={{ .Commit }} + - -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Date={{ .Date }} + - -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.BuiltBy=goreleaser flags: - -trimpath goos: @@ -47,13 +54,18 @@ builds: - arm goarm: - "7" - - - id: windows + - id: windows env: - CGO_ENABLED=0 - main: '{{ .Var.main }}' - binary: '{{ .Var.binary_name }}' - ldflags: -s -w -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Version={{ .Version }} -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Commit={{ .Commit }} -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Date={{ .Date }} -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.BuiltBy=goreleaser + main: "{{ .Var.main }}" + binary: "{{ .Var.binary_name }}" + ldflags: + - -s + - -w + - -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Version={{ .Version }} + - -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Commit={{ .Commit }} + - -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Date={{ .Date }} + - -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.BuiltBy=goreleaser flags: - -trimpath goos: @@ -70,13 +82,18 @@ builds: goarch: arm64 - goos: windows goarm: "7" - - - id: macOS + - id: macOS env: - CGO_ENABLED=1 # required for the serial lib of fztea - main: '{{ .Var.main }}' - binary: '{{ .Var.binary_name }}' - ldflags: -s -w -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Version={{ .Version }} -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Commit={{ .Commit }} -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Date={{ .Date }} -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.BuiltBy=goreleaser + main: "{{ .Var.main }}" + binary: "{{ .Var.binary_name }}" + ldflags: + - -s + - -w + - -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Version={{ .Version }} + - -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Commit={{ .Commit }} + - -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.Date={{ .Date }} + - -X github.com/jon4hz/{{ .Var.binary_name }}/internal/version.BuiltBy=goreleaser flags: - -trimpath goos: @@ -86,9 +103,7 @@ builds: goarch: "386" archives: - - - id: default - rlcp: true + - id: default name_template: "{{ .Var.binary_name }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}-{{ .Mips }}{{ end }}" builds: - default @@ -99,9 +114,7 @@ archives: - CHANGELOG* - manpages/ - completions - - - id: windows - rlcp: true + - id: windows name_template: "{{ .Var.binary_name }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}-{{ .Mips }}{{ end }}" builds: - windows @@ -114,16 +127,15 @@ archives: - CHANGELOG* checksum: - name_template: 'checksums.txt' + name_template: "checksums.txt" nfpms: - - - file_name_template: "{{ .Var.binary_name }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}-{{ .Mips }}{{ end }}" + - file_name_template: "{{ .Var.binary_name }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}-{{ .Mips }}{{ end }}" vendor: jon4hz - homepage: '{{ .Var.homepage }}' - maintainer: '{{ .Var.maintainer }}' - description: '{{ .Var.description }}' - license: '{{ .Var.license }}' + homepage: "{{ .Var.homepage }}" + maintainer: "{{ .Var.maintainer }}" + description: "{{ .Var.description }}" + license: "{{ .Var.license }}" formats: - apk - deb @@ -139,24 +151,21 @@ nfpms: dst: /usr/share/man/man1/fztea.1.gz aurs: - - - name: '{{ .Var.binary_name }}-bin' - homepage: '{{ .Var.homepage }}' - description: '{{ .Var.description }}' + - name: "{{ .Var.binary_name }}-bin" + homepage: "{{ .Var.homepage }}" + description: "{{ .Var.description }}" maintainers: - - '{{ .Var.maintainer }}' - license: '{{ .Var.license }}' - private_key: '{{ .Env.AUR_KEY }}' - git_url: 'ssh://aur@aur.archlinux.org/{{ .Var.binary_name }}-bin.git' - package: '{{ .Var.aur_package }}' - + - "{{ .Var.maintainer }}" + license: "{{ .Var.license }}" + private_key: "{{ .Env.AUR_KEY }}" + git_url: "ssh://aur@aur.archlinux.org/{{ .Var.binary_name }}-bin.git" + package: "{{ .Var.aur_package }}" source: - rlcp: true enabled: true snapshot: - name_template: "{{ incpatch .Version }}-devel" + version_template: "{{ incpatch .Version }}-devel" changelog: sort: asc @@ -166,10 +175,10 @@ changelog: - "^docs:" - "^test:" groups: - - title: 'New Features' + - title: "New Features" regexp: "^.*feat[(\\w)]*:+.*$" order: 0 - - title: 'Bug fixes' + - title: "Bug fixes" regexp: "^.*fix[(\\w)]*:+.*$" order: 10 - title: Others @@ -179,21 +188,19 @@ furies: - account: jon4hz brews: - - - name: '{{ .Var.binary_name }}' - tap: + - name: "{{ .Var.binary_name }}" + repository: owner: jon4hz name: homebrew-tap token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" commit_author: name: jon4hz email: me@jon4hz.io - homepage: '{{ .Var.homepage }}' - description: '{{ .Var.description }}' + homepage: "{{ .Var.homepage }}" + description: "{{ .Var.description }}" install: |- bin.install "{{ .Var.binary_name }}" bash_completion.install "completions/{{ .Var.binary_name }}.bash" => "{{ .Var.binary_name }}" zsh_completion.install "completions/{{ .Var.binary_name }}.zsh" => "_{{ .Var.binary_name }}" fish_completion.install "completions/{{ .Var.binary_name }}.fish" man1.install "manpages/{{ .Var.binary_name }}.1.gz" -