.goreleaser.yml

  1# This is the configuration file for GoReleaser.
  2# It defines how your project should be built, packaged, and released.
  3# For more information, see: https://goreleaser.com/customization/
  4version: 2
  5
  6git:
  7  ignore_tags:
  8    - nightly*
  9    - preview*
 10
 11# The 'before' hook runs commands before the build process starts.
 12before:
 13  hooks:
 14    # Tidy up the go.mod file to ensure all dependencies are clean.
 15    - go mod tidy
 16
 17# 'builds' defines the matrix of binaries to create.
 18# cgo is enabled for C-accelerated image processing and base64 wrapping (clib/).
 19# Cross-compilation uses zig cc for Linux/Windows and native clang for macOS.
 20# The release workflow runs on macos-latest (see .github/workflows/release.yml).
 21builds:
 22  - id: matcha
 23    main: .
 24    goos:
 25      - linux
 26      - darwin
 27      - windows
 28    goarch:
 29      - amd64
 30      - arm64
 31    flags:
 32      - -trimpath
 33    ldflags:
 34      - -s -w -buildid= -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
 35    env:
 36      - CGO_ENABLED=1
 37      - >-
 38        {{- if eq .Os "darwin" }}SDKROOT={{ .Env.SDK_PATH }}{{- end }}
 39      - >-
 40        {{- if eq .Os "darwin" }}MACOSX_DEPLOYMENT_TARGET=11.0{{- end }}
 41      - >-
 42        {{- if eq .Os "darwin" }}CGO_CFLAGS=-isysroot {{ .Env.SDK_PATH }} -mmacosx-version-min=11.0{{- end }}
 43      - >-
 44        {{- if eq .Os "darwin" }}CGO_LDFLAGS=-isysroot {{ .Env.SDK_PATH }}
 45        {{- else if eq .Os "linux" }}CGO_LDFLAGS=-L{{ .Env.PCSC_DIR }}/lib/{{ .Arch }}
 46        {{- end }}
 47      - >-
 48        {{- if eq .Os "darwin" }}
 49          {{- if eq .Arch "amd64"}}CC=clang -arch x86_64 -isysroot {{ .Env.SDK_PATH }}{{- end }}
 50          {{- if eq .Arch "arm64"}}CC=clang -arch arm64 -isysroot {{ .Env.SDK_PATH }}{{- end }}
 51        {{- else if eq .Os "linux" }}
 52          {{- if eq .Arch "amd64" }}CC=zig cc -target x86_64-linux-musl -lc{{- end }}
 53          {{- if eq .Arch "arm64"}}CC=zig cc -target aarch64-linux-musl -lc{{- end }}
 54        {{- else if eq .Os "windows" }}
 55          {{- if eq .Arch "amd64" }}CC=zig cc -target x86_64-windows-gnu -lc{{- end }}
 56          {{- if eq .Arch "arm64"}}CC=zig cc -target aarch64-windows-gnu -lc{{- end }}
 57        {{- end }}
 58
 59# 'archives' defines how to package the built binaries.
 60# 'archives' defines how to package the built binaries.
 61archives:
 62  - # The archive configuration.
 63    # This will create .tar.gz files.
 64    formats: [tar.gz]
 65
 66    # A template for the archive file names.
 67    # e.g., matcha_1.2.3_darwin_amd64.tar.gz
 68    name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
 69    # Files to include in the archive.
 70    format_overrides:
 71      - goos: windows
 72        formats: ["zip"]
 73    files:
 74      - LICENSE
 75
 76      - README.md
 77
 78# 'snapshot' configures how test releases are named when running on non-tagged commits.
 79snapshot:
 80  version_template: "{{ .Tag }}-next"
 81
 82# 'checksum' creates a file with SHA256 checksums for all artifacts.
 83checksum:
 84  name_template: "checksums.txt"
 85
 86# 'changelog' configures the automatic generation of release notes.
 87changelog:
 88  # Use 'github-native' to leverage GitHub's release notes API.
 89  # This automatically includes contributors and links to PRs/issues.
 90  # Categories are configured in .github/release.yml
 91  use: github-native
 92
 93# 'release' configures the GitHub Release creation.
 94release:
 95  # If set to true, GoReleaser will automatically draft a new release.
 96  # Set to false to automatically publish the release.
 97  draft: false
 98  # If set to true, will mark the release as a pre-release.
 99  prerelease: auto
100  # Add a footer to the release notes featuring full changelog.
101  footer: |
102    ---
103    This version is also available on **[Snapcraft](https://snapcraft.io/matcha)**, **Homebrew**, **[Flatpak](https://matcha.email/matcha.flatpakref)**!
104
105    View the [installation instructions](https://docs.matcha.email/installation) for more details.
106
107# 'nix' configures the Nix flake publication.
108# Generates a default.nix per release fetching prebuilt tarballs,
109# pushes to floatpane/nix-matcha. Users install with:
110#   nix profile install github:floatpane/nix-matcha
111nix:
112  - name: matcha
113    repository:
114      owner: floatpane
115      name: nix-matcha
116      branch: main
117      token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
118    commit_author:
119      name: Floatpane Bot
120      email: us@floatpane.com
121    commit_msg_template: "matcha: bump to {{ .Tag }}"
122    homepage: "https://matcha.email"
123    description: "Beautiful and functional email client for the terminal"
124    license: "mit"
125    install: |
126      mkdir -p $out/bin
127      cp -vr ./matcha $out/bin/matcha
128
129# 'homebrew_casks' configures the Homebrew tap integration.
130# Migrated from deprecated 'brews' (goreleaser v2.12+).
131# macOS-only; Linux users should use the Nix flake or snap.
132homebrew_casks:
133  - name: matcha
134    binaries: [matcha]
135    repository:
136      owner: floatpane
137      name: homebrew-matcha
138      token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
139    commit_author:
140      name: Floatpane Bot
141      email: us@floatpane.com
142    description: "A beautiful and functional email client for your terminal."
143    homepage: "https://matcha.email"
144    # Strip Apple quarantine xattr so unsigned binary runs without Gatekeeper prompt.
145    hooks:
146      post:
147        install: |
148          if OS.mac?
149            system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/matcha"]
150          end
151# 'winget' configures the WinGet manifest generation and publication.
152winget:
153  - # Name of the package in WinGet.
154    name: matcha
155    # Unique package identifier used by WinGet.
156    package_identifier: floatpane.matcha
157    # WinGet publisher metadata.
158    publisher: floatpane
159    publisher_url: "https://matcha.email"
160    publisher_support_url: "https://github.com/floatpane/matcha/issues"
161
162    # Package metadata.
163    short_description: "A beautiful and functional email client for your terminal."
164    description: |
165      A beautiful and functional email client for your terminal, built with Go and the charming Bubble Tea TUI library.
166      Never leave your command line to check your inbox or send an email again!
167    homepage: "https://matcha.email"
168    license: MIT
169    tags:
170      - email
171      - terminal
172      - tui
173
174    # Use release changelog as WinGet release notes.
175    release_notes: "{{ .Changelog }}"
176
177    # Commit to a feature branch in winget-pkgs and open a PR.
178    repository:
179      owner: floatpane
180      name: winget-pkgs
181      branch: "{{ .ProjectName }}-{{ .Version }}"
182      token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
183      pull_request:
184        enabled: true
185        base:
186          owner: microsoft
187          name: winget-pkgs
188          branch: master
189
190    # Commit author for manifest updates.
191    commit_author:
192      name: goreleaserbot
193      email: bot@goreleaser.com
194
195# Snapcraft is handled separately in the release workflow (requires Ubuntu).
196# See .github/workflows/release.yml