|
| 1 | +# Publishing Configuration Files |
| 2 | + |
| 3 | +This directory contains all the configuration files needed to publish Document Stitcher to various package managers across Windows, macOS, and Linux. |
| 4 | + |
| 5 | +## Directory Structure |
| 6 | + |
| 7 | +``` |
| 8 | +publishing/ |
| 9 | +├── brew/ # Homebrew (macOS/Linux) |
| 10 | +│ └── document-stitcher.rb |
| 11 | +├── chocolatey/ # Chocolatey (Windows) |
| 12 | +│ ├── document-stitcher.nuspec |
| 13 | +│ └── tools/ |
| 14 | +│ ├── chocolateyinstall.ps1 |
| 15 | +│ ├── chocolateyuninstall.ps1 |
| 16 | +│ └── VERIFICATION.txt |
| 17 | +├── scoop/ # Scoop (Windows) |
| 18 | +│ └── document-stitcher.json |
| 19 | +└── snap/ # Snapcraft (Linux) |
| 20 | + └── snapcraft.yaml |
| 21 | +``` |
| 22 | + |
| 23 | +## Quick Start |
| 24 | + |
| 25 | +1. **Replace `yourusername`** with your actual GitHub username in all files |
| 26 | +2. **Create GitHub releases** with the automated workflow (`.github/workflows/release.yml`) |
| 27 | +3. **Update checksums** after each release |
| 28 | +4. **Follow platform-specific instructions** below |
| 29 | + |
| 30 | +## Publishing Instructions |
| 31 | + |
| 32 | +### Prerequisites |
| 33 | + |
| 34 | +- **GitHub Repository**: Project hosted on GitHub |
| 35 | +- **GitHub Releases**: Automated binary builds via GitHub Actions |
| 36 | +- **Replace placeholders**: Update `yourusername` with your actual GitHub username |
| 37 | +- **Test builds**: Ensure binaries work on target platforms |
| 38 | + |
| 39 | +### Homebrew (macOS/Linux) |
| 40 | + |
| 41 | +**For macOS and Linux users** |
| 42 | + |
| 43 | +1. **Create a Homebrew tap**: |
| 44 | + ```bash |
| 45 | + # Create a new repository: yourusername/homebrew-tap |
| 46 | + # Or use existing tap |
| 47 | + ``` |
| 48 | + |
| 49 | +2. **Add the formula**: |
| 50 | + ```bash |
| 51 | + # Copy brew/document-stitcher.rb to your tap |
| 52 | + cp publishing/brew/document-stitcher.rb ~/path/to/your/homebrew-tap/Formula/ |
| 53 | + ``` |
| 54 | + |
| 55 | +3. **Update checksums**: |
| 56 | + - After creating a GitHub release, update the SHA256 hashes in the formula |
| 57 | + - Use `shasum -a 256 downloaded-binary` to calculate checksums |
| 58 | + |
| 59 | +4. **Test locally**: |
| 60 | + ```bash |
| 61 | + brew install --build-from-source yourusername/tap/document-stitcher |
| 62 | + ``` |
| 63 | + |
| 64 | +5. **Publish**: Push changes to your tap repository |
| 65 | + |
| 66 | +**Users install with**: |
| 67 | +```bash |
| 68 | +brew install yourusername/tap/document-stitcher |
| 69 | +``` |
| 70 | + |
| 71 | +### Chocolatey (Windows) |
| 72 | + |
| 73 | +**For Windows users via Chocolatey package manager** |
| 74 | + |
| 75 | +1. **Create Chocolatey account**: https://chocolatey.org/account/Register |
| 76 | + |
| 77 | +2. **Update package files**: |
| 78 | + - Edit `chocolatey/tools/chocolateyinstall.ps1` with correct URLs and checksums |
| 79 | + - Update version in `chocolatey/document-stitcher.nuspec` |
| 80 | + |
| 81 | +3. **Test locally**: |
| 82 | + ```powershell |
| 83 | + choco pack chocolatey/document-stitcher.nuspec |
| 84 | + choco install document-stitcher -s . |
| 85 | + ``` |
| 86 | + |
| 87 | +4. **Submit to Chocolatey**: |
| 88 | + ```powershell |
| 89 | + choco push document-stitcher.1.0.0.nupkg --source https://push.chocolatey.org/ |
| 90 | + ``` |
| 91 | + |
| 92 | +**Users install with**: |
| 93 | +```powershell |
| 94 | +choco install document-stitcher |
| 95 | +``` |
| 96 | + |
| 97 | +### Scoop (Windows) |
| 98 | + |
| 99 | +**For Windows users via Scoop package manager** |
| 100 | + |
| 101 | +1. **Fork the main bucket**: https://github.com/ScoopInstaller/Main |
| 102 | + |
| 103 | +2. **Add manifest**: |
| 104 | + - Copy `scoop/document-stitcher.json` to your fork |
| 105 | + - Update URL and hash for the Windows binary |
| 106 | + |
| 107 | +3. **Test locally**: |
| 108 | + ```powershell |
| 109 | + scoop install document-stitcher.json |
| 110 | + ``` |
| 111 | + |
| 112 | +4. **Submit PR**: Create a pull request to the main Scoop repository |
| 113 | + |
| 114 | +**Users install with**: |
| 115 | +```powershell |
| 116 | +scoop install document-stitcher |
| 117 | +``` |
| 118 | + |
| 119 | +### Snapcraft (Linux) |
| 120 | + |
| 121 | +**For Linux users via Ubuntu Software Center and other snap-supporting systems** |
| 122 | + |
| 123 | +1. **Install Snapcraft**: |
| 124 | + ```bash |
| 125 | + sudo snap install snapcraft --classic |
| 126 | + ``` |
| 127 | + |
| 128 | +2. **Setup for publishing**: |
| 129 | + ```bash |
| 130 | + snapcraft login |
| 131 | + snapcraft register document-stitcher # if not already registered |
| 132 | + ``` |
| 133 | + |
| 134 | +3. **Build and publish**: |
| 135 | + ```bash |
| 136 | + cp publishing/snap/snapcraft.yaml . |
| 137 | + snapcraft # builds the snap |
| 138 | + snapcraft upload --release=stable document-stitcher_1.0.0_amd64.snap |
| 139 | + ``` |
| 140 | + |
| 141 | +**Users install with**: |
| 142 | +```bash |
| 143 | +sudo snap install document-stitcher |
| 144 | +``` |
| 145 | + |
| 146 | +### npm (Cross-platform) |
| 147 | + |
| 148 | +**For developers and cross-platform users** |
| 149 | + |
| 150 | +1. **Update package.json**: |
| 151 | + - Ensure `bin` field points to `./bin/document-stitcher` |
| 152 | + - Add repository, bugs, and homepage fields |
| 153 | + |
| 154 | +2. **Publish to npm**: |
| 155 | + ```bash |
| 156 | + npm login |
| 157 | + npm publish |
| 158 | + ``` |
| 159 | + |
| 160 | +**Users install with**: |
| 161 | +```bash |
| 162 | +npm install -g document-stitcher |
| 163 | +``` |
| 164 | + |
| 165 | +## Version Updates |
| 166 | + |
| 167 | +When releasing a new version: |
| 168 | + |
| 169 | +1. **Update version numbers** in all configuration files |
| 170 | +2. **Create GitHub release** (triggers automated builds) |
| 171 | +3. **Update checksums** with new binary hashes |
| 172 | +4. **Update URLs** to point to new release assets |
| 173 | +5. **Test installations** on each platform |
| 174 | +6. **Submit updates** to package managers |
| 175 | + |
| 176 | +## Automation |
| 177 | + |
| 178 | +The GitHub Actions workflow (`.github/workflows/release.yml`) automatically: |
| 179 | +- Builds binaries for Windows, macOS (Intel/Apple Silicon), and Linux |
| 180 | +- Creates GitHub releases with all platform binaries |
| 181 | +- Calculates checksums for verification |
| 182 | + |
| 183 | +## Troubleshooting |
| 184 | + |
| 185 | +### Common Issues |
| 186 | + |
| 187 | +- **Checksum mismatches**: Recalculate after each release |
| 188 | +- **Permission errors**: Ensure proper file permissions on binaries |
| 189 | +- **Path issues**: Use absolute paths in package configurations |
| 190 | +- **Architecture mismatches**: Ensure correct binary for target platform |
| 191 | + |
| 192 | +### Testing |
| 193 | + |
| 194 | +Test installations on clean environments: |
| 195 | +- **Windows**: Use Windows Sandbox or Virtual Machine |
| 196 | +- **macOS**: Use GitHub Codespaces or clean VM |
| 197 | +- **Linux**: Use Docker containers for different distributions |
| 198 | + |
| 199 | +## Support |
| 200 | + |
| 201 | +- **GitHub Issues**: Report bugs and request features |
| 202 | +- **Package Manager Docs**: Check official documentation for each platform |
| 203 | +- **Community**: Join discussions in respective package manager communities |
0 commit comments