This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch xuanwo/rust-release-workflow-fix
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to 
refs/heads/xuanwo/rust-release-workflow-fix by this push:
     new 64ba226e0 ci: publish all rust crates in dependency order
64ba226e0 is described below

commit 64ba226e0afb7c4f65193fec20c8e35433cf380c
Author: Xuanwo <[email protected]>
AuthorDate: Wed Apr 1 18:09:22 2026 +0800

    ci: publish all rust crates in dependency order
---
 .github/workflows/release_rust.yml | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/.github/workflows/release_rust.yml 
b/.github/workflows/release_rust.yml
index a557577de..1c2849250 100644
--- a/.github/workflows/release_rust.yml
+++ b/.github/workflows/release_rust.yml
@@ -37,7 +37,7 @@ jobs:
   plan:
     runs-on: ubuntu-latest
     outputs:
-      matrix: ${{ steps.plan.outputs.matrix }}
+      packages: ${{ steps.plan.outputs.packages }}
     steps:
       - uses: actions/checkout@v6
       - name: Plan publish matrix
@@ -129,10 +129,10 @@ jobs:
           if len(ordered) != len(packages):
               raise RuntimeError("failed to resolve publish order for Rust 
crates")
 
-          matrix = json.dumps({"package": ordered})
-          print(f"matrix={matrix}")
+          packages = json.dumps(ordered)
+          print(f"packages={packages}")
           with open(Path(__import__('os').environ["GITHUB_OUTPUT"]), "a", 
encoding="utf-8") as fp:
-              fp.write(f"matrix={matrix}\n")
+              fp.write(f"packages={packages}\n")
 
   publish:
     if: ${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-') 
}}
@@ -140,10 +140,6 @@ jobs:
     runs-on: ubuntu-latest
     permissions:
       id-token: write
-    strategy:
-      max-parallel: 1
-      fail-fast: false
-      matrix: ${{ fromJson(needs.plan.outputs.matrix) }}
     steps:
       - uses: actions/checkout@v6
       - name: Checkout python env
@@ -162,9 +158,24 @@ jobs:
           need-protoc: true
       - uses: 
rust-lang/crates-io-auth-action@b7e9a28eded4986ec6b1fa40eeee8f8f165559ec
         id: auth
-      - name: Publish ${{ matrix.package }}
-        working-directory: ${{ matrix.package }}
-        run: cargo publish --no-verify
+      - name: Publish Rust crates
+        shell: python
         env:
+          PACKAGES: ${{ needs.plan.outputs.packages }}
           LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ 
env.LD_LIBRARY_PATH }}
           CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
+        run: |
+          import json
+          import os
+          import subprocess
+
+          packages = json.loads(os.environ["PACKAGES"])
+
+          for package in packages:
+              print(f"Publishing {package}")
+              subprocess.run(
+                  ["cargo", "publish", "--no-verify"],
+                  cwd=package,
+                  check=True,
+                  env=os.environ,
+              )

Reply via email to