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