project_name: glab version: 2 release: extra_files: - glob: "./bin/*.exe" before: hooks: - go mod tidy - go mod vendor - make manpage builds: - <<: &build_defaults main: ./cmd/glab binary: bin/glab env: - CGO_ENABLED=0 ldflags: - -s -w -X main.version=v{{.Version}} -X main.commit={{.ShortCommit}} -X "main.goversion={{.Env.GO_VERSION}}" id: macos goos: [darwin] goarch: [amd64, arm64] hooks: post: - cmd: './scripts/sign-binary.sh macos "{{ .Path }}"' output: true - <<: *build_defaults id: linux goos: [linux] goarch: ["386", arm, amd64, arm64, ppc64le, s390x] - <<: *build_defaults id: windows goos: [windows] goarch: ["386", amd64, arm64] hooks: post: - cmd: './scripts/sign-binary.sh windows "{{ .Path }}"' output: true - <<: *build_defaults id: freebsd goos: [freebsd] goarch: ["386", amd64, arm] gitlab_urls: use_job_token: true use_package_registry: true dockers: - image_templates: - "registry.gitlab.com/gitlab-org/cli:{{ .Tag }}-amd64" - "gitlab/glab:{{ .Tag }}-amd64" dockerfile: Dockerfile use: buildx build_flag_templates: - "--pull" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.name={{.ProjectName}}" - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" - "--label=org.opencontainers.image.source={{.GitURL}}" - "--platform=linux/amd64" - image_templates: - "registry.gitlab.com/gitlab-org/cli:{{ .Tag }}-arm64" - "gitlab/glab:{{ .Tag }}-arm64" dockerfile: Dockerfile use: buildx build_flag_templates: - "--pull" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.name={{.ProjectName}}" - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" - "--label=org.opencontainers.image.source={{.GitURL}}" - "--platform=linux/arm64" goarch: arm64 docker_manifests: - name_template: "registry.gitlab.com/gitlab-org/cli:{{ .Tag }}" image_templates: - "registry.gitlab.com/gitlab-org/cli:{{ .Tag }}-amd64" - "registry.gitlab.com/gitlab-org/cli:{{ .Tag }}-arm64" - name_template: "registry.gitlab.com/gitlab-org/cli:latest" image_templates: - "registry.gitlab.com/gitlab-org/cli:{{ .Tag }}-amd64" - "registry.gitlab.com/gitlab-org/cli:{{ .Tag }}-arm64" - name_template: "gitlab/glab:{{ .Tag }}" image_templates: - "gitlab/glab:{{ .Tag }}-amd64" - "gitlab/glab:{{ .Tag }}-arm64" - name_template: "gitlab/glab:latest" image_templates: - "gitlab/glab:{{ .Tag }}-amd64" - "gitlab/glab:{{ .Tag }}-arm64" archives: - id: nix ids: [macos, linux, freebsd] wrap_in_directory: false - id: windows ids: [windows] formats: zip source: enabled: true name_template: "{{ .ProjectName }}_{{ .Version }}_source" format: tar.gz files: - vendor/* nfpms: - id: foo package_name: glab # Build IDs for the builds you want to create NFPM packages for. # Defaults to all builds. vendor: GitLab homepage: https://gitlab.com/gitlab-org/cli # using service-desk email https://docs.gitlab.com/user/project/service_desk/ maintainer: GitLab description: An open source GitLab CLI tool license: MIT formats: - apk - deb - rpm dependencies: - git bindir: /usr contents: - src: "./share/man/man1/glab*.1" dst: "/usr/share/man/man1" checksum: name_template: "checksums.txt" extra_files: - glob: ./bin/*installer.exe snapshot: version_template: "{{ .Tag }}" changelog: # https://goreleaser.com/customization/changelog/ use: gitlab sort: asc abbrev: 8 # Author markers are hidden on GitLab; the Slack template swaps them for emoji. format: '{{ $p := split .Message ": " }}{{ if and (gt (len $p) 1) (not (contains (index $p 0) " ")) }}**{{ index $p 0 }}:** {{ trimprefix .Message (printf "%s: " (index $p 0)) }}{{ else }}{{ .Message }}{{ end }} ([{{ .SHA }}](https://gitlab.com/gitlab-org/cli/-/commit/{{ .SHA }})) by {{ .AuthorName }}{{ if eq .AuthorEmail "gitlab-bot@gitlab.com" }}{{ else if ne (trimsuffix .AuthorEmail "@gitlab.com") .AuthorEmail }}{{ else }}{{ end }}' filters: exclude: - "^Merge branch" - "^Update README.md" groups: - title: ✨ Features regexp: '^.*?feat(\([^)]+\))??!?:.+$' order: 0 - title: 🐛 Bug Fixes regexp: '^.*?fix(\([^)]+\))??!?:.+$' order: 1 - title: 📝 Documentation regexp: '^.*?docs(\([^)]+\))??!?:.+$' order: 2 - title: 📦 Dependencies regexp: '^.*?chore\((deps|dependencies)\)[^:]*:.+$' order: 4 - title: 🔧 Maintenance regexp: '^.*?(chore|ci|refactor)(\([^)]+\))??!?:.+$' order: 3 - title: 🔀 Others order: 999 announce: slack: enabled: true # Set SLACK_WEBHOOK environment variable in your CI/CD settings # Format: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXX channel: '{{ .Env.SLACK_CHANNEL }}' username: 'glab Release Bot' icon_emoji: ':glab:' # Plain-text fallback for notifications; the markdown block below is what renders. message_template: "glab {{ .Tag }} has been released: {{ .ReleaseURL }}" blocks: - type: markdown text: | {{- $notes := reverseFilter .ReleaseNotes `^## Changelog` }} {{- $notes = replace $notes "" " 🤖" }} {{- $notes = replace $notes "" " :tanuki:" }} {{- $notes = replace $notes "" " :community:" }} {{- /* Collapse two or more Go module bumps into a count; other dependency lines stay. */}} {{- $modRe := `chore\((deps|dependencies)\)[^:]*:\*\* update module ` }} {{- $modCount := len (split (filter $notes $modRe) "\n") }} {{- $depsHeading := "### 📦 Dependencies" }} {{- /* GitLab changelogs end lines with " \n", so match the heading without its newline. */}} {{- if and (gt $modCount 1) (contains $notes $depsHeading) }} {{- $notes = reverseFilter $notes $modRe }} {{- $notes = replace $notes $depsHeading (printf "%s\n* %d Go module updates" $depsHeading $modCount) }} {{- end -}} 🚀 **glab {{ .Tag }}** has been released! {{/* Cap below Slack's 12,000-character block limit. */ -}} {{ if gt (len $notes) 10000 }}{{ slice $notes 0 10000 }}…{{ else }}{{ $notes }}{{ end }} [View release on GitLab]({{ .ReleaseURL }})