Skip to content

Commit ccf4b28

Browse files
teunbrandclaude
andauthored
Add installers (#91)
* feat: add cross-platform installers using cargo-packager - Add cargo-packager configuration to src/Cargo.toml - Configured for Windows (NSIS, MSI), macOS (DMG), and Linux (Deb, RPM, AppImage) - Includes ggsql CLI and ggsql-rest binaries - Uses existing logo/icon assets - Add GitHub Actions workflow for automated releases - Builds installers for Windows, macOS, and Linux - Triggers on version tags (v*) - Uploads all installers to GitHub Releases - Add INSTALLERS.md documentation - Local build instructions for all platforms - Installation guides - CI/CD usage - Troubleshooting tips - Update .gitignore to exclude installer artifacts - *.msi, *.deb, *.rpm, *.dmg, *.AppImage - .cargo-packager/ directory Verified working: Windows NSIS and MSI installers tested successfully. Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com> * refactor: exclude REST API server from installers - Remove ggsql-rest from packaged binaries - Installers now only include the core CLI (ggsql) - Users can install ggsql-rest separately via cargo if needed - Reduces installer size: NSIS 22MB→12MB, MSI 31MB→15MB Updated documentation to reflect that ggsql-rest and ggsql-jupyter must be installed separately via cargo. Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com> * fix(ci): resolve installer build failures across all platforms - Linux: Update libwebkit2gtk-4.0-dev to libwebkit2gtk-4.1-dev for Ubuntu 24.04 - macOS: Remove SVG icon (not supported), use PNG only - All platforms: Add explicit binary build steps before packaging Fixes GitHub Actions workflow failures: - Linux: Package not found error - macOS: SVG format not recognized - Windows: Binary path not found Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com> * fix(ci): remove unsupported RPM format from Linux builds cargo-packager does not support RPM format. Removed RPM build steps from the workflow and updated documentation accordingly. Supported Linux formats: - Debian (.deb) - for Debian/Ubuntu - AppImage - portable, distribution-agnostic Also updated Windows installer sizes in docs to reflect actual sizes after removing REST API (NSIS: 12MB, MSI: 15MB). Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com> * fix(ci): remove AppImage format from Linux builds AppImage requires a square icon which we don't currently have. Simplified Linux builds to only produce Debian packages (.deb), which cover the majority of Linux users (Ubuntu, Debian, Mint, etc.). Removed formats: - AppImage (requires square icon) - RPM (not supported by cargo-packager) Remaining formats: - Windows: NSIS (.exe) and MSI - macOS: DMG (x86_64 and arm64) - Linux: Debian (.deb) Updated all documentation to reflect these changes. Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com> * docs: add package metadata for installers Added comprehensive metadata to cargo-packager configuration: - Homepage: https://ggsql.org/ - Short description for package managers - Long description with feature overview - Copyright notice This metadata will appear in installer UI and package manager listings across all platforms (Windows, macOS, Linux). Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com> * fix: replace Unicode smart quotes with ASCII quotes in LICENSE Replaced Unicode curly quotes (" ") with plain ASCII double quotes (") to fix character encoding issues in Windows installers. The NSIS installer was displaying mojibake (“Softwareâ€) instead of proper quotes. This fix ensures the license text displays correctly across all installers and platforms. Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com> * fix: rename short-description to description in packager config The correct field name is 'description', not 'short-description'. This was causing cargo-packager to fail with an unknown field error. Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com> * docs: add Release & Distribution section to CLAUDE.md Add comprehensive release process documentation including: - Cross-platform installer overview - Step-by-step release checklist - Known limitations and workarounds - Current and future distribution channels Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com> * ci: remove redundant binary build steps from installer workflow cargo-packager builds binaries automatically when creating installers, so explicit cargo build steps are unnecessary. Removes 4 redundant steps: - Windows: 1 build step - macOS: 2 build steps (x86_64 and aarch64) - Linux: 1 build step Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com> * Revert "ci: remove redundant binary build steps from installer workflow" This reverts commit 0217fe3. The build steps are actually required because cargo-packager does not build binaries when run from a workspace subdirectory. It expects binaries to already exist in the target directory. The explicit build steps ensure binaries are placed in the correct location before cargo-packager attempts to package them. Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com> * ci: use working-directory directive instead of explicit cd commands Replace multi-line cd commands with cleaner working-directory directive for all cargo packager steps. Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com> * docs: update installation instructions with native installer info Replace build-from-source-only instructions with: - Native installer downloads (Windows/macOS/Linux) - Platform-specific installation steps - Security warning explanations - Component availability (CLI only in installers) - Build-from-source as alternative option Co-Authored-By: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com> * For now comment out the release installer bit. --------- Co-authored-by: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>
1 parent 25356a2 commit ccf4b28

7 files changed

Lines changed: 603 additions & 7 deletions

File tree

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
name: Release Installers
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger on version tags (e.g., v0.1.0)
7+
workflow_dispatch: # Allow manual triggering
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build-windows:
14+
name: Build Windows Installers
15+
runs-on: windows-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Install Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
26+
- name: Install tree-sitter-cli
27+
run: npm install -g tree-sitter-cli
28+
29+
- name: Install Rust toolchain
30+
uses: dtolnay/rust-toolchain@stable
31+
with:
32+
targets: x86_64-pc-windows-msvc
33+
34+
- name: Rust cache
35+
uses: Swatinem/rust-cache@v2
36+
with:
37+
shared-key: windows-release
38+
39+
- name: Install cargo-packager
40+
run: cargo install cargo-packager --locked
41+
42+
- name: Build ggsql binary
43+
run: cargo build --release --package ggsql --bin ggsql
44+
45+
- name: Build NSIS installer
46+
run: cargo packager --release --formats nsis
47+
working-directory: src
48+
49+
- name: Build MSI installer
50+
run: cargo packager --release --formats wix
51+
working-directory: src
52+
53+
- name: Upload NSIS installer
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: ggsql-windows-nsis
57+
path: src/target/release/packager/*.exe
58+
retention-days: 30
59+
60+
- name: Upload MSI installer
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: ggsql-windows-msi
64+
path: src/target/release/packager/*.msi
65+
retention-days: 30
66+
67+
build-macos:
68+
name: Build macOS Installers
69+
runs-on: macos-latest
70+
71+
steps:
72+
- name: Checkout code
73+
uses: actions/checkout@v4
74+
75+
- name: Install Node.js
76+
uses: actions/setup-node@v4
77+
with:
78+
node-version: '20'
79+
80+
- name: Install tree-sitter-cli
81+
run: npm install -g tree-sitter-cli
82+
83+
- name: Install Rust toolchain
84+
uses: dtolnay/rust-toolchain@stable
85+
with:
86+
targets: x86_64-apple-darwin, aarch64-apple-darwin
87+
88+
- name: Rust cache
89+
uses: Swatinem/rust-cache@v2
90+
with:
91+
shared-key: macos-release
92+
93+
- name: Install cargo-packager
94+
run: cargo install cargo-packager --locked
95+
96+
- name: Build ggsql binary (x86_64)
97+
run: cargo build --release --package ggsql --bin ggsql
98+
99+
- name: Build DMG installer (x86_64)
100+
run: cargo packager --release --formats dmg
101+
working-directory: src
102+
103+
- name: Build ggsql binary (aarch64)
104+
run: cargo build --release --package ggsql --bin ggsql --target aarch64-apple-darwin
105+
106+
- name: Build DMG installer (aarch64)
107+
run: cargo packager --release --target aarch64-apple-darwin --formats dmg
108+
working-directory: src
109+
110+
- name: Upload DMG installers
111+
uses: actions/upload-artifact@v4
112+
with:
113+
name: ggsql-macos-dmg
114+
path: src/target/release/packager/*.dmg
115+
retention-days: 30
116+
117+
build-linux:
118+
name: Build Linux Installers
119+
runs-on: ubuntu-latest
120+
121+
steps:
122+
- name: Checkout code
123+
uses: actions/checkout@v4
124+
125+
- name: Install Node.js
126+
uses: actions/setup-node@v4
127+
with:
128+
node-version: '20'
129+
130+
- name: Install tree-sitter-cli
131+
run: npm install -g tree-sitter-cli
132+
133+
- name: Install Rust toolchain
134+
uses: dtolnay/rust-toolchain@stable
135+
with:
136+
targets: x86_64-unknown-linux-gnu
137+
138+
- name: Rust cache
139+
uses: Swatinem/rust-cache@v2
140+
with:
141+
shared-key: linux-release
142+
143+
- name: Install system dependencies
144+
run: |
145+
sudo apt-get update
146+
sudo apt-get install -y \
147+
libgtk-3-dev \
148+
libwebkit2gtk-4.1-dev \
149+
libappindicator3-dev \
150+
librsvg2-dev \
151+
patchelf
152+
153+
- name: Install cargo-packager
154+
run: cargo install cargo-packager --locked
155+
156+
- name: Build ggsql binary
157+
run: cargo build --release --package ggsql --bin ggsql
158+
159+
- name: Build Debian package
160+
run: cargo packager --release --formats deb
161+
working-directory: src
162+
163+
- name: Upload Debian package
164+
uses: actions/upload-artifact@v4
165+
with:
166+
name: ggsql-linux-deb
167+
path: src/target/release/packager/*.deb
168+
retention-days: 30
169+
170+
create-release:
171+
name: Create GitHub Release
172+
needs: [build-windows, build-macos, build-linux]
173+
runs-on: ubuntu-latest
174+
if: startsWith(github.ref, 'refs/tags/v')
175+
176+
steps:
177+
- name: Download all artifacts
178+
uses: actions/download-artifact@v4
179+
with:
180+
path: artifacts
181+
182+
- name: Display structure of downloaded files
183+
run: ls -R artifacts
184+
185+
- name: Create release and upload installers
186+
uses: softprops/action-gh-release@v1
187+
with:
188+
files: |
189+
artifacts/**/*.exe
190+
artifacts/**/*.msi
191+
artifacts/**/*.dmg
192+
artifacts/**/*.deb
193+
draft: false
194+
prerelease: false
195+
generate_release_notes: true
196+
env:
197+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,11 @@ pkg/
141141
*.Rdata
142142
.Rproj.user
143143
ggsql.Rcheck/
144+
145+
# cargo-packager artifacts
146+
*.msi
147+
*.deb
148+
*.rpm
149+
*.dmg
150+
*.AppImage
151+
.cargo-packager/

CLAUDE.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,85 @@ cargo build --all-features
10771077

10781078
---
10791079

1080+
## Release & Distribution
1081+
1082+
### Cross-Platform Installers
1083+
1084+
ggsql uses [cargo-packager](https://github.com/crabnebula-dev/cargo-packager) to create native installers for Windows, macOS, and Linux. See [INSTALLERS.md](../INSTALLERS.md) for detailed build instructions.
1085+
1086+
**Supported Formats**:
1087+
1088+
- **Windows**: NSIS (.exe), MSI (.msi)
1089+
- **macOS**: DMG (.dmg)
1090+
- **Linux**: Debian (.deb)
1091+
1092+
**What Gets Packaged**:
1093+
1094+
-`ggsql` CLI binary only
1095+
-`ggsql-rest` API server (install separately with `cargo install ggsql --features rest-api`)
1096+
-`ggsql-jupyter` kernel (install separately with `cargo install ggsql-jupyter`)
1097+
1098+
### Release Process
1099+
1100+
**Creating a Release**:
1101+
1102+
1. **Update version** in workspace `Cargo.toml`
1103+
2. **Update CHANGELOG** (if exists) with release notes
1104+
3. **Test installers locally** (at least one platform):
1105+
```bash
1106+
cd src
1107+
cargo packager --release --formats nsis # Windows
1108+
cargo packager --release --formats dmg # macOS
1109+
cargo packager --release --formats deb # Linux
1110+
```
1111+
4. **Create and push version tag**:
1112+
```bash
1113+
git tag v0.1.0
1114+
git push origin v0.1.0
1115+
```
1116+
5. **GitHub Actions will automatically**:
1117+
- Build installers for all platforms
1118+
- Create GitHub Release
1119+
- Attach installers as release assets
1120+
- Generate release notes
1121+
1122+
**Manual Workflow Trigger** (for testing):
1123+
```bash
1124+
gh workflow run release-installers.yml
1125+
```
1126+
1127+
### Known Limitations
1128+
1129+
**Installers**:
1130+
1131+
- Installers are unsigned (users may see security warnings)
1132+
- macOS installers require users to run `xattr -cr /Applications/ggsql.app` if unsigned
1133+
- Windows SmartScreen may show "Windows protected your PC" warning
1134+
- Production releases should use code signing certificates
1135+
1136+
**License Display**:
1137+
1138+
- LICENSE.md must use ASCII quotes (not Unicode smart quotes) for proper Windows installer display
1139+
- Verify with: `cargo packager --release --formats nsis` and test installer UI
1140+
1141+
### Distribution Channels
1142+
1143+
**Current**:
1144+
1145+
- GitHub Releases (automated via GitHub Actions)
1146+
- Manual local builds via cargo-packager
1147+
1148+
**Future** (not yet implemented):
1149+
1150+
- Homebrew tap (macOS/Linux)
1151+
- Chocolatey (Windows)
1152+
- Scoop (Windows)
1153+
- apt repository (Debian/Ubuntu)
1154+
- crates.io (Rust library)
1155+
- PyPI (Python bindings)
1156+
1157+
---
1158+
10801159
## Grammar Deep Dive
10811160

10821161
### ggsql Grammar Structure

0 commit comments

Comments
 (0)