cli/.goreleaser.yml
Babak K. Shandiz de6a9eb3e4
chore: fix zsh completion on debian
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-24 14:42:40 +01:00

113 lines
3.8 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: 2
project_name: gh
release:
prerelease: auto
draft: true # we only publish after the Windows MSI gets uploaded
name_template: "GitHub CLI {{.Version}}"
before:
hooks:
- >- # The linux and windows archives package the manpages below
{{ if eq .Runtime.Goos "windows" }}echo{{ end }} make manpages GH_VERSION={{.Version}}
- >- # On linux the completions are used in nfpms below, but on macos they are used outside in the deployment build.
{{ if eq .Runtime.Goos "windows" }}echo{{ end }} make completions
- >- # We need to create the `.syso` files (per architecture) to embed Windows resources (version info)
{{ if ne .Runtime.Goos "windows" }}echo{{ end }} pwsh '.\script\gen-winres.ps1' '{{ .Version }} ({{time "2006-01-02"}})' '{{ .Version }}' '.\script\versioninfo.template.json' '.\cmd\gh\'
builds:
- id: macos #build:macos
goos: [darwin]
goarch: [amd64, arm64]
hooks:
pre:
- cmd: bash ./script/licenses {{ .Os }} {{ .Arch }}
output: true
post:
- cmd: ./script/sign '{{ .Path }}'
output: true
binary: bin/gh
main: ./cmd/gh
ldflags:
- -s -w -X github.com/cli/cli/v2/internal/build.Version={{.Version}} -X github.com/cli/cli/v2/internal/build.Date={{time "2006-01-02"}}
- id: linux #build:linux
goos: [linux]
goarch: ["386", arm, amd64, arm64]
env:
- CGO_ENABLED=0
hooks:
pre:
- cmd: bash ./script/licenses {{ .Os }} {{ .Arch }}
output: true
binary: bin/gh
main: ./cmd/gh
ldflags:
- -s -w -X github.com/cli/cli/v2/internal/build.Version={{.Version}} -X github.com/cli/cli/v2/internal/build.Date={{time "2006-01-02"}}
- id: windows #build:windows
goos: [windows]
goarch: ["386", amd64, arm64]
hooks:
pre:
- cmd: bash ./script/licenses {{ .Os }} {{ .Arch }}
output: true
post:
- cmd: pwsh .\script\sign.ps1 '{{ .Path }}'
output: true
binary: bin/gh
main: ./cmd/gh
ldflags:
- -s -w -X github.com/cli/cli/v2/internal/build.Version={{.Version}} -X github.com/cli/cli/v2/internal/build.Date={{time "2006-01-02"}}
archives:
- id: linux-archive
ids: [linux]
name_template: "gh_{{ .Version }}_linux_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
wrap_in_directory: true
formats: [tar.gz]
files:
- LICENSE
- ./share/man/man1/gh*.1
- id: macos-archive
ids: [macos]
name_template: "gh_{{ .Version }}_macOS_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
wrap_in_directory: true
formats: [zip]
files:
- LICENSE
- ./share/man/man1/gh*.1
- id: windows-archive
ids: [windows]
name_template: "gh_{{ .Version }}_windows_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
wrap_in_directory: false
formats: [zip]
files:
- LICENSE
nfpms: #build:linux
- ids: [linux]
license: MIT
maintainer: GitHub
homepage: https://github.com/cli/cli
bindir: /usr
dependencies:
- git
description: GitHubs official command line tool.
formats:
- deb
- rpm
contents:
- src: "./share/man/man1/gh*.1"
dst: "/usr/share/man/man1"
- src: "./share/bash-completion/completions/gh"
dst: "/usr/share/bash-completion/completions/gh"
- src: "./share/fish/vendor_completions.d/gh.fish"
dst: "/usr/share/fish/vendor_completions.d/gh.fish"
- src: "./share/zsh/site-functions/_gh"
dst: "/usr/share/zsh/site-functions/_gh"
# Debian/Ubuntu zsh does not look in /usr/share/zsh/site-functions by default,
# so we also install to vendor-completions. See https://github.com/cli/cli/issues/13166
- src: "./share/zsh/vendor-completions/_gh"
dst: "/usr/share/zsh/vendor-completions/_gh"
packager: deb