Skip to content

Commit 3c86cae

Browse files
authored
Update various Cargo.toml ready for crates.io publishing, and add to installers release workflow (#203)
* Update repository, homepage and description in Cargo.toml * Define tree-sitter-ggsql dependency in workspace Cargo.toml * Reorganise workspace dependencies * Update Cargo.toml and move data directory * Release cargo packages as part of installer release workflow * Restore `default-features = false` in ggsql-wasm * Update ggsql-jupyer/README.md * Restore `default-features = false` in ggsql-python
1 parent 1206eed commit 3c86cae

12 files changed

Lines changed: 108 additions & 27 deletions

File tree

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Release Installers
1+
name: Release Cargo and Installer Packages
22

33
on:
44
push:
55
tags:
6-
- 'v*' # Trigger on version tags (e.g., v0.1.0)
7-
workflow_dispatch: # Allow manual triggering
6+
- "v*" # Trigger on version tags (e.g., v0.1.0)
7+
workflow_dispatch: # Allow manual triggering
88

99
env:
1010
CARGO_TERM_COLOR: always
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install Node.js
2222
uses: actions/setup-node@v4
2323
with:
24-
node-version: '20'
24+
node-version: "20"
2525

2626
- name: Install tree-sitter-cli
2727
run: npm install -g tree-sitter-cli
@@ -75,7 +75,7 @@ jobs:
7575
- name: Install Node.js
7676
uses: actions/setup-node@v4
7777
with:
78-
node-version: '20'
78+
node-version: "20"
7979

8080
- name: Install tree-sitter-cli
8181
run: npm install -g tree-sitter-cli
@@ -125,7 +125,7 @@ jobs:
125125
- name: Install Node.js
126126
uses: actions/setup-node@v4
127127
with:
128-
node-version: '20'
128+
node-version: "20"
129129

130130
- name: Install tree-sitter-cli
131131
run: npm install -g tree-sitter-cli
@@ -167,9 +167,61 @@ jobs:
167167
path: src/target/release/packager/*.deb
168168
retention-days: 30
169169

170+
build-cargo:
171+
name: Publish to crates.io
172+
runs-on: ubuntu-latest
173+
permissions:
174+
id-token: write
175+
contents: read
176+
177+
steps:
178+
- name: Checkout code
179+
uses: actions/checkout@v4
180+
181+
- name: Install Node.js
182+
uses: actions/setup-node@v4
183+
with:
184+
node-version: "20"
185+
186+
- name: Install tree-sitter-cli
187+
run: npm install -g tree-sitter-cli
188+
189+
- name: Install Rust toolchain
190+
uses: dtolnay/rust-toolchain@stable
191+
192+
- name: Rust cache
193+
uses: Swatinem/rust-cache@v2
194+
with:
195+
shared-key: cargo-publish
196+
197+
- name: Get crates.io publish token
198+
uses: rust-lang/crates-io-auth-action@v1
199+
id: auth
200+
201+
- name: Publish tree-sitter-ggsql
202+
run: cargo publish --package tree-sitter-ggsql
203+
env:
204+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
205+
206+
- name: Wait for crates.io index update
207+
run: sleep 30
208+
209+
- name: Publish ggsql
210+
run: cargo publish --package ggsql
211+
env:
212+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
213+
214+
- name: Wait for crates.io index update
215+
run: sleep 30
216+
217+
- name: Publish ggsql-jupyter
218+
run: cargo publish --package ggsql-jupyter
219+
env:
220+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
221+
170222
create-release:
171223
name: Create GitHub Release
172-
needs: [build-windows, build-macos, build-linux]
224+
needs: [build-windows, build-macos, build-linux, build-cargo]
173225
runs-on: ubuntu-latest
174226
if: startsWith(github.ref, 'refs/tags/v')
175227

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ docs/_build/
9797
*.db
9898
*.sqlite
9999
*.sqlite3
100-
!data/*.parquet
100+
!src/data/*.parquet
101101

102102
# Configuration files
103103
.env

Cargo.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ version = "0.1.0"
2020
edition = "2021"
2121
authors = ["ggsql Team"]
2222
license = "MIT"
23-
repository = "https://github.com/georgestagg/ggsql"
24-
homepage = "https://github.com/georgestagg/ggsql"
25-
description = "SQL extension for declarative data visualization"
23+
repository = "https://github.com/posit-dev/ggsql"
24+
homepage = "https://ggsql.org"
25+
description = "A declarative visualization language that extends SQL with powerful data visualization capabilities."
2626

2727
[workspace.dependencies]
28+
# workspace packages
29+
tree-sitter-ggsql = { path = "tree-sitter-ggsql", version = "0.1.0" }
30+
ggsql = { path = "src", version = "0.1.0" }
31+
2832
# Parsing
29-
tree-sitter = "0.26"
3033
csscolorparser = "0.8.1"
34+
tree-sitter = "0.26"
3135

3236
# Data processing
3337
polars = { version = "0.52", default-features = false }

ggsql-jupyter/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ version.workspace = true
44
edition.workspace = true
55
authors.workspace = true
66
license.workspace = true
7+
repository.workspace = true
8+
homepage.workspace = true
79
description = "Jupyter kernel for ggsql"
810

911
[[bin]]
@@ -16,7 +18,7 @@ path = "src/lib.rs"
1618

1719
[dependencies]
1820
# Core ggsql library
19-
ggsql = { path = "../src", features = ["duckdb", "vegalite"] }
21+
ggsql = { workspace = true, features = ["duckdb", "vegalite"] }
2022

2123
# Need polars for DataFrame type
2224
polars = { workspace = true }

ggsql-jupyter/README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,26 @@ ggsql-jupyter --install
4040

4141
The `--install` flag registers the kernel with Jupyter. It automatically detects and respects your current environment (virtualenv, conda, uv, etc.).
4242

43-
### Option 2: Download Pre-built Binary
43+
### Option 2: Install from crates.io
44+
45+
Requires a [Rust toolchain](https://rustup.rs/):
46+
47+
```bash
48+
cargo install ggsql-jupyter
49+
ggsql-jupyter --install
50+
```
51+
52+
### Option 3: Download Pre-built Binary
4453

4554
Pre-built binaries are available from [GitHub Releases](https://github.com/georgestagg/ggsql/releases):
4655

47-
| Platform | Binary |
48-
| -------------------- | ---------------------------------- |
49-
| Linux (x86_64) | `ggsql-jupyter-linux-x64` |
50-
| Linux (ARM64) | `ggsql-jupyter-linux-arm64` |
51-
| macOS (Intel) | `ggsql-jupyter-macos-x64` |
52-
| macOS (Apple Silicon) | `ggsql-jupyter-macos-arm64` |
53-
| Windows (x64) | `ggsql-jupyter-windows-x64.exe` |
56+
| Platform | Binary |
57+
| --------------------- | ------------------------------- |
58+
| Linux (x86_64) | `ggsql-jupyter-linux-x64` |
59+
| Linux (ARM64) | `ggsql-jupyter-linux-arm64` |
60+
| macOS (Intel) | `ggsql-jupyter-macos-x64` |
61+
| macOS (Apple Silicon) | `ggsql-jupyter-macos-arm64` |
62+
| Windows (x64) | `ggsql-jupyter-windows-x64.exe` |
5463

5564
After downloading, make it executable and install:
5665

@@ -65,7 +74,7 @@ On Windows (PowerShell):
6574
.\ggsql-jupyter-windows-x64.exe --install
6675
```
6776

68-
### Option 3: Build from Source
77+
### Option 4: Build from Source
6978

7079
Requires a [Rust toolchain](https://rustup.rs/). From the workspace root:
7180

ggsql-python/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
name = "ggsql-python"
33
version = "0.1.0"
44
edition = "2021"
5-
license = "MIT"
5+
authors.workspace = true
6+
license.workspace = true
7+
repository.workspace = true
8+
homepage.workspace = true
69
description = "Python bindings for ggsql"
710

811
[lib]

ggsql-wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors.workspace = true
66
license.workspace = true
77
repository.workspace = true
88
homepage.workspace = true
9-
description.workspace = true
9+
description = "WebAssembly bindings for ggsql."
1010

1111
[lib]
1212
crate-type = ["cdylib"]

src/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ required-features = ["rest-api"]
2424
[dependencies]
2525
# Parsing
2626
tree-sitter.workspace = true
27-
tree-sitter-ggsql = { path = "../tree-sitter-ggsql" }
27+
tree-sitter-ggsql = { workspace = true }
2828
csscolorparser.workspace = true
2929

3030
# Color interpolation

0 commit comments

Comments
 (0)