From 43f94e71259722612404a5a8b00153f87e4538e6 Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Fri, 8 Aug 2025 18:40:37 +0200 Subject: [PATCH 1/6] build: add release-plz for automating releases Signed-off-by: Esteve Fernandez --- .github/workflows/release-plz.yml | 75 +++++++++++++++++++++++++++++++ Cargo.toml | 3 ++ release-plz.toml | 6 +++ 3 files changed, 84 insertions(+) create mode 100644 .github/workflows/release-plz.yml create mode 100644 Cargo.toml create mode 100644 release-plz.toml diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 000000000..271ed2281 --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,75 @@ +name: Release-plz + +on: + push: + branches: + - main + +jobs: + release-plz-release: + name: Release-plz release + runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'ros2-rust' }} + permissions: + contents: write + steps: + # Generating a GitHub token, so that PRs and tags created by + # the release-plz-action can trigger actions workflows. + - name: Generate GitHub token + uses: actions/create-github-app-token@v2 + id: generate-token + with: + # GitHub App ID secret name + app-id: ${{ secrets.APP_ID }} + # GitHub App private key secret name + private-key: ${{ secrets.APP_PRIVATE_KEY }} + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ steps.generate-token.outputs.token }} + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Run release-plz + uses: release-plz/action@v0.5 + with: + command: release + env: + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + + release-plz-pr: + name: Release-plz PR + runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'ros2-rust' }} + permissions: + pull-requests: write + contents: write + concurrency: + group: release-plz-${{ github.ref }} + cancel-in-progress: false + steps: + # Generating a GitHub token, so that PRs and tags created by + # the release-plz-action can trigger actions workflows. + - name: Generate GitHub token + uses: actions/create-github-app-token@v2 + id: generate-token + with: + # GitHub App ID secret name + app-id: ${{ secrets.APP_ID }} + # GitHub App private key secret name + private-key: ${{ secrets.APP_PRIVATE_KEY }} + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ steps.generate-token.outputs.token }} + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Run release-plz + uses: release-plz/action@v0.5 + with: + command: release-pr + env: + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 000000000..67ebb69fc --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,3 @@ +[workspace] +members = ["rclrs", "examples/*"] +resolver = "2" diff --git a/release-plz.toml b/release-plz.toml new file mode 100644 index 000000000..14a99fb05 --- /dev/null +++ b/release-plz.toml @@ -0,0 +1,6 @@ +[workspace] + +[[package]] +name = "rclrs" +publish_features = ["use_ros_shim"] +publish_all_features = false From ba369d420d41fa0ce2471ffb6d76bfac2a3b507c Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Fri, 8 Aug 2025 19:07:51 +0200 Subject: [PATCH 2/6] build: exclude examples/rclrs_example_msgs from the Cargo workspace Signed-off-by: Esteve Fernandez --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 67ebb69fc..33954475b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,4 @@ [workspace] members = ["rclrs", "examples/*"] +exclude = ["examples/rclrs_example_msgs"] resolver = "2" From 913dbb7ecd2f1c9ce844aa108bd780f916e73d6c Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Fri, 8 Aug 2025 22:37:54 +0200 Subject: [PATCH 3/6] build: explicitly list the members in the workspace Signed-off-by: Esteve Fernandez --- Cargo.toml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 33954475b..c56675b4c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,12 @@ [workspace] -members = ["rclrs", "examples/*"] -exclude = ["examples/rclrs_example_msgs"] +members = [ + "rclrs", + "examples/logging_demo", + "examples/message_demo", + "examples/minimal_client_service", + "examples/minimal_pub_sub", + "examples/parameter_demo", + "examples/rust_pubsub", + "examples/worker_demo", +] resolver = "2" From de74a6d9f361caf5c39a773cc4cad45802618c10 Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Fri, 8 Aug 2025 22:38:35 +0200 Subject: [PATCH 4/6] build: test CI with fix for colcon-cargo not discovering non-Cargo packages Signed-off-by: Esteve Fernandez --- .github/workflows/rust-minimal.yml | 2 +- .github/workflows/rust-stable.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust-minimal.yml b/.github/workflows/rust-minimal.yml index 3c3e03105..56e2bdb71 100644 --- a/.github/workflows/rust-minimal.yml +++ b/.github/workflows/rust-minimal.yml @@ -72,7 +72,7 @@ jobs: - name: Install colcon-cargo and colcon-ros-cargo run: | sudo rm -f /usr/lib/python3.12/EXTERNALLY-MANAGED - sudo pip3 install git+https://github.com/colcon/colcon-cargo.git + sudo pip3 install git+https://github.com/esteve/colcon-cargo.git@discover-non-cargo-packages sudo pip3 install git+https://github.com/colcon/colcon-ros-cargo.git - name: Check formatting of Rust packages diff --git a/.github/workflows/rust-stable.yml b/.github/workflows/rust-stable.yml index 65fe8b2a2..710073396 100644 --- a/.github/workflows/rust-stable.yml +++ b/.github/workflows/rust-stable.yml @@ -72,7 +72,7 @@ jobs: - name: Install colcon-cargo and colcon-ros-cargo run: | sudo rm -f /usr/lib/python3.12/EXTERNALLY-MANAGED - sudo pip3 install git+https://github.com/colcon/colcon-cargo.git + sudo pip3 install git+https://github.com/esteve/colcon-cargo.git@discover-non-cargo-packages sudo pip3 install git+https://github.com/colcon/colcon-ros-cargo.git - name: Check formatting of Rust packages From b52e3d7939f50d21382a78106219351b22efe4b3 Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Tue, 12 Aug 2025 13:21:33 +0200 Subject: [PATCH 5/6] build: only list rclrs in the Cargo.toml workspace file Signed-off-by: Esteve Fernandez --- Cargo.toml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c56675b4c..afac85b2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,5 @@ [workspace] members = [ "rclrs", - "examples/logging_demo", - "examples/message_demo", - "examples/minimal_client_service", - "examples/minimal_pub_sub", - "examples/parameter_demo", - "examples/rust_pubsub", - "examples/worker_demo", ] resolver = "2" From 7c0373597ae40bbfa2aec4ab0bffb3271ec52bff Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Wed, 13 Aug 2025 17:33:56 +0200 Subject: [PATCH 6/6] build: revert changes for colcon-cargo fork Signed-off-by: Esteve Fernandez --- .github/workflows/rust-minimal.yml | 2 +- .github/workflows/rust-stable.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust-minimal.yml b/.github/workflows/rust-minimal.yml index 56e2bdb71..3c3e03105 100644 --- a/.github/workflows/rust-minimal.yml +++ b/.github/workflows/rust-minimal.yml @@ -72,7 +72,7 @@ jobs: - name: Install colcon-cargo and colcon-ros-cargo run: | sudo rm -f /usr/lib/python3.12/EXTERNALLY-MANAGED - sudo pip3 install git+https://github.com/esteve/colcon-cargo.git@discover-non-cargo-packages + sudo pip3 install git+https://github.com/colcon/colcon-cargo.git sudo pip3 install git+https://github.com/colcon/colcon-ros-cargo.git - name: Check formatting of Rust packages diff --git a/.github/workflows/rust-stable.yml b/.github/workflows/rust-stable.yml index 710073396..65fe8b2a2 100644 --- a/.github/workflows/rust-stable.yml +++ b/.github/workflows/rust-stable.yml @@ -72,7 +72,7 @@ jobs: - name: Install colcon-cargo and colcon-ros-cargo run: | sudo rm -f /usr/lib/python3.12/EXTERNALLY-MANAGED - sudo pip3 install git+https://github.com/esteve/colcon-cargo.git@discover-non-cargo-packages + sudo pip3 install git+https://github.com/colcon/colcon-cargo.git sudo pip3 install git+https://github.com/colcon/colcon-ros-cargo.git - name: Check formatting of Rust packages