|
| 1 | +# Publishing Checklist for r2sql |
| 2 | + |
| 3 | +Follow these steps to publish r2sql to Homebrew. |
| 4 | + |
| 5 | +## Pre-publishing |
| 6 | + |
| 7 | +- [ ] Update version in `package.json` if needed |
| 8 | +- [ ] Run `npm run build` to ensure code compiles |
| 9 | +- [ ] Test the CLI locally: `npm start -- --help` |
| 10 | + |
| 11 | +## Step 1: Build Executables |
| 12 | + |
| 13 | +```bash |
| 14 | +cd /Users/mselwan/Documents/r2sql-shell |
| 15 | +npm run package:all |
| 16 | +``` |
| 17 | + |
| 18 | +- [ ] Verify `bin/r2sql-shell-macos` exists |
| 19 | +- [ ] Verify `bin/r2sql-shell-linux` exists |
| 20 | +- [ ] Verify `bin/r2sql-shell-win.exe` exists |
| 21 | + |
| 22 | +## Step 2: Test macOS Binary |
| 23 | + |
| 24 | +```bash |
| 25 | +chmod +x bin/r2sql-shell-macos |
| 26 | +./bin/r2sql-shell-macos --version |
| 27 | +./bin/r2sql-shell-macos --help |
| 28 | +``` |
| 29 | + |
| 30 | +- [ ] Version displays correctly |
| 31 | +- [ ] Help displays correctly |
| 32 | + |
| 33 | +## Step 3: Calculate SHA256 Hash |
| 34 | + |
| 35 | +```bash |
| 36 | +shasum -a 256 bin/r2sql-shell-macos |
| 37 | +``` |
| 38 | + |
| 39 | +- [ ] Copy and save this hash - you'll need it later! |
| 40 | + |
| 41 | +**Your SHA256 hash:** |
| 42 | +``` |
| 43 | +_______________________________________________________________ |
| 44 | +``` |
| 45 | + |
| 46 | +## Step 4: Create GitHub Repository |
| 47 | + |
| 48 | +1. Go to: https://github.com/new |
| 49 | +2. Repository name: `r2sql` |
| 50 | +3. Description: `Interactive shell for querying R2 Data Catalog with R2 SQL` |
| 51 | +4. Public repository |
| 52 | +5. Do NOT initialize with README |
| 53 | + |
| 54 | +- [ ] Repository created |
| 55 | + |
| 56 | +**Your repository URL:** |
| 57 | +``` |
| 58 | +https://github.com/_____________/r2sql |
| 59 | +``` |
| 60 | + |
| 61 | +## Step 5: Push Code to GitHub |
| 62 | + |
| 63 | +```bash |
| 64 | +cd /Users/mselwan/Documents/r2sql-shell |
| 65 | + |
| 66 | +# If not already initialized |
| 67 | +git init |
| 68 | +git add . |
| 69 | +git commit -m "Initial release: R2 SQL Shell v1.0.0" |
| 70 | + |
| 71 | +# Replace YOUR_USERNAME with your GitHub username |
| 72 | +git remote add origin https://github.com/YOUR_USERNAME/r2sql.git |
| 73 | +git branch -M main |
| 74 | +git push -u origin main |
| 75 | +``` |
| 76 | + |
| 77 | +- [ ] Code pushed to GitHub |
| 78 | +- [ ] Verify code is visible on GitHub |
| 79 | + |
| 80 | +## Step 6: Create GitHub Release |
| 81 | + |
| 82 | +1. Go to: `https://github.com/YOUR_USERNAME/r2sql/releases/new` |
| 83 | +2. Tag version: `v1.0.0` |
| 84 | +3. Release title: `v1.0.0 - Initial Release` |
| 85 | +4. Upload these files as release assets: |
| 86 | + - `bin/r2sql-shell-macos` → rename to `r2sql-macos` |
| 87 | + - `bin/r2sql-shell-linux` → rename to `r2sql-linux` |
| 88 | + - `bin/r2sql-shell-win.exe` → rename to `r2sql-win.exe` |
| 89 | +5. Click "Publish release" |
| 90 | + |
| 91 | +- [ ] Release created |
| 92 | +- [ ] Assets uploaded and renamed correctly |
| 93 | + |
| 94 | +**Your release URL:** |
| 95 | +``` |
| 96 | +https://github.com/_____________/r2sql/releases/tag/v1.0.0 |
| 97 | +``` |
| 98 | + |
| 99 | +## Step 7: Create Homebrew Tap Repository |
| 100 | + |
| 101 | +1. Go to: https://github.com/new |
| 102 | +2. Repository name: `homebrew-r2sql` |
| 103 | +3. Description: `Homebrew tap for r2sql` |
| 104 | +4. Public repository |
| 105 | +5. Initialize with README |
| 106 | + |
| 107 | +- [ ] Tap repository created |
| 108 | + |
| 109 | +**Your tap URL:** |
| 110 | +``` |
| 111 | +https://github.com/_____________/homebrew-r2sql |
| 112 | +``` |
| 113 | + |
| 114 | +## Step 8: Create Homebrew Formula |
| 115 | + |
| 116 | +```bash |
| 117 | +cd ~/ |
| 118 | +git clone https://github.com/YOUR_USERNAME/homebrew-r2sql.git |
| 119 | +cd homebrew-r2sql |
| 120 | +mkdir -p Formula |
| 121 | +``` |
| 122 | + |
| 123 | +Create `Formula/r2sql.rb` with this content (use the template from `homebrew-formula-template.rb`): |
| 124 | + |
| 125 | +```ruby |
| 126 | +class R2sql < Formula |
| 127 | + desc "Interactive shell for querying R2 Data Catalog with R2 SQL" |
| 128 | + homepage "https://github.com/YOUR_USERNAME/r2sql" |
| 129 | + url "https://github.com/YOUR_USERNAME/r2sql/releases/download/v1.0.0/r2sql-macos" |
| 130 | + sha256 "PASTE_YOUR_SHA256_FROM_STEP_3" |
| 131 | + version "1.0.0" |
| 132 | + license "MIT" |
| 133 | + |
| 134 | + def install |
| 135 | + bin.install "r2sql-macos" => "r2sql" |
| 136 | + end |
| 137 | + |
| 138 | + test do |
| 139 | + assert_match "1.0.0", shell_output("#{bin}/r2sql --version") |
| 140 | + end |
| 141 | +end |
| 142 | +``` |
| 143 | + |
| 144 | +**Important replacements:** |
| 145 | +- Replace `YOUR_USERNAME` with your GitHub username (2 places) |
| 146 | +- Replace `PASTE_YOUR_SHA256_FROM_STEP_3` with the hash from Step 3 |
| 147 | + |
| 148 | +```bash |
| 149 | +# Commit and push |
| 150 | +git add Formula/r2sql.rb |
| 151 | +git commit -m "Add r2sql formula v1.0.0" |
| 152 | +git push origin main |
| 153 | +``` |
| 154 | + |
| 155 | +- [ ] Formula file created and pushed |
| 156 | + |
| 157 | +## Step 9: Test Installation |
| 158 | + |
| 159 | +```bash |
| 160 | +# Add your tap |
| 161 | +brew tap YOUR_USERNAME/r2sql |
| 162 | + |
| 163 | +# Install |
| 164 | +brew install r2sql |
| 165 | + |
| 166 | +# Test |
| 167 | +r2sql --version |
| 168 | +r2sql --help |
| 169 | +``` |
| 170 | + |
| 171 | +- [ ] Tap added successfully |
| 172 | +- [ ] Package installed successfully |
| 173 | +- [ ] `r2sql --version` works |
| 174 | +- [ ] `r2sql --help` works |
| 175 | + |
| 176 | +## Step 10: Update README |
| 177 | + |
| 178 | +Update the README.md in your main repository to replace `YOUR_USERNAME` with your actual GitHub username: |
| 179 | + |
| 180 | +```bash |
| 181 | +cd /Users/mselwan/Documents/r2sql-shell |
| 182 | +# Edit README.md and replace YOUR_USERNAME |
| 183 | +git add README.md |
| 184 | +git commit -m "Update README with actual GitHub username" |
| 185 | +git push origin main |
| 186 | +``` |
| 187 | + |
| 188 | +- [ ] README updated with correct installation instructions |
| 189 | + |
| 190 | +## 🎉 Done! |
| 191 | + |
| 192 | +Users can now install with: |
| 193 | + |
| 194 | +```bash |
| 195 | +brew tap YOUR_USERNAME/r2sql |
| 196 | +brew install r2sql |
| 197 | +``` |
| 198 | + |
| 199 | +## For Future Releases |
| 200 | + |
| 201 | +When releasing v1.1.0, v1.2.0, etc.: |
| 202 | + |
| 203 | +1. Update version in `package.json` |
| 204 | +2. Run `npm run package:all` |
| 205 | +3. Calculate new SHA256: `shasum -a 256 bin/r2sql-shell-macos` |
| 206 | +4. Create new GitHub release with new tag and binaries |
| 207 | +5. Update `Formula/r2sql.rb` with new version, URL, and SHA256 |
| 208 | +6. Commit and push the formula update |
| 209 | + |
| 210 | +Users will update with: |
| 211 | +```bash |
| 212 | +brew update |
| 213 | +brew upgrade r2sql |
| 214 | +``` |
| 215 | + |
| 216 | +## Troubleshooting |
| 217 | + |
| 218 | +**"SHA256 mismatch"** |
| 219 | +- Recalculate the hash of your binary |
| 220 | +- Make sure you're using the exact file from the release |
| 221 | + |
| 222 | +**"Cannot download"** |
| 223 | +- Verify the release URL is correct |
| 224 | +- Make sure binaries were uploaded as release assets |
| 225 | + |
| 226 | +**Need help?** |
| 227 | +See [HOMEBREW_SETUP.md](HOMEBREW_SETUP.md) for detailed instructions. |
0 commit comments