From df8e3034985893ac2d6bbb9aafa54ed98b495c43 Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Fri, 6 Mar 2026 18:08:47 +0300 Subject: [PATCH] Add Homebrew tap with auto-update workflow (#61) --- .github/workflows/homebrew.yml | 42 ++++++++++++++++++++++++++++++++++ AGENTS.md | 1 + CHANGELOG.md | 1 + README.md | 8 ++++++- 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/homebrew.yml diff --git a/.github/workflows/homebrew.yml b/.github/workflows/homebrew.yml new file mode 100644 index 000000000..891990675 --- /dev/null +++ b/.github/workflows/homebrew.yml @@ -0,0 +1,42 @@ +name: Update Homebrew Tap + +on: + release: + types: [published] + +permissions: {} + +jobs: + update-tap: + runs-on: macos-latest + steps: + - name: Update cask + env: + GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + run: | + VERSION="${GITHUB_REF_NAME#v}" + + TMPDIR=$(mktemp -d) + gh release download "$GITHUB_REF_NAME" \ + --repo "$GITHUB_REPOSITORY" \ + --pattern 'OpenPencil_aarch64.app.tar.gz' \ + --pattern 'OpenPencil_x64.app.tar.gz' \ + --dir "$TMPDIR" + + SHA_ARM=$(shasum -a 256 "$TMPDIR/OpenPencil_aarch64.app.tar.gz" | cut -d' ' -f1) + SHA_X64=$(shasum -a 256 "$TMPDIR/OpenPencil_x64.app.tar.gz" | cut -d' ' -f1) + + gh repo clone open-pencil/homebrew-tap "$TMPDIR/tap" + cd "$TMPDIR/tap" + + sed -i '' \ + -e "s/version \".*\"/version \"$VERSION\"/" \ + -e "/on_arm/,/end/{s/sha256 \".*\"/sha256 \"$SHA_ARM\"/;}" \ + -e "/on_intel/,/end/{s/sha256 \".*\"/sha256 \"$SHA_X64\"/;}" \ + Casks/open-pencil.rb + + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add Casks/open-pencil.rb + git commit -m "Update OpenPencil to $VERSION" + git push diff --git a/AGENTS.md b/AGENTS.md index 77939c985..354cb6ad0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -53,6 +53,7 @@ The root app (`src/`) is the Tauri/Vite desktop editor. Its `src/engine/` files | Workflow | Trigger | What it does | |----------|---------|--------------| | `build.yml` | `v*` tag push or manual | Build Tauri desktop apps (5 targets), create GitHub Release, publish npm | +| `homebrew.yml` | Release published | Update `open-pencil/homebrew-tap` cask with new version + SHA256 hashes | | `app.yml` | Push to `master` (non-docs) | Build web app, deploy to Cloudflare Pages (`app.openpencil.dev`) | | `docs.yml` | Push to `master` (`packages/docs/**`) | Build VitePress docs, deploy to Cloudflare Pages (`openpencil.dev`) | diff --git a/CHANGELOG.md b/CHANGELOG.md index 9922137be..332fe1fae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Tailwind CSS v4 JSX export — export selections as HTML with Tailwind utility classes (`
`) from the Code panel, CLI (`bun open-pencil export --format jsx --style tailwind`), or programmatically via `sceneNodeToJSX(id, graph, 'tailwind')`. Supports layout, sizing, colors, border radius, opacity, rotation, overflow, shadows, blur, and typography. Uses v4 spacing semantics (px/4 multiplier) with automatic fallback to arbitrary values. - Code panel format toggle — switch between OpenPencil (custom components) and Tailwind (HTML + utility classes) output +- Homebrew tap — `brew install open-pencil/tap/open-pencil` for macOS (arm64 + x64), auto-updated on each release - New AI/MCP tools: `analyze_colors`, `analyze_typography`, `analyze_spacing`, `analyze_clusters`, `diff_create`, `diff_show`, `get_components`, `get_current_page`, `arrange`, `node_to_component` ### Improvements diff --git a/README.md b/README.md index 13890966d..a158a5373 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,13 @@ Your design files are yours. Your tools should be too. ## Installation -Download the latest release from the [releases page](https://github.com/open-pencil/open-pencil/releases/latest), or [use the web app](https://app.openpencil.dev) — no install needed. +**macOS (Homebrew):** + +```sh +brew install open-pencil/tap/open-pencil +``` + +Or download the latest release from the [releases page](https://github.com/open-pencil/open-pencil/releases/latest), or [use the web app](https://app.openpencil.dev) — no install needed. ## Getting Started