Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 93 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ jobs:
cat > /tmp/matcha-nightly.rb << EOF
class MatchaNightly < Formula
desc "A beautiful and functional email client for your terminal (nightly)"
homepage "https://matcha.floatpane.com"
homepage "https://matcha.email"
version "$VERSION"

on_macos do
Expand Down Expand Up @@ -196,11 +196,101 @@ jobs:
git clone "https://x-access-token:${GH_TOKEN}@github.com/floatpane/homebrew-matcha.git" /tmp/homebrew-matcha
cp /tmp/matcha-nightly.rb /tmp/homebrew-matcha/matcha-nightly.rb
cd /tmp/homebrew-matcha
git config user.name "goreleaserbot"
git config user.email "bot@goreleaser.com"
git config user.name "Floatpane Bot"
git config user.email "us@floatpane.com"
git add matcha-nightly.rb
git diff --cached --quiet || (git commit -m "Update matcha-nightly to $VERSION" && git push)

- name: Update Nix flake tap
env:
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
run: |
VERSION="nightly-$(git rev-parse --short HEAD)"
DARWIN_AMD64_SHA=$(shasum -a 256 dist/matcha_nightly_darwin_amd64.tar.gz | cut -d ' ' -f 1)
DARWIN_ARM64_SHA=$(shasum -a 256 dist/matcha_nightly_darwin_arm64.tar.gz | cut -d ' ' -f 1)
LINUX_AMD64_SHA=$(shasum -a 256 dist/matcha_nightly_linux_amd64.tar.gz | cut -d ' ' -f 1)
LINUX_ARM64_SHA=$(shasum -a 256 dist/matcha_nightly_linux_arm64.tar.gz | cut -d ' ' -f 1)
BASE_URL="https://github.com/floatpane/matcha/releases/download/nightlyv0"

# Convert hex sha256 to nix SRI base64 form
to_sri() { printf 'sha256-%s' "$(printf '%s' "$1" | xxd -r -p | base64)"; }
DARWIN_AMD64_SRI=$(to_sri "$DARWIN_AMD64_SHA")
DARWIN_ARM64_SRI=$(to_sri "$DARWIN_ARM64_SHA")
LINUX_AMD64_SRI=$(to_sri "$LINUX_AMD64_SHA")
LINUX_ARM64_SRI=$(to_sri "$LINUX_ARM64_SHA")

mkdir -p /tmp/nix-pkg
cat > /tmp/nix-pkg/default.nix << EOF
{ stdenvNoCC, fetchurl, lib }:
let
sources = {
x86_64-darwin = {
url = "$BASE_URL/matcha_nightly_darwin_amd64.tar.gz";
hash = "$DARWIN_AMD64_SRI";
};
aarch64-darwin = {
url = "$BASE_URL/matcha_nightly_darwin_arm64.tar.gz";
hash = "$DARWIN_ARM64_SRI";
};
x86_64-linux = {
url = "$BASE_URL/matcha_nightly_linux_amd64.tar.gz";
hash = "$LINUX_AMD64_SRI";
};
aarch64-linux = {
url = "$BASE_URL/matcha_nightly_linux_arm64.tar.gz";
hash = "$LINUX_ARM64_SRI";
};
};
src = sources.\${stdenvNoCC.hostPlatform.system}
or (throw "matcha-nightly: unsupported system \${stdenvNoCC.hostPlatform.system}");
in
stdenvNoCC.mkDerivation {
pname = "matcha-nightly";
version = "$VERSION";
src = fetchurl src;
sourceRoot = ".";
installPhase = ''
runHook preInstall
install -Dm755 matcha \$out/bin/matcha
runHook postInstall
'';
meta = {
description = "Beautiful and functional email client for the terminal (nightly)";
homepage = "https://matcha.email";
license = lib.licenses.mit;
mainProgram = "matcha";
platforms = builtins.attrNames sources;
};
}
EOF

cat > /tmp/nix-pkg/flake.nix << 'EOF'
{
description = "matcha email client — nightly";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAll = nixpkgs.lib.genAttrs systems;
in {
packages = forAll (system: {
default = nixpkgs.legacyPackages.${system}.callPackage ./default.nix { };
});
};
}
EOF

git clone "https://x-access-token:${GH_TOKEN}@github.com/floatpane/nix-matcha.git" /tmp/nix-matcha
cd /tmp/nix-matcha
git checkout nightly 2>/dev/null || git checkout -b nightly
mkdir -p nightly
cp /tmp/nix-pkg/default.nix nightly/default.nix
cp /tmp/nix-pkg/flake.nix nightly/flake.nix
git config user.name "Floatpane Bot"
git config user.email "us@floatpane.com"
git add nightly/default.nix nightly/flake.nix
git diff --cached --quiet || (git commit -m "matcha-nightly: bump to $VERSION" && git push -u origin nightly)

snapcraft:
runs-on: ${{ matrix.runner }}
needs: nightly
Expand Down
174 changes: 174 additions & 0 deletions .github/workflows/nixpkgs-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
name: Nixpkgs Bump PR

# Triggers on stable release publish. Opens PR against NixOS/nixpkgs
# bumping pkgs/by-name/ma/matcha/package.nix to the new version.
# Requires:
# - Fork floatpane/nixpkgs to exist
# - NIXPKGS_BUMP_TOKEN secret: PAT with `repo` scope on floatpane/nixpkgs
# and permission to open PRs against NixOS/nixpkgs
# - Initial matcha package already merged into nixpkgs (this workflow updates, not inits)

on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: "Version to bump to (without v prefix)"
required: true

permissions:
contents: read

jobs:
bump:
runs-on: ubuntu-latest
steps:
- name: Determine version
id: ver
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ inputs.version }}"
else
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#v}"
fi
# Skip nightly / preview tags
if [[ "$VERSION" == nightly* || "$VERSION" == preview* ]]; then
echo "Skipping non-stable release: $VERSION"
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "skip=false" >> $GITHUB_OUTPUT
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Install Nix
if: steps.ver.outputs.skip != 'true'
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
experimental-features = nix-command flakes

- name: Checkout nixpkgs fork
if: steps.ver.outputs.skip != 'true'
uses: actions/checkout@v6
with:
repository: floatpane/nixpkgs
token: ${{ secrets.NIXPKGS_BUMP_TOKEN }}
path: nixpkgs
fetch-depth: 0

- name: Sync fork with upstream master
if: steps.ver.outputs.skip != 'true'
working-directory: nixpkgs
run: |
git config user.name "Floatpane Bot"
git config user.email "us@floatpane.com"
git remote add upstream https://github.com/NixOS/nixpkgs.git
git fetch upstream master
git checkout master
git reset --hard upstream/master
git push origin master --force-with-lease

- name: Create bump branch
if: steps.ver.outputs.skip != 'true'
working-directory: nixpkgs
run: |
BRANCH="matcha-${{ steps.ver.outputs.version }}"
git checkout -b "$BRANCH"
echo "BRANCH=$BRANCH" >> $GITHUB_ENV

- name: Get current version
if: steps.ver.outputs.skip != 'true'
id: current
working-directory: nixpkgs
run: |
PKG=pkgs/by-name/ma/matcha/package.nix
OLD=$(grep -E '^\s*version\s*=\s*"' "$PKG" | head -1 | sed -E 's/.*"([^"]+)".*/\1/')
echo "old=$OLD" >> $GITHUB_OUTPUT

- name: Bump version and reset hashes
if: steps.ver.outputs.skip != 'true'
working-directory: nixpkgs
run: |
PKG=pkgs/by-name/ma/matcha/package.nix
NEW="${{ steps.ver.outputs.version }}"
# Replace version line
sed -i -E "s/(version\s*=\s*\")[^\"]+(\")/\1$NEW\2/" "$PKG"
# Reset src hash + vendorHash to fakeHash so nix build prints real ones
sed -i -E 's|hash = "sha256-[A-Za-z0-9+/=]+"|hash = lib.fakeHash|' "$PKG"
sed -i -E 's|vendorHash = "sha256-[A-Za-z0-9+/=]+"|vendorHash = lib.fakeHash|' "$PKG"

- name: Build to extract src hash
if: steps.ver.outputs.skip != 'true'
id: src_hash
working-directory: nixpkgs
run: |
set +e
OUT=$(nix-build -A matcha --no-out-link 2>&1)
RC=$?
echo "$OUT"
HASH=$(echo "$OUT" | grep -A1 "got:" | tail -1 | tr -d ' ')
if [ -z "$HASH" ]; then
echo "Failed to extract src hash"; exit 1
fi
echo "hash=$HASH" >> $GITHUB_OUTPUT
sed -i -E "s|hash = lib.fakeHash|hash = \"$HASH\"|" pkgs/by-name/ma/matcha/package.nix

- name: Build to extract vendorHash
if: steps.ver.outputs.skip != 'true'
working-directory: nixpkgs
run: |
set +e
OUT=$(nix-build -A matcha --no-out-link 2>&1)
RC=$?
echo "$OUT"
HASH=$(echo "$OUT" | grep -A1 "got:" | tail -1 | tr -d ' ')
if [ -z "$HASH" ]; then
echo "Failed to extract vendorHash"; exit 1
fi
sed -i -E "s|vendorHash = lib.fakeHash|vendorHash = \"$HASH\"|" pkgs/by-name/ma/matcha/package.nix

- name: Final build (sanity check)
if: steps.ver.outputs.skip != 'true'
working-directory: nixpkgs
run: nix-build -A matcha --no-out-link

- name: Commit and push
if: steps.ver.outputs.skip != 'true'
working-directory: nixpkgs
run: |
git add pkgs/by-name/ma/matcha/package.nix
git commit -m "matcha: ${{ steps.current.outputs.old }} -> ${{ steps.ver.outputs.version }}"
git push -u origin "$BRANCH" --force-with-lease

- name: Open PR against NixOS/nixpkgs
if: steps.ver.outputs.skip != 'true'
env:
GH_TOKEN: ${{ secrets.NIXPKGS_BUMP_TOKEN }}
working-directory: nixpkgs
run: |
BODY=$(cat <<EOF
## Description

Automated version bump for \`matcha\` email client.

- Old: ${{ steps.current.outputs.old }}
- New: ${{ steps.ver.outputs.version }}
- Upstream release: https://github.com/floatpane/matcha/releases/tag/v${{ steps.ver.outputs.version }}

## Things done

- Built on \`x86_64-linux\` via GitHub Actions
- Hashes regenerated from upstream tarball
- No package metadata changes beyond version + hashes

cc maintainer for review.
EOF
)
gh pr create \
--repo NixOS/nixpkgs \
--base master \
--head "floatpane:$BRANCH" \
--title "matcha: ${{ steps.current.outputs.old }} -> ${{ steps.ver.outputs.version }}" \
--body "$BODY"
36 changes: 29 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,31 @@ release:
# Add a footer to the release notes featuring full changelog.
footer: |
---
This version is also available on **[Snapcraft](https://snapcraft.io/matcha)**, **Homebrew**, **[Flatpak](https://matcha.floatpane.com/matcha.flatpakref)**!
This version is also available on **[Snapcraft](https://snapcraft.io/matcha)**, **Homebrew**, **[Flatpak](https://matcha.email/matcha.flatpakref)**!

View the [installation instructions](https://docs.matcha.floatpane.com/installation) for more details.
View the [installation instructions](https://docs.matcha.email/installation) for more details.

# 'nix' configures the Nix flake publication.
# Generates a default.nix per release fetching prebuilt tarballs,
# pushes to floatpane/nix-matcha. Users install with:
# nix profile install github:floatpane/nix-matcha
nix:
- name: matcha
repository:
owner: floatpane
name: nix-matcha
branch: main
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
commit_author:
name: Floatpane Bot
email: us@floatpane.com
commit_msg_template: "matcha: bump to {{ .Tag }}"
homepage: "https://matcha.email"
description: "Beautiful and functional email client for the terminal"
license: "mit"
install: |
mkdir -p $out/bin
cp -vr ./matcha $out/bin/matcha

# 'brews' configures the Homebrew tap integration.
brews:
Expand All @@ -119,13 +141,13 @@ brews:

# The commit author for the tap update.
commit_author:
name: goreleaserbot
email: bot@goreleaser.com
name: Floatpane Bot
email: us@floatpane.com

# A description for your formula.
description: "A beautiful and functional email client for your terminal."
# The homepage URL for your formula.
homepage: "https://matcha.floatpane.com"
homepage: "https://matcha.email"

# The dependencies for your formula.
# Since it's a pre-compiled binary, there are no runtime dependencies.
Expand All @@ -148,15 +170,15 @@ winget:
package_identifier: floatpane.matcha
# WinGet publisher metadata.
publisher: floatpane
publisher_url: "https://matcha.floatpane.com"
publisher_url: "https://matcha.email"
publisher_support_url: "https://github.com/floatpane/matcha/issues"

# Package metadata.
short_description: "A beautiful and functional email client for your terminal."
description: |
A beautiful and functional email client for your terminal, built with Go and the charming Bubble Tea TUI library.
Never leave your command line to check your inbox or send an email again!
homepage: "https://matcha.floatpane.com"
homepage: "https://matcha.email"
license: MIT
tags:
- email
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@

### Plugin Marketplace

Matcha has a built-in plugin system with 35+ community plugins. Browse and install them from the terminal or the [online marketplace](https://docs.matcha.floatpane.com/marketplace).
Matcha has a built-in plugin system with 35+ community plugins. Browse and install them from the terminal or the [online marketplace](https://docs.matcha.email/marketplace).

```bash
matcha marketplace # browse plugins in the TUI
matcha install <url_or_file> # install a plugin
matcha config <plugin_name> # configure an installed plugin
```

Anyone can submit their own plugin — just add an entry to `plugins/registry.json` and open a PR. [Learn more](https://docs.matcha.floatpane.com/Features/Plugins#submit-your-plugin)
Anyone can submit their own plugin — just add an entry to `plugins/registry.json` and open a PR. [Learn more](https://docs.matcha.email/Features/Plugins#submit-your-plugin)

### AI Integration

Expand All @@ -46,15 +46,15 @@ Anyone can submit their own plugin — just add an entry to `plugins/registry.js
matcha send --to alice@example.com --subject "Hello" --body "Sent by my AI agent"
```

[Learn more](https://docs.matcha.floatpane.com/Features/AI_AGENTS)
[Learn more](https://docs.matcha.email/Features/AI_AGENTS)

**AI Rewrite Plugin:** Matcha includes an AI rewrite plugin that allows you to rewrite your email drafts using OpenAI, Ollama, Gemini, or Claude.

[Setup Guide](https://docs.matcha.floatpane.com/setup-guides/ai-rewrite)
[Setup Guide](https://docs.matcha.email/setup-guides/ai-rewrite)

## Documentation

Matcha Documention is available on [our website](https://docs.matcha.floatpane.com)
Matcha Documention is available on [our website](https://docs.matcha.email)

## Star History

Expand Down
Loading
Loading