From 527fa595c85e8e5c380b44799687c7dfa2a2aa59 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Thu, 4 Dec 2025 02:55:23 -0300 Subject: [PATCH 1/5] feat: Setup cargo publishing --- .github/workflows/release.yml | 64 +++++++++++++++++++++++++++++++++ .github/workflows/stable.yml | 6 ++++ crates/plotnik-cli/Cargo.toml | 15 +++++--- crates/plotnik-langs/Cargo.toml | 7 ++++ crates/plotnik-lib/Cargo.toml | 9 ++++- release.toml | 21 +++++++++++ 6 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 release.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..234dc993 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,64 @@ +name: release + +on: + push: + tags: + - 'v[0-9]+.*' + +env: + CARGO_TERM_COLOR: always + +jobs: + verify: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Rust stable + uses: dtolnay/rust-toolchain@stable + with: + components: clippy + + - name: Using Rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-all-crates: "true" + + - name: Check + run: cargo check --workspace --all-targets + + - name: Clippy + run: cargo clippy --workspace --all-targets -- -D warnings + + - name: Test + run: cargo test --workspace + + publish: + needs: verify + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Rust stable + uses: dtolnay/rust-toolchain@stable + + - name: Publish to crates.io + uses: katyo/publish-crates@v2 + with: + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} + + github-release: + needs: publish + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true \ No newline at end of file diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 363896e9..84e9f4ff 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -44,3 +44,9 @@ jobs: - name: Test run: cargo test --workspace + + - name: Check publishable + uses: katyo/publish-crates@v2 + with: + dry-run: true + check-repo: false diff --git a/crates/plotnik-cli/Cargo.toml b/crates/plotnik-cli/Cargo.toml index d551b577..6ca14ddf 100644 --- a/crates/plotnik-cli/Cargo.toml +++ b/crates/plotnik-cli/Cargo.toml @@ -2,6 +2,13 @@ name = "plotnik-cli" version = "0.1.0" edition = "2024" +license = "MIT" +description = "CLI for plotnik - typed query language for tree-sitter AST" +repository = "https://github.com/plotnik-lang/plotnik" +documentation = "https://docs.rs/plotnik-cli" +keywords = ["tree-sitter", "query", "ast", "parser", "cli"] +categories = ["command-line-utilities", "development-tools"] +readme = "../../README.md" [features] default = [ @@ -58,7 +65,7 @@ typescript = ["plotnik-langs/typescript"] yaml = ["plotnik-langs/yaml"] [dependencies] -clap = { version = "=4.5.53", features = ["derive"] } -plotnik-langs = { path = "../plotnik-langs", default-features = false } -plotnik-lib = { path = "../plotnik-lib" } -tree-sitter = "=0.25.10" +clap = { version = "4.5", features = ["derive"] } +plotnik-langs = { version = "0.1.0", path = "../plotnik-langs", default-features = false } +plotnik-lib = { version = "0.1.0", path = "../plotnik-lib" } +tree-sitter = "0.25" \ No newline at end of file diff --git a/crates/plotnik-langs/Cargo.toml b/crates/plotnik-langs/Cargo.toml index 1854d32c..654a931a 100644 --- a/crates/plotnik-langs/Cargo.toml +++ b/crates/plotnik-langs/Cargo.toml @@ -2,6 +2,13 @@ name = "plotnik-langs" version = "0.1.0" edition = "2024" +license = "MIT" +description = "Tree-sitter language bindings for Plotnik query language" +repository = "https://github.com/plotnik-lang/plotnik" +documentation = "https://docs.rs/plotnik-langs" +keywords = ["tree-sitter", "parser", "languages"] +categories = ["parsing", "development-tools"] +readme = "../../README.md" [features] default = [ diff --git a/crates/plotnik-lib/Cargo.toml b/crates/plotnik-lib/Cargo.toml index d2890af3..8b090ed2 100644 --- a/crates/plotnik-lib/Cargo.toml +++ b/crates/plotnik-lib/Cargo.toml @@ -2,6 +2,13 @@ name = "plotnik-lib" version = "0.1.0" edition = "2024" +license = "MIT" +description = "Typed query language for tree-sitter AST" +repository = "https://github.com/plotnik-lang/plotnik" +documentation = "https://docs.rs/plotnik-lib" +readme = "../../README.md" +keywords = ["tree-sitter", "query", "ast", "parser"] +categories = ["parsing", "development-tools"] [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] } @@ -17,4 +24,4 @@ thiserror = "2.0.17" [dev-dependencies] insta = { version = "=1.44.3", features = ["yaml"] } indoc = "=2.0.7" -serde_json = "=1.0.145" +serde_json = "=1.0.145" \ No newline at end of file diff --git a/release.toml b/release.toml new file mode 100644 index 00000000..b05d6aa6 --- /dev/null +++ b/release.toml @@ -0,0 +1,21 @@ +[workspace] +allow-branch = ["master"] +shared-version = true +consolidate-commits = true +consolidate-pushes = true + +pre-release-commit-message = "chore: release v{{version}}" +tag-message = "v{{version}}" +tag-name = "v{{version}}" + +[[package]] +name = "plotnik-lib" +publish = true + +[[package]] +name = "plotnik-langs" +publish = true + +[[package]] +name = "plotnik-cli" +publish = true \ No newline at end of file From cbdc9d7e5ea02be3d59090d53c540af3928d7c15 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Thu, 4 Dec 2025 02:55:53 -0300 Subject: [PATCH 2/5] Update release.yml --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 234dc993..529aa900 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: release on: push: tags: - - 'v[0-9]+.*' + - "v[0-9]+.*" env: CARGO_TERM_COLOR: always @@ -61,4 +61,4 @@ jobs: - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: - generate_release_notes: true \ No newline at end of file + generate_release_notes: true From 97f42fea2b80aacbd9b0db54a31cac9df76c373b Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Thu, 4 Dec 2025 02:58:10 -0300 Subject: [PATCH 3/5] Update release.toml --- release.toml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/release.toml b/release.toml index b05d6aa6..a97340da 100644 --- a/release.toml +++ b/release.toml @@ -1,21 +1,8 @@ -[workspace] allow-branch = ["master"] shared-version = true consolidate-commits = true -consolidate-pushes = true pre-release-commit-message = "chore: release v{{version}}" -tag-message = "v{{version}}" +tag-prefix = "" tag-name = "v{{version}}" - -[[package]] -name = "plotnik-lib" -publish = true - -[[package]] -name = "plotnik-langs" -publish = true - -[[package]] -name = "plotnik-cli" -publish = true \ No newline at end of file +tag-message = "v{{version}}" From 25c2b051d0fe1867dca5e316af2a8b4d5de58b40 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Thu, 4 Dec 2025 02:59:34 -0300 Subject: [PATCH 4/5] Bump tree-sitter dependencies to latest versions --- crates/plotnik-cli/Cargo.toml | 2 +- crates/plotnik-langs/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/plotnik-cli/Cargo.toml b/crates/plotnik-cli/Cargo.toml index 6ca14ddf..97294716 100644 --- a/crates/plotnik-cli/Cargo.toml +++ b/crates/plotnik-cli/Cargo.toml @@ -68,4 +68,4 @@ yaml = ["plotnik-langs/yaml"] clap = { version = "4.5", features = ["derive"] } plotnik-langs = { version = "0.1.0", path = "../plotnik-langs", default-features = false } plotnik-lib = { version = "0.1.0", path = "../plotnik-lib" } -tree-sitter = "0.25" \ No newline at end of file +tree-sitter = "0.25" diff --git a/crates/plotnik-langs/Cargo.toml b/crates/plotnik-langs/Cargo.toml index 654a931a..d4ea21e9 100644 --- a/crates/plotnik-langs/Cargo.toml +++ b/crates/plotnik-langs/Cargo.toml @@ -92,4 +92,4 @@ tree-sitter-swift = { version = "0.7.0", optional = true } tree-sitter-typescript = { version = "0.23.2", optional = true } tree-sitter-yaml = { version = "0.7.0", optional = true } -[dev-dependencies] \ No newline at end of file +[dev-dependencies] From 72480850c4554bb5b898c788ce707f75c47a7336 Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Thu, 4 Dec 2025 03:00:10 -0300 Subject: [PATCH 5/5] Update Cargo.toml --- crates/plotnik-lib/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/plotnik-lib/Cargo.toml b/crates/plotnik-lib/Cargo.toml index 8b090ed2..1eae0b13 100644 --- a/crates/plotnik-lib/Cargo.toml +++ b/crates/plotnik-lib/Cargo.toml @@ -24,4 +24,4 @@ thiserror = "2.0.17" [dev-dependencies] insta = { version = "=1.44.3", features = ["yaml"] } indoc = "=2.0.7" -serde_json = "=1.0.145" \ No newline at end of file +serde_json = "=1.0.145"