11# Homebrew Tap Setup Instructions
22
3- ## Quick Setup
4-
5- 1 . ** Create a new repository on GitHub:**
6- - Repository name: ` homebrew-docstripper `
7- - Make it public
8- - Don't initialize with README
9-
10- 2 . ** Clone and setup locally:**
11- ``` bash
12- git clone https://github.com/YOUR_USERNAME/homebrew-docstripper.git
13- cd homebrew-docstripper
14- mkdir -p Formula
15- ```
16-
17- 3 . ** Copy and update the formula:**
18- ``` bash
19- cp ../DocStripper/docstripper.rb Formula/docstripper.rb
20- ```
21-
22- 4 . ** Update the formula URL to point to GitHub releases:**
23-
24- Edit ` Formula/docstripper.rb ` and update:
25- ``` ruby
26- url " https://github.com/kiku-jw/DocStripper/archive/refs/tags/v2.1.0.tar.gz"
27- sha256 " " # Calculate with: shasum -a 256 <downloaded_file>
28- ```
29-
30- 5 . ** Calculate SHA256:**
31- ``` bash
32- # Download the release tarball first
33- curl -L https://github.com/kiku-jw/DocStripper/archive/refs/tags/v2.1.0.tar.gz -o docstripper.tar.gz
34- shasum -a 256 docstripper.tar.gz
35- # Copy the hash to the formula
36- ```
37-
38- 6 . ** Commit and push:**
39- ``` bash
40- git add Formula/docstripper.rb
41- git commit -m " Add docstripper formula"
42- git push origin main
43- ```
44-
45- 7 . ** Users can now install with:**
46- ``` bash
47- brew tap YOUR_USERNAME/docstripper
48- brew install docstripper
49- ```
50-
51- ## Formula Template (for reference)
52-
53- The formula is already created in ` docstripper.rb ` . Make sure it has:
54- - Correct URL pointing to GitHub releases
55- - Correct SHA256 hash
56- - Proper dependencies
3+ ## Quick Setup (Step-by-Step)
4+
5+ ### Step 1: Create Tap Repository on GitHub
6+
7+ 1 . Go to https://github.com/new
8+ 2 . Repository name: ` homebrew-docstripper `
9+ 3 . Make it ** public**
10+ 4 . ** Don't** initialize with README, .gitignore, or license
11+ 5 . Click "Create repository"
12+
13+ ### Step 2: Clone and Setup Locally
14+
15+ ``` bash
16+ git clone https://github.com/kiku-jw/homebrew-docstripper.git
17+ cd homebrew-docstripper
18+ mkdir -p Formula
19+ ```
20+
21+ ### Step 3: Copy Formula
22+
23+ ``` bash
24+ # From DocStripper repo root
25+ cp docstripper.rb Formula/docstripper.rb
26+ cd Formula
27+ ```
28+
29+ ### Step 4: Create GitHub Release (if not exists)
30+
31+ You need a tagged release for Homebrew. If you don't have v2.1.0 release yet:
32+
33+ ``` bash
34+ # In DocStripper repo
35+ git tag v2.1.0
36+ git push origin v2.1.0
37+ ```
38+
39+ Then create a GitHub release at: https://github.com/kiku-jw/DocStripper/releases/new
40+ - Tag: v2.1.0
41+ - Title: v2.1.0
42+ - Description: (can be empty)
43+
44+ ### Step 5: Update Formula URL
45+
46+ Edit ` Formula/docstripper.rb ` and update to point to the release:
47+
48+ ``` ruby
49+ url " https://github.com/kiku-jw/DocStripper/archive/refs/tags/v2.1.0.tar.gz"
50+ ```
51+
52+ ### Step 6: Calculate SHA256 Hash
53+
54+ ``` bash
55+ # Download the release tarball
56+ curl -L https://github.com/kiku-jw/DocStripper/archive/refs/tags/v2.1.0.tar.gz -o docstripper.tar.gz
57+
58+ # Calculate hash
59+ shasum -a 256 docstripper.tar.gz
60+ # Copy the hash (first part before spaces)
61+ ```
62+
63+ Update the formula:
64+ ``` ruby
65+ sha256 " PASTE_HASH_HERE"
66+ ```
67+
68+ ### Step 7: Commit and Push
69+
70+ ``` bash
71+ cd .. # Back to tap repo root
72+ git add Formula/docstripper.rb
73+ git commit -m " Add docstripper formula"
74+ git push origin main
75+ ```
76+
77+ ### Step 8: Test Installation
78+
79+ ``` bash
80+ # Test locally first
81+ brew install --build-from-source Formula/docstripper.rb
82+
83+ # If successful, users can now install with:
84+ brew tap kiku-jw/docstripper
85+ brew install docstripper
86+ ```
87+
88+ ### Step 9: Update INSTALL.md and README
89+
90+ Update installation instructions to mention the tap:
91+ ``` bash
92+ brew tap kiku-jw/docstripper
93+ brew install docstripper
94+ ```
5795
5896## Updating the Formula
5997
@@ -63,10 +101,15 @@ When releasing a new version:
631013 . Update version in formula
641024 . Commit and push to tap repo
65103
66- ## Testing
104+ ## Troubleshooting
105+
106+ ** Formula fails to install:**
107+ - Check URL is accessible
108+ - Verify SHA256 hash matches
109+ - Ensure dependencies are correct
110+ - Test locally: ` brew install --build-from-source Formula/docstripper.rb `
67111
68- Before pushing, test locally:
112+ ** Formula audit: **
69113``` bash
70- brew install --build-from-source Formula/docstripper.rb
71- brew test docstripper
72- ```
114+ brew audit --strict Formula/docstripper.rb
115+ ```
0 commit comments