diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..586e17b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: dapr-rust-sdk + +on: + push: + branches: + - master + - release-* + tags: + - v* + pull_request: + branches: + - master + - release-* + +env: + CARGO_TERM_COLOR: always + CARGO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: cargo fmt + run: cargo fmt -- --check --color ${{ env.CARGO_TERM_COLOR }} + - name: cargo clippy + run: cargo clippy -- -W warnings + + + build: + name: Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build + run: cargo build + - name: Build examples + run: cargo build --examples + - name: Run Tests + run: cargo test --all-targets + + publish: + name: Publish + runs-on: ubuntu-latest + needs: [lint, build] + if: startswith(github.ref, 'refs/tags/v') + + steps: + - uses: actions/checkout@v2 + - name: cargo publish + run: cargo publish --token ${{ env.CARGO_TOKEN }} diff --git a/Cargo.toml b/Cargo.toml index 01036a6..7ea76c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,14 @@ [package] name = "dapr" -version = "0.2.0" +version = "0.2.0-alpha.0" authors = ["dapr.io"] edition = "2018" +license-file = "LICENSE" +repository = "https://github.com/dapr/rust-sdk" +description = "Rust SDK for dapr" +readme = "README.md" +keywords = ["microservices", "dapr"] + [dependencies] tonic = "0.2" diff --git a/README.md b/README.md index 3704a09..994bd7d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,15 @@ # Dapr SDK for Rust -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![Crates.io][crates-badge]][crates-url] +[![Build Status][actions-badge]][actions-url] +[![License: MIT][mit-badge]][mit-url] + +[crates-badge]: https://img.shields.io/crates/v/dapr.svg +[crates-url]: https://crates.io/crates/dapr +[mit-badge]: https://img.shields.io/badge/License-MIT-yellow.svg +[mit-url]: https://github.com/dapr/rust-sdk/blob/master/LICENSE +[actions-badge]: https://github.com/dapr/rust-sdk/workflows/dapr-rust-sdk/badge.svg +[actions-url]: https://github.com/dapr/rust-sdk/actions?query=workflow%3Adapr-rust-sdk ⚠ Work in Progress ⚠ @@ -15,9 +24,16 @@ Dapr is a portable, event-driven, serverless runtime for building distributed ap ## Usage +```toml +[dependencies] +dapr = "0.2.0-alpha.0" +``` + A client can be created as follows: ```rust +use dapr; + async fn main() -> Result<(), Box> { // Get the Dapr port and create a connection let port: u16 = std::env::var("DAPR_GRPC_PORT")?.parse()?;