From e7b923b0fdcfbec79309b204db14b81ff1cb2f4d Mon Sep 17 00:00:00 2001 From: drew Date: Fri, 27 Mar 2026 22:20:26 +0400 Subject: [PATCH 1/2] ci: upload nightly to snap and brew Signed-off-by: drew --- .github/workflows/nightly.yml | 88 +++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e43bd5b..c83a108 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -53,3 +53,91 @@ jobs: --notes "This is an automated nightly build from the latest \`master\` commit ($(git rev-parse --short HEAD)).\nIt may be unstable — use stable releases for production." \ --prerelease \ --target master + + - name: Update Homebrew 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" + + 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" + version "$VERSION" + + on_macos do + if Hardware::CPU.intel? + url "$BASE_URL/matcha_nightly_darwin_amd64.tar.gz" + sha256 "$DARWIN_AMD64_SHA" + else + url "$BASE_URL/matcha_nightly_darwin_arm64.tar.gz" + sha256 "$DARWIN_ARM64_SHA" + end + end + + on_linux do + if Hardware::CPU.intel? + url "$BASE_URL/matcha_nightly_linux_amd64.tar.gz" + sha256 "$LINUX_AMD64_SHA" + else + url "$BASE_URL/matcha_nightly_linux_arm64.tar.gz" + sha256 "$LINUX_ARM64_SHA" + end + end + + def install + bin.install "matcha" + end + + test do + system "#{bin}/matcha", "--version" + end + end + EOF + + # Clone the tap repo and push the nightly formula + 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/Formula/matcha-nightly.rb + cd /tmp/homebrew-matcha + git config user.name "goreleaserbot" + git config user.email "bot@goreleaser.com" + git add Formula/matcha-nightly.rb + git diff --cached --quiet || (git commit -m "Update matcha-nightly to $VERSION" && git push) + + snapcraft: + runs-on: ${{ matrix.runner }} + needs: nightly + strategy: + matrix: + include: + - arch: amd64 + runner: ubuntu-latest + - arch: arm64 + runner: ubuntu-24.04-arm + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Install Snapcraft and LXD + run: | + sudo snap install snapcraft --classic + sudo snap install lxd + sudo lxd init --auto + sudo iptables -P FORWARD ACCEPT + sudo usermod -aG lxd $USER + + - name: Build snap + run: sg lxd -c 'snapcraft pack --use-lxd --build-for=${{ matrix.arch }}' + + - name: Upload snap + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} + run: snapcraft upload --release=beta *.snap From 6802eb56244bb4b11e37d49f952150ae9e2223ca Mon Sep 17 00:00:00 2001 From: drew Date: Fri, 27 Mar 2026 22:25:23 +0400 Subject: [PATCH 2/2] ci: update release notes for nightly Signed-off-by: drew --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c83a108..26f4104 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -50,7 +50,7 @@ jobs: run: | gh release create nightlyv0 dist/*.tar.gz dist/*.zip dist/checksums.txt \ --title "Nightly Build ($(git rev-parse --short HEAD))" \ - --notes "This is an automated nightly build from the latest \`master\` commit ($(git rev-parse --short HEAD)).\nIt may be unstable — use stable releases for production." \ + --notes "This is an automated nightly build from the latest \`master\` commit ($(git rev-parse --short HEAD)).It may be unstable — use stable releases for production. You can install this version via Homebrew (`brew install floatpane/matcha/matcha-nightly`, or Snapcraft (`snap install matcha --beta`)" \ --prerelease \ --target master