diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..529aa900 --- /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 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..97294716 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" diff --git a/crates/plotnik-langs/Cargo.toml b/crates/plotnik-langs/Cargo.toml index 1854d32c..d4ea21e9 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 = [ @@ -85,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] diff --git a/crates/plotnik-lib/Cargo.toml b/crates/plotnik-lib/Cargo.toml index d2890af3..1eae0b13 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)'] } diff --git a/release.toml b/release.toml new file mode 100644 index 00000000..a97340da --- /dev/null +++ b/release.toml @@ -0,0 +1,8 @@ +allow-branch = ["master"] +shared-version = true +consolidate-commits = true + +pre-release-commit-message = "chore: release v{{version}}" +tag-prefix = "" +tag-name = "v{{version}}" +tag-message = "v{{version}}"