diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..4130399 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +name: Publish to crates.io + +on: + release: + types: [published] + workflow_dispatch: + inputs: + dry_run: + description: 'Dry run (no actual publish)' + type: boolean + default: true + +env: + CARGO_TERM_COLOR: always + +jobs: + publish: + name: Publish + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo + uses: Swatinem/rust-cache@v2 + + - name: Verify package + run: cargo publish --dry-run + + - name: Publish to crates.io + if: ${{ github.event_name == 'release' || !inputs.dry_run }} + run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock index a1dcb3f..5a88496 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "adler2" @@ -1318,7 +1318,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" [[package]] -name = "m2m-core" +name = "m2m-protocol" version = "0.4.0" dependencies = [ "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 62147c9..27f695b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "m2m-core" +name = "m2m-protocol" version = "0.4.0" edition = "2021" -rust-version = "1.82" +rust-version = "1.88" license = "Apache-2.0" description = "M2M Protocol - Intelligent machine-to-machine LLM communication with learned compression" repository = "https://github.com/infernet-org/m2m-protocol" -keywords = ["llm", "compression", "tokens", "m2m", "protocol", "ai"] +keywords = ["llm", "compression", "m2m", "protocol", "ai"] categories = ["compression", "web-programming", "science"] readme = "README.md" authors = ["M2M Protocol Contributors"] diff --git a/README.md b/README.md index 0c49cd1..1d69ae5 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # M2M Protocol -[![Crates.io](https://img.shields.io/crates/v/m2m-core.svg)](https://crates.io/crates/m2m-core) +[![Crates.io](https://img.shields.io/crates/v/m2m-protocol.svg)](https://crates.io/crates/m2m-protocol) [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE) -[![Rust](https://img.shields.io/badge/rust-1.82+-orange.svg)](https://www.rust-lang.org/) +[![Rust](https://img.shields.io/badge/rust-1.88+-orange.svg)](https://www.rust-lang.org/) [![Tests](https://img.shields.io/badge/tests-268%20passing-brightgreen.svg)]() **Wire protocol for AI agent communication with inspectable headers and semantic security.** diff --git a/src/codec/brotli.rs b/src/codec/brotli.rs index 6ca6dac..7b46e73 100644 --- a/src/codec/brotli.rs +++ b/src/codec/brotli.rs @@ -71,7 +71,7 @@ impl BrotliCodec { Ok(decompressed) } - /// Compress string to wire format: #M2M[v3.0]|DATA: + /// Compress string to wire format: `#M2M[v3.0]|DATA:` pub fn compress(&self, content: &str) -> Result { let compressed = self.compress_bytes(content.as_bytes())?; let encoded = BASE64.encode(&compressed);