Skip to content
Merged
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
27 changes: 27 additions & 0 deletions .github/workflows/homebrew-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: verify homebrew formula

on:
pull_request:
branches: [ "main", "development" ]
paths:
- 'pkg/homebrew/Formula/quickmark-cli.rb'

jobs:
verify_formula:
runs-on: macos-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create local tap
run: |
brew tap-new local/quickmark-test

- name: Copy formula to tap
run: |
cp pkg/homebrew/Formula/quickmark-cli.rb $(brew --repo local/quickmark-test)/Formula/

- name: Install formula from source
run: |
brew install --build-from-source local/quickmark-test/quickmark-cli
8 changes: 6 additions & 2 deletions pkg/homebrew/Formula/quickmark-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ class QuickmarkCli < Formula
on_macos do
if Hardware::CPU.intel?
url "https://github.com/ekropotin/quickmark/releases/download/quickmark-cli%40#{version}/qmark-x86_64-apple-darwin.tar.gz"
sha256 "sha256:90740f9c0632d8b1da4d00c9c6361c01eb9a72c074641f6952723e6583bbdd8d"
sha256 "90740f9c0632d8b1da4d00c9c6361c01eb9a72c074641f6952723e6583bbdd8d"
else
url "https://github.com/ekropotin/quickmark/releases/download/quickmark-cli%40#{version}/qmark-aarch64-apple-darwin.tar.gz"
sha256 "sha256:4466f54fd304d34d21dba7871a09d4d24df6c23f7cee48fae1f4a6a1f5466855"
sha256 "4466f54fd304d34d21dba7871a09d4d24df6c23f7cee48fae1f4a6a1f5466855"
end
end

def install
bin.install "qmark"
end

test do
# Create a test markdown file
(testpath/"test.md").write("# Test\n\nThis is a test.")
Expand Down
12 changes: 10 additions & 2 deletions pkg/homebrew/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ qmark --config quickmark.toml *.md
## Formula Details

- **Location**: `Formula/quickmark-cli.rb`
- **Binary name**: `qmark`
- **Binary name**: `qmark`
- **Architecture support**: Intel and Apple Silicon Macs
- **Installation method**: Pre-compiled binaries from GitHub releases

Expand All @@ -43,6 +43,14 @@ When releasing a new version:
3. Test the formula: `brew install --build-from-source ./Formula/quickmark-cli.rb`
4. Commit and push the changes

### Testing changes locally

```bash
brew tap-new local/quickmark-test
cp pkg/homebrew/Formula/quickmark-cli.rb $(brew --repo local/quickmark-test)/Formula/
brew install --build-from-source local/quickmark-test/quickmark-cli
```

## Updating

```bash
Expand All @@ -55,4 +63,4 @@ brew upgrade quickmark-cli
```bash
brew uninstall quickmark-cli
brew untap ekropotin/quickmark
```
```