From d97b9082740658cd3ffcd20377bfc2d7483219c6 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Wed, 17 Jan 2024 21:13:28 +0100 Subject: [PATCH] ref: Add release workflow for Rust --- .craft.yml | 1 + .github/workflows/rust-ci.yml | 6 +++--- .gitignore | 4 +++- rust-arroyo/Cargo.toml => Cargo.toml | 17 ++++++++++++++++- scripts/bump-version.sh | 1 + 5 files changed, 24 insertions(+), 5 deletions(-) rename rust-arroyo/Cargo.toml => Cargo.toml (68%) diff --git a/.craft.yml b/.craft.yml index 5d824fd5..1bb0ca28 100644 --- a/.craft.yml +++ b/.craft.yml @@ -6,5 +6,6 @@ changelogPolicy: auto targets: - name: github - name: pypi + - name: crates - name: sentry-pypi internalPypiRepo: getsentry/pypi diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index be2b8d5c..2b181326 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -16,8 +16,8 @@ jobs: steps: - uses: actions/checkout@v3 name: Checkout code - - name: Run linter - run: cd rust-arroyo && cargo check && cargo fmt --check + - run: cargo check + - run: cargo fmt --check test: name: "Tests" @@ -29,4 +29,4 @@ jobs: - name: Run Zookeeper and Kafka run: sh scripts/run-kafka.sh - name: Run tests - run: cd rust-arroyo && cargo test + run: cargo test diff --git a/.gitignore b/.gitignore index a855411f..398c83ee 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,6 @@ .DS_Store .tox .benchmarks/ -.idea/ \ No newline at end of file +.idea/ +target/ +/Cargo.lock diff --git a/rust-arroyo/Cargo.toml b/Cargo.toml similarity index 68% rename from rust-arroyo/Cargo.toml rename to Cargo.toml index b6a0869f..0342fb49 100644 --- a/rust-arroyo/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,13 @@ [package] name = "rust_arroyo" -version = "0.1.0" +version = "2.15.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lib] +path = "rust-arroyo/src/lib.rs" + [dependencies] chrono = "0.4.26" coarsetime = "0.1.33" @@ -25,3 +28,15 @@ tracing-subscriber = "0.3.18" [patch.crates-io] rdkafka = { git = "https://github.com/fede1024/rust-rdkafka" } + +[[example]] +name = "base_processor" +path = "rust-arroyo/examples/base_processor.rs" + +[[example]] +name = "transform_and_produce" +path = "rust-arroyo/examples/transform_and_produce.rs" + +[[example]] +name = "base_consumer" +path = "rust-arroyo/examples/base_consumer.rs" diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh index c473e04c..dd56f9d8 100755 --- a/scripts/bump-version.sh +++ b/scripts/bump-version.sh @@ -14,3 +14,4 @@ function replace() { } replace "version=\"[0-9.]+\"" "version=\"$NEW_VERSION\"" ./setup.py +replace "^version = \".*?\"" "version = \"$NEW_VERSION\"" Cargo.toml