diff --git a/.github/workflows/release-installers.yml b/.github/workflows/release-packages.yml similarity index 75% rename from .github/workflows/release-installers.yml rename to .github/workflows/release-packages.yml index 57317655..2d6d373a 100644 --- a/.github/workflows/release-installers.yml +++ b/.github/workflows/release-packages.yml @@ -1,10 +1,10 @@ -name: Release Installers +name: Release Cargo and Installer Packages on: push: tags: - - 'v*' # Trigger on version tags (e.g., v0.1.0) - workflow_dispatch: # Allow manual triggering + - "v*" # Trigger on version tags (e.g., v0.1.0) + workflow_dispatch: # Allow manual triggering env: CARGO_TERM_COLOR: always @@ -21,7 +21,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version: "20" - name: Install tree-sitter-cli run: npm install -g tree-sitter-cli @@ -75,7 +75,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version: "20" - name: Install tree-sitter-cli run: npm install -g tree-sitter-cli @@ -125,7 +125,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version: "20" - name: Install tree-sitter-cli run: npm install -g tree-sitter-cli @@ -167,9 +167,61 @@ jobs: path: src/target/release/packager/*.deb retention-days: 30 + build-cargo: + name: Publish to crates.io + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install tree-sitter-cli + run: npm install -g tree-sitter-cli + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Rust cache + uses: Swatinem/rust-cache@v2 + with: + shared-key: cargo-publish + + - name: Get crates.io publish token + uses: rust-lang/crates-io-auth-action@v1 + id: auth + + - name: Publish tree-sitter-ggsql + run: cargo publish --package tree-sitter-ggsql + env: + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} + + - name: Wait for crates.io index update + run: sleep 30 + + - name: Publish ggsql + run: cargo publish --package ggsql + env: + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} + + - name: Wait for crates.io index update + run: sleep 30 + + - name: Publish ggsql-jupyter + run: cargo publish --package ggsql-jupyter + env: + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} + create-release: name: Create GitHub Release - needs: [build-windows, build-macos, build-linux] + needs: [build-windows, build-macos, build-linux, build-cargo] runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/v') diff --git a/.gitignore b/.gitignore index fd65758d..a4dec8f2 100644 --- a/.gitignore +++ b/.gitignore @@ -97,7 +97,7 @@ docs/_build/ *.db *.sqlite *.sqlite3 -!data/*.parquet +!src/data/*.parquet # Configuration files .env diff --git a/Cargo.toml b/Cargo.toml index 2793101a..d77dc9da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,14 +20,18 @@ version = "0.1.0" edition = "2021" authors = ["ggsql Team"] license = "MIT" -repository = "https://github.com/georgestagg/ggsql" -homepage = "https://github.com/georgestagg/ggsql" -description = "SQL extension for declarative data visualization" +repository = "https://github.com/posit-dev/ggsql" +homepage = "https://ggsql.org" +description = "A declarative visualization language that extends SQL with powerful data visualization capabilities." [workspace.dependencies] +# workspace packages +tree-sitter-ggsql = { path = "tree-sitter-ggsql", version = "0.1.0" } +ggsql = { path = "src", version = "0.1.0" } + # Parsing -tree-sitter = "0.26" csscolorparser = "0.8.1" +tree-sitter = "0.26" # Data processing polars = { version = "0.52", default-features = false } diff --git a/ggsql-jupyter/Cargo.toml b/ggsql-jupyter/Cargo.toml index c7dc5afc..5b31ef8f 100644 --- a/ggsql-jupyter/Cargo.toml +++ b/ggsql-jupyter/Cargo.toml @@ -4,6 +4,8 @@ version.workspace = true edition.workspace = true authors.workspace = true license.workspace = true +repository.workspace = true +homepage.workspace = true description = "Jupyter kernel for ggsql" [[bin]] @@ -16,7 +18,7 @@ path = "src/lib.rs" [dependencies] # Core ggsql library -ggsql = { path = "../src", features = ["duckdb", "vegalite"] } +ggsql = { workspace = true, features = ["duckdb", "vegalite"] } # Need polars for DataFrame type polars = { workspace = true } diff --git a/ggsql-jupyter/README.md b/ggsql-jupyter/README.md index 9e4eede4..75e607bb 100644 --- a/ggsql-jupyter/README.md +++ b/ggsql-jupyter/README.md @@ -40,17 +40,26 @@ ggsql-jupyter --install The `--install` flag registers the kernel with Jupyter. It automatically detects and respects your current environment (virtualenv, conda, uv, etc.). -### Option 2: Download Pre-built Binary +### Option 2: Install from crates.io + +Requires a [Rust toolchain](https://rustup.rs/): + +```bash +cargo install ggsql-jupyter +ggsql-jupyter --install +``` + +### Option 3: Download Pre-built Binary Pre-built binaries are available from [GitHub Releases](https://github.com/georgestagg/ggsql/releases): -| Platform | Binary | -| -------------------- | ---------------------------------- | -| Linux (x86_64) | `ggsql-jupyter-linux-x64` | -| Linux (ARM64) | `ggsql-jupyter-linux-arm64` | -| macOS (Intel) | `ggsql-jupyter-macos-x64` | -| macOS (Apple Silicon) | `ggsql-jupyter-macos-arm64` | -| Windows (x64) | `ggsql-jupyter-windows-x64.exe` | +| Platform | Binary | +| --------------------- | ------------------------------- | +| Linux (x86_64) | `ggsql-jupyter-linux-x64` | +| Linux (ARM64) | `ggsql-jupyter-linux-arm64` | +| macOS (Intel) | `ggsql-jupyter-macos-x64` | +| macOS (Apple Silicon) | `ggsql-jupyter-macos-arm64` | +| Windows (x64) | `ggsql-jupyter-windows-x64.exe` | After downloading, make it executable and install: @@ -65,7 +74,7 @@ On Windows (PowerShell): .\ggsql-jupyter-windows-x64.exe --install ``` -### Option 3: Build from Source +### Option 4: Build from Source Requires a [Rust toolchain](https://rustup.rs/). From the workspace root: diff --git a/ggsql-python/Cargo.toml b/ggsql-python/Cargo.toml index 6c69076e..f64cb2c9 100644 --- a/ggsql-python/Cargo.toml +++ b/ggsql-python/Cargo.toml @@ -2,7 +2,10 @@ name = "ggsql-python" version = "0.1.0" edition = "2021" -license = "MIT" +authors.workspace = true +license.workspace = true +repository.workspace = true +homepage.workspace = true description = "Python bindings for ggsql" [lib] diff --git a/ggsql-wasm/Cargo.toml b/ggsql-wasm/Cargo.toml index cc7bcf5b..5a0742af 100644 --- a/ggsql-wasm/Cargo.toml +++ b/ggsql-wasm/Cargo.toml @@ -6,7 +6,7 @@ authors.workspace = true license.workspace = true repository.workspace = true homepage.workspace = true -description.workspace = true +description = "WebAssembly bindings for ggsql." [lib] crate-type = ["cdylib"] diff --git a/src/Cargo.toml b/src/Cargo.toml index 665659eb..f2c85bc6 100644 --- a/src/Cargo.toml +++ b/src/Cargo.toml @@ -24,7 +24,7 @@ required-features = ["rest-api"] [dependencies] # Parsing tree-sitter.workspace = true -tree-sitter-ggsql = { path = "../tree-sitter-ggsql" } +tree-sitter-ggsql = { workspace = true } csscolorparser.workspace = true # Color interpolation diff --git a/data/airquality.parquet b/src/data/airquality.parquet similarity index 100% rename from data/airquality.parquet rename to src/data/airquality.parquet diff --git a/data/penguins.parquet b/src/data/penguins.parquet similarity index 100% rename from data/penguins.parquet rename to src/data/penguins.parquet diff --git a/src/reader/data.rs b/src/reader/data.rs index fac5639a..ce4e71cb 100644 --- a/src/reader/data.rs +++ b/src/reader/data.rs @@ -17,13 +17,13 @@ use crate::{naming, GgsqlError}; #[cfg(feature = "builtin-data")] static PENGUINS: &[u8] = include_bytes!(concat!( env!("CARGO_MANIFEST_DIR"), - "/../data/penguins.parquet" + "/data/penguins.parquet" )); #[cfg(feature = "builtin-data")] static AIRQUALITY: &[u8] = include_bytes!(concat!( env!("CARGO_MANIFEST_DIR"), - "/../data/airquality.parquet" + "/data/airquality.parquet" )); /// Get the embedded parquet bytes for a known builtin dataset. diff --git a/tree-sitter-ggsql/Cargo.toml b/tree-sitter-ggsql/Cargo.toml index 1c7849a5..9c991737 100644 --- a/tree-sitter-ggsql/Cargo.toml +++ b/tree-sitter-ggsql/Cargo.toml @@ -5,8 +5,19 @@ edition.workspace = true authors.workspace = true license.workspace = true repository.workspace = true +homepage.workspace = true description = "Tree-sitter grammar for ggsql visualization language" build = "bindings/rust/build.rs" +include = [ + "src/**/*", + "bindings/**/*", + "test/**/*", + "queries/**/*", + "*.toml", + "*.json", + "grammar.js", + "setup.py", +] [lib] path = "bindings/rust/lib.rs"