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

chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory.git


The following commit(s) were added to refs/heads/main by this push:
     new 3735e36d1 fix(ci): fix python/dart release (#3688)
3735e36d1 is described below

commit 3735e36d143d8e08e9344e5b6f2ae7bd8a3d9a93
Author: Shawn Yang <[email protected]>
AuthorDate: Mon May 18 10:17:38 2026 +0800

    fix(ci): fix python/dart release (#3688)
    
    ## Why?
    
    
    
    ## What does this PR do?
    
    
    
    ## Related issues
    
    
    
    ## AI Contribution Checklist
    
    
    
    - [ ] Substantial AI assistance was used in this PR: `yes` / `no`
    - [ ] If `yes`, I included a completed [AI Contribution
    
Checklist](https://github.com/apache/fory/blob/main/AI_POLICY.md#9-contributor-checklist-for-ai-assisted-prs)
    in this PR description and the required `AI Usage Disclosure`.
    - [ ] If `yes`, my PR description includes the required `ai_review`
    summary and screenshot evidence of the final clean AI review results
    from both fresh reviewers on the current PR diff or current HEAD after
    the latest code changes.
    
    
    
    ## Does this PR introduce any user-facing change?
    
    
    
    - [ ] Does this PR introduce any public API change?
    - [ ] Does this PR introduce any binary protocol compatibility change?
    
    ## Benchmark
---
 .github/workflows/release-dart.yaml       | 17 +++++++++++++----
 ci/tasks/python_container_build_script.sh | 20 +++++++++++++++-----
 2 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/release-dart.yaml 
b/.github/workflows/release-dart.yaml
index 987fca0a6..9be025210 100644
--- a/.github/workflows/release-dart.yaml
+++ b/.github/workflows/release-dart.yaml
@@ -51,8 +51,17 @@ jobs:
           set -euo pipefail
           VERSION="${{ github.ref_name }}"
           VERSION="${VERSION#v}"
-          python ci/release.py bump_version -l dart -version "$VERSION"
-          VERSION="$VERSION" ruby <<'RUBY'
+          DART_VERSION="$VERSION"
+          if [[ "$VERSION" =~ ^(.+)-rc([0-9]+)$ ]]; then
+            DART_VERSION="${BASH_REMATCH[1]}-rc.${BASH_REMATCH[2]}"
+          fi
+          python ci/release.py bump_version -l dart -version "$DART_VERSION"
+          if [[ "$VERSION" == *-rc* ]]; then
+            echo "PUB_PUBLISH_VALIDATION_FLAGS=--skip-validation" >> 
"$GITHUB_ENV"
+          else
+            echo "PUB_PUBLISH_VALIDATION_FLAGS=" >> "$GITHUB_ENV"
+          fi
+          VERSION="$DART_VERSION" ruby <<'RUBY'
           require "yaml"
 
           expected = ENV.fetch("VERSION")
@@ -86,11 +95,11 @@ jobs:
         working-directory: dart/packages/fory
         run: |
           set -euo pipefail
-          dart pub publish --dry-run
+          dart pub publish --dry-run ${PUB_PUBLISH_VALIDATION_FLAGS}
 
       - name: Publish to pub.dev
         shell: bash
         working-directory: dart/packages/fory
         run: |
           set -euo pipefail
-          dart pub publish --force
+          dart pub publish --force ${PUB_PUBLISH_VALIDATION_FLAGS}
diff --git a/ci/tasks/python_container_build_script.sh 
b/ci/tasks/python_container_build_script.sh
index 46e4007ac..2c887c37e 100644
--- a/ci/tasks/python_container_build_script.sh
+++ b/ci/tasks/python_container_build_script.sh
@@ -53,8 +53,18 @@ verify_version() {
 # use the python interpreters preinstalled in manylinux
 OLD_PATH=$PATH
 for PY in $PYTHON_VERSIONS; do
-    export PYTHON_PATH="/opt/python/$PY/bin/python"
-    export PATH="/opt/python/$PY/bin:$OLD_PATH"
+    PYTHON_BIN_DIR="/opt/python/$PY/bin"
+    if [ -x "$PYTHON_BIN_DIR/python" ]; then
+        export PYTHON_PATH="$PYTHON_BIN_DIR/python"
+    elif [ -x "$PYTHON_BIN_DIR/python3" ]; then
+        export PYTHON_PATH="$PYTHON_BIN_DIR/python3"
+    else
+        echo "No Python executable found under $PYTHON_BIN_DIR" >&2
+        ls -l "$PYTHON_BIN_DIR" >&2 || true
+        exit 1
+    fi
+    export PATH="$PYTHON_BIN_DIR:$OLD_PATH"
+    hash -r
     echo "Using $PYTHON_PATH"
     ARCH=$(uname -m)
     if [ "$ARCH" = "aarch64" ]; then
@@ -62,7 +72,7 @@ for PY in $PYTHON_VERSIONS; do
     else
         export PLAT="manylinux2014_x86_64"
     fi
-    python -m pip install cython wheel pytest auditwheel
+    "$PYTHON_PATH" -m pip install cython wheel pytest auditwheel
     ci/deploy.sh build_pyfory
 
     latest_wheel=$(find dist -maxdepth 1 -type f -name '*.whl' -print0 | xargs 
-0 ls -t | head -n1)
@@ -72,10 +82,10 @@ for PY in $PYTHON_VERSIONS; do
     fi
 
     echo "Attempting to install $latest_wheel"
-    python -m pip install "$latest_wheel"
+    "$PYTHON_PATH" -m pip install "$latest_wheel"
 
     # Verify the installed version matches the expected version
-    INSTALLED_VERSION=$(python -c "import pyfory; print(pyfory.__version__)")
+    INSTALLED_VERSION=$("$PYTHON_PATH" -c "import pyfory; 
print(pyfory.__version__)")
 
     # Only run version verification for release builds
     if [ "${RELEASE_BUILD:-0}" = "1" ]; then


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to