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
31 changes: 3 additions & 28 deletions .github/workflows/S3-Publish-Homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
env:
TAP_REPO: zaai-com/homebrew-tap
FORMULA_NAME: git-same-cli
FORMULA_SHIM_NAME: git-same
CASK_NAME: git-same

permissions:
Expand Down Expand Up @@ -43,7 +42,6 @@ jobs:
fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "version=$TAG" >> "$GITHUB_OUTPUT"
echo "deprecation_date=$(date -u +%Y-%m-%d)" >> "$GITHUB_OUTPUT"

- name: Download release assets
env:
Expand Down Expand Up @@ -71,39 +69,19 @@ jobs:
echo "macos_x86_64=$(shasum -a 256 "$MAC_X86" | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
echo "macos_aarch64=$(shasum -a 256 "$MAC_ARM" | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"

- name: Compute source archive SHA256
id: src_sha
run: |
TAG="${{ steps.version.outputs.tag }}"
URL="https://github.com/zaai-com/git-same/archive/refs/tags/${TAG}.tar.gz"
mkdir -p src-archive
curl -fsSL "$URL" -o "src-archive/source.tar.gz"
SHA=$(shasum -a 256 src-archive/source.tar.gz | cut -d' ' -f1)
echo "sha=$SHA" >> "$GITHUB_OUTPUT"

- name: Render formula-cli
run: |
TAG="${{ steps.version.outputs.tag }}"
REPO_URL="https://github.com/zaai-com/git-same/releases/download/${TAG}"
bash toolkit/homebrew/render-formula.sh \
"${{ steps.version.outputs.version }}" \
--kind cli \
--url "${REPO_URL}" \
--sha-macos-arm "${{ steps.sha.outputs.macos_aarch64 }}" \
--sha-macos-intel "${{ steps.sha.outputs.macos_x86_64 }}" \
--sha-linux-arm "${{ steps.sha.outputs.linux_aarch64 }}" \
--sha-linux-intel "${{ steps.sha.outputs.linux_x86_64 }}" \
--out formula-cli.rb

- name: Render formula deprecation shim
run: |
bash toolkit/homebrew/render-formula.sh \
"${{ steps.version.outputs.version }}" \
--kind shim \
--deprecation-date "${{ steps.version.outputs.deprecation_date }}" \
--src-sha "${{ steps.src_sha.outputs.sha }}" \
--out formula-shim.rb

- name: Render cask
run: |
bash toolkit/homebrew/render-cask.sh \
Expand All @@ -112,12 +90,11 @@ jobs:
--sha-intel "${{ steps.sha.outputs.macos_x86_64 }}" \
--out cask.rb

- name: Verify rendered cask + formulae against a temp tap
- name: Verify rendered cask + formula against a temp tap
run: |
bash toolkit/homebrew/verify-tap.sh \
--cask cask.rb \
--formula-cli formula-cli.rb \
--formula-shim formula-shim.rb
--formula-cli formula-cli.rb

- name: Checkout tap repository
uses: actions/checkout@v6
Expand All @@ -131,7 +108,6 @@ jobs:
run: |
mkdir -p tap/Formula tap/Casks
cp formula-cli.rb "tap/Formula/${FORMULA_NAME}.rb"
cp formula-shim.rb "tap/Formula/${FORMULA_SHIM_NAME}.rb"
cp cask.rb "tap/Casks/${CASK_NAME}.rb"

- name: Commit and push to tap
Expand All @@ -141,11 +117,10 @@ jobs:
git config user.email "github-actions[bot]@users.noreply.github.com"
git add \
"Formula/${FORMULA_NAME}.rb" \
"Formula/${FORMULA_SHIM_NAME}.rb" \
"Casks/${CASK_NAME}.rb"
if git diff --cached --quiet; then
echo "Cask + formula unchanged, skipping commit"
else
git commit -m "Update git-same to ${{ steps.version.outputs.version }} (cask + formula-cli + shim)"
git commit -m "Update git-same to ${{ steps.version.outputs.version }} (cask + formula-cli)"
git push origin HEAD
fi
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "git-same"
version = "3.0.1"
version = "3.0.2"
edition = "2021"
authors = ["Git-Same Contributors"]
description = "Mirror GitHub structure /orgs/repos/ to local file system."
Expand Down Expand Up @@ -82,7 +82,7 @@ crossterm = { version = "0.29", optional = true }

# Release tooling (optional, behind "release-tools" feature)
clap_complete = { version = "4", optional = true }
clap_mangen = { version = "0.2", optional = true }
clap_mangen = { version = "0.3", optional = true }

[dev-dependencies]
# Testing
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ brew install --cask zaai-com/tap/git-same
brew install zaai-com/tap/git-same-cli
```

> As of 3.0.1, macOS distribution moved to a Homebrew Cask. The previous `brew install zaai-com/tap/git-same` formula path is deprecated on macOS and prints a notice that points at the cask. The cask is the seam for the upcoming Tauri GUI app and Finder badges, which arrive via `brew upgrade --cask git-same` with no second migration.
> As of 3.0.1, macOS distribution moved to a Homebrew Cask. The cask is the seam for the upcoming Tauri GUI app and Finder badges, which arrive via `brew upgrade --cask git-same` with no second migration.

<details>
<summary>Other installation methods</summary>
Expand Down
23 changes: 5 additions & 18 deletions toolkit/homebrew/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,23 @@ locally for pre-publish smoke tests.
|---|---|---|
| `cask.rb.tmpl` | `Casks/git-same.rb` | macOS users (signed + notarized tarball, GUI-friendly) |
| `formula-cli.rb.tmpl` | `Formula/git-same-cli.rb` | Linux users + headless macOS |
| `formula-shim.rb.tmpl` | `Formula/git-same.rb` | Existing users on the old name; depends on `git-same-cli`, prints a deprecation warning |

The shim is scheduled for removal at git-same 3.2 (see `formula-shim.rb.tmpl`).

## Decision tree for users

- **macOS GUI / casual install** → cask: `brew install --cask zaai-com/tap/git-same`
- **macOS headless / shell scripts** → formula: `brew install zaai-com/tap/git-same-cli`
- **Linux** → formula: `brew install zaai-com/tap/git-same-cli`
- **Already running `brew install zaai-com/tap/git-same`** → unchanged for now; the shim transparently installs `git-same-cli` and emits a one-time deprecation notice.

## Scripts

- `render-cask.sh VERSION --sha-arm <hex> --sha-intel <hex> [--out PATH]`
Renders `cask.rb.tmpl` → stdout or PATH.

- `render-formula.sh VERSION --kind {cli|shim} ... [--out PATH]`
Renders both formula templates. See `--help` for the full flag list per kind.
- `render-formula.sh VERSION --url URL_PREFIX --sha-macos-arm <hex> --sha-macos-intel <hex> --sha-linux-arm <hex> --sha-linux-intel <hex> [--out PATH]`
Renders `formula-cli.rb.tmpl` → stdout or PATH.

- `verify-tap.sh --cask cask.rb --formula-cli formula-cli.rb --formula-shim formula-shim.rb [--install-smoke]`
Stages rendered files into a throwaway local tap, then runs `brew style --strict`
- `verify-tap.sh --cask cask.rb --formula-cli formula-cli.rb [--install-smoke]`
Stages rendered files into a throwaway local tap, then runs `brew style`
and `brew audit --strict --online` against each. Pass `--install-smoke` to
also `brew install --cask` end-to-end (downloads the real tarballs from the
release; only run after the release exists).
Expand All @@ -56,26 +52,17 @@ bash toolkit/homebrew/render-cask.sh "$VERSION" \
--sha-intel "$(cat /tmp/sha-x86_64-apple-darwin.txt)" \
--out /tmp/cask.rb

bash toolkit/homebrew/render-formula.sh "$VERSION" --kind cli \
bash toolkit/homebrew/render-formula.sh "$VERSION" \
--url "$URL_PREFIX" \
--sha-macos-arm "$(cat /tmp/sha-aarch64-apple-darwin.txt)" \
--sha-macos-intel "$(cat /tmp/sha-x86_64-apple-darwin.txt)" \
--sha-linux-arm "$(cat /tmp/sha-aarch64-unknown-linux-gnu.txt)" \
--sha-linux-intel "$(cat /tmp/sha-x86_64-unknown-linux-gnu.txt)" \
--out /tmp/formula-cli.rb

# Compute the source archive SHA for the shim
SRC_SHA=$(curl -sSL "https://github.com/zaai-com/git-same/archive/refs/tags/${VERSION}.tar.gz" \
| shasum -a 256 | awk '{print $1}')
bash toolkit/homebrew/render-formula.sh "$VERSION" --kind shim \
--deprecation-date "$(date -u +%Y-%m-%d)" \
--src-sha "$SRC_SHA" \
--out /tmp/formula-shim.rb

# Verify
bash toolkit/homebrew/verify-tap.sh \
--cask /tmp/cask.rb \
--formula-cli /tmp/formula-cli.rb \
--formula-shim /tmp/formula-shim.rb \
--install-smoke
```
26 changes: 0 additions & 26 deletions toolkit/homebrew/formula-shim.rb.tmpl

This file was deleted.

Loading