diff --git a/.github/release-drafter-config.yml b/.github/release-drafter-config.yml deleted file mode 100644 index 0eb1ee38..00000000 --- a/.github/release-drafter-config.yml +++ /dev/null @@ -1,21 +0,0 @@ -name-template: 'Version $NEXT_PATCH_VERSION' -tag-template: 'v$NEXT_PATCH_VERSION' -categories: - - title: 'Features' - labels: - - 'feature' - - 'enhancement' - - title: 'Bug Fixes' - labels: - - 'fix' - - 'bugfix' - - 'bug' - - title: 'Maintenance' - label: 'chore' -change-template: '- $TITLE (#$NUMBER)' -exclude-labels: - - 'skip-changelog' -template: | - ## Changes - - $CHANGES diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0afbe23..a7080aaa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,23 +3,9 @@ name: CI on: [pull_request] jobs: - get-nightly-version: - runs-on: ubuntu-latest - outputs: - nightly-version: ${{ steps.get-nightly.outputs.version }} - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - name: Get nightly version from rust-toolchain.toml - id: get-nightly - run: | - NIGHTLY_VERSION=$(grep 'channel = ' rust-toolchain.toml | sed 's/.*"\(.*\)".*/\1/') - echo "version=$NIGHTLY_VERSION" >> $GITHUB_OUTPUT - test: name: Build and run the unit tests using the latest rust. runs-on: ${{ matrix.os }} - needs: get-nightly-version strategy: fail-fast: false matrix: @@ -33,35 +19,34 @@ jobs: - [7-2, "7.2"] toolchain: - stable - - ${{ needs.get-nightly-version.outputs.nightly-version }} steps: - name: Checkout sources - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: - submodules: recursive + submodules: recursive - name: Checkout redis sources - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: - submodules: recursive - repository: redis/redis - ref: ${{ matrix.redis-version[1] }} - path: redis + submodules: recursive + repository: redis/redis + ref: ${{ matrix.redis-version[1] }} + path: redis - name: Install redis run: | - export HOMEBREW_NO_AUTO_UPDATE=1 - cd redis - make -j - ./src/redis-server --version - make install PREFIX=/usr/local - redis-server --version + export HOMEBREW_NO_AUTO_UPDATE=1 + cd redis + make -j + ./src/redis-server --version + make install PREFIX=/usr/local + redis-server --version - name: Setup python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: "3.10" - name: Install Clang (for bindgen) run: | @@ -78,21 +63,11 @@ jobs: - name: Install toolchain id: tc - uses: dtolnay/rust-toolchain@master + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: ${{ matrix.toolchain }} components: rustfmt, clippy - - name: Setup cache - if: runner.os != 'macOS' - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-test-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }} - - name: Format run: cargo fmt --all -- --check diff --git a/.github/workflows/cratesio-publish.yml b/.github/workflows/cratesio-publish.yml deleted file mode 100644 index fff7c395..00000000 --- a/.github/workflows/cratesio-publish.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Cratesio Publish -on: - release: - types: [published] - -jobs: - publish: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - - name: get version from tag - id: get_version - run: | - realversion="${GITHUB_REF/refs\/tags\//}" - realversion="${realversion//v/}" - echo "VERSION=$realversion" >> $GITHUB_OUTPUT - - - name: Set the version for publishing - uses: ciiiii/toml-editor@1.0.0 - with: - file: "Cargo.toml" - key: "package.version" - value: "${{ steps.get_version.outputs.VERSION }}" - - - name: Set the version for redismodule-rs-macros-internals - uses: ciiiii/toml-editor@1.0.0 - with: - file: "Cargo.toml" - key: "dependencies.redis-module-macros-internals" - value: "${{ steps.get_version.outputs.VERSION }}" - - - name: Set the version for publishing on macros crate - uses: ciiiii/toml-editor@1.0.0 - with: - file: "redismodule-rs-macros/Cargo.toml" - key: "package.version" - value: "${{ steps.get_version.outputs.VERSION }}" - - - name: Set the version for publishing on internal macros crate - uses: ciiiii/toml-editor@1.0.0 - with: - file: "redismodule-rs-macros-internals/Cargo.toml" - key: "package.version" - value: "${{ steps.get_version.outputs.VERSION }}" - - - name: Publishing redismodule-rs-macros-internals - uses: katyo/publish-crates@v2 - with: - registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} - path: './redismodule-rs-macros-internals' - args: --allow-dirty - - - name: Publishing redismodule-rs - uses: katyo/publish-crates@v2 - with: - registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} - args: --allow-dirty - - - name: Publishing redismodule-rs-macros - uses: katyo/publish-crates@v2 - with: - registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} - path: './redismodule-rs-macros' - args: --allow-dirty diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index caac3ca1..00000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Release Drafter - -on: - push: - # branches to consider in the event; optional, defaults to all - branches: - - master - -jobs: - update_release_draft: - runs-on: ubuntu-latest - steps: - # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5 - with: - # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml - config-name: release-drafter-config.yml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml new file mode 100644 index 00000000..4dd51dff --- /dev/null +++ b/.github/workflows/release-pr.yml @@ -0,0 +1,32 @@ +name: Open a release PR + +on: + workflow_dispatch: # Manual trigger only + +jobs: + # Create a PR with the new versions and changelog, preparing the next release. + # A release will be automatically published when the PR is merged into master. + release-pr: + name: Open a release PR + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + concurrency: + group: release-plz-${{ github.ref }} + cancel-in-progress: false + steps: + - name: Checkout repository + uses: actions/checkout@v5 + with: + submodules: recursive + fetch-depth: 0 + persist-credentials: false + - name: Install toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Run release-plz + uses: release-plz/action@v0.5 + with: + command: release-pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..1eb35e8d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Release-plz + +on: + push: + branches: + - master + +jobs: + # Release unpublished packages if the latest commit merged + # a release PR into master + release: + name: Publish a new release to crates.io + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v5 + with: + submodules: recursive + fetch-depth: 0 + persist-credentials: false + - name: Install toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: rust-lang/crates-io-auth-action@v1 + id: auth + - name: Run release-plz + uses: release-plz/action@v0.5 + with: + command: release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} diff --git a/.github/workflows/test-registry-token.yml b/.github/workflows/test-registry-token.yml deleted file mode 100644 index 37d642cc..00000000 --- a/.github/workflows/test-registry-token.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Test Registry Token - -on: - workflow_dispatch: # Manual trigger only - -jobs: - test-token: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Test registry token login - run: | - echo "Testing cargo login with registry token..." - # Use environment variable to avoid any risk of token exposure - echo "$CARGO_REGISTRY_TOKEN" | cargo login - echo "✅ Registry token login successful" - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/Cargo.toml b/Cargo.toml index b084c3cb..73762d59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,19 @@ +[workspace] +members = [".", "redismodule-rs-macros", "redismodule-rs-macros-internals"] + +[workspace.package] +version = "2.0.7" +license = "BSD-3-Clause" +edition = "2021" + [package] name = "redis-module" -version = "99.99.99" +version.workspace = true +edition.workspace = true +license.workspace = true authors = ["Gavrie Philipson ", "Guy Korland "] -edition = "2021" build = "build.rs" description = "A toolkit for building Redis modules in Rust" -license = "BSD-3-Clause" repository = "https://github.com/RedisLabsModules/redismodule-rs" readme = "README.md" keywords = ["redis", "plugin"] @@ -162,4 +170,4 @@ bindgen-static = ["bindgen/static"] bindgen-runtime = ["bindgen/runtime"] # List all features here, that are not in a exclusive or relationship -all-features-but-xor = [] \ No newline at end of file +all-features-but-xor = [] diff --git a/README.md b/README.md index 1e93af1a..220b2caa 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![Releases](https://img.shields.io/github/release/RedisLabsModules/redismodule-rs.svg)](https://github.com/RedisLabsModules/redismodule-rs/releases/latest) [![crates.io](https://img.shields.io/crates/v/redis-module.svg)](https://crates.io/crates/redis-module) [![docs](https://docs.rs/redis-module/badge.svg)](https://docs.rs/redis-module) -[![CircleCI](https://circleci.com/gh/RedisLabsModules/redismodule-rs/tree/master.svg?style=svg)](https://circleci.com/gh/RedisLabsModules/redismodule-rs/tree/master) # redismodule-rs diff --git a/redismodule-rs-macros-internals/Cargo.toml b/redismodule-rs-macros-internals/Cargo.toml index 7e175e57..7429dd33 100644 --- a/redismodule-rs-macros-internals/Cargo.toml +++ b/redismodule-rs-macros-internals/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "redis-module-macros-internals" -version = "99.99.99" authors = ["Meir Shpilraien "] -edition = "2021" description = "A macros crate for redismodule-rs" -license = "BSD-3-Clause" +version.workspace = true +edition.workspace = true +license.workspace = true repository = "https://github.com/RedisLabsModules/redismodule-rs" keywords = ["redis", "plugin"] categories = ["database", "api-bindings"] diff --git a/redismodule-rs-macros/Cargo.toml b/redismodule-rs-macros/Cargo.toml index 08eb9293..173b12ad 100644 --- a/redismodule-rs-macros/Cargo.toml +++ b/redismodule-rs-macros/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "redis-module-macros" -version = "99.99.99" +version.workspace = true +edition.workspace = true +license.workspace = true authors = ["Meir Shpilraien "] -edition = "2021" description = "A macros crate for redismodule-rs" -license = "BSD-3-Clause" repository = "https://github.com/RedisLabsModules/redismodule-rs" keywords = ["redis", "plugin"] categories = ["database", "api-bindings"] @@ -19,6 +19,4 @@ serde = { version = "1", features = ["derive"] } serde_syn = "0.1.0" [lib] -name = "redis_module_macros" -path = "src/lib.rs" proc-macro = true diff --git a/rust-toolchain.toml b/rust-toolchain.toml index c05de718..8cf9c187 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2025-07-30" +channel = "1.90" components = ["rustfmt", "clippy"]