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