Skip to content

Commit fdfc3e7

Browse files
authored
chore: add install step in homebrew formula (#145)
* fix: add install step and fix sha256 in homebrew formula
1 parent 439cb4c commit fdfc3e7

3 files changed

Lines changed: 41 additions & 2 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: verify homebrew formula
2+
3+
on:
4+
pull_request:
5+
branches: [ "main", "development" ]
6+
paths:
7+
- 'pkg/homebrew/Formula/quickmark-cli.rb'
8+
9+
jobs:
10+
verify_formula:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Create local tap
18+
run: |
19+
brew tap-new local/quickmark-test
20+
21+
- name: Copy formula to tap
22+
run: |
23+
cp pkg/homebrew/Formula/quickmark-cli.rb $(brew --repo local/quickmark-test)/Formula/
24+
25+
- name: Install formula from source
26+
run: |
27+
brew install --build-from-source local/quickmark-test/quickmark-cli

pkg/homebrew/Formula/quickmark-cli.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ class QuickmarkCli < Formula
1414
end
1515
end
1616

17+
def install
18+
bin.install "qmark"
19+
end
20+
1721
test do
1822
# Create a test markdown file
1923
(testpath/"test.md").write("# Test\n\nThis is a test.")

pkg/homebrew/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ qmark --config quickmark.toml *.md
3030
## Formula Details
3131

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

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

46+
### Testing changes locally
47+
48+
```bash
49+
brew tap-new local/quickmark-test
50+
cp pkg/homebrew/Formula/quickmark-cli.rb $(brew --repo local/quickmark-test)/Formula/
51+
brew install --build-from-source local/quickmark-test/quickmark-cli
52+
```
53+
4654
## Updating
4755

4856
```bash
@@ -55,4 +63,4 @@ brew upgrade quickmark-cli
5563
```bash
5664
brew uninstall quickmark-cli
5765
brew untap ekropotin/quickmark
58-
```
66+
```

0 commit comments

Comments
 (0)