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

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

commit 12fa339ec2648660d69de0a16cc4057db65305c5
Author: Shawn Yang <[email protected]>
AuthorDate: Thu Aug 14 17:13:21 2025 +0800

    fix(python): fix gh action pypi publish (#2468)
    
    ## What does this PR do?
    
    <!-- Describe the purpose of this PR. -->
    
    ## Related issues
    
    <!--
    Is there any related issue? Please attach here.
    
    - #xxxx0
    - #xxxx1
    - #xxxx2
    -->
    
    ## Does this PR introduce any user-facing change?
    
    <!--
    If any user-facing interface changes, please [open an
    issue](https://github.com/apache/fory/issues/new/choose) describing the
    need to do so and update the document if necessary.
    -->
    
    - [ ] Does this PR introduce any public API change?
    - [ ] Does this PR introduce any binary protocol compatibility change?
    
    ## Benchmark
    
    <!--
    When the PR has an impact on performance (if you don't know whether the
    PR will have an impact on performance, you can submit the PR first, and
    if it will have impact on performance, the code reviewer will explain
    it), be sure to attach a benchmark data here.
    -->
---
 .github/workflows/release.yaml | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 7061a3436..25cbba768 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -22,6 +22,9 @@ on:
     tags:
       - "v*"
 
+permissions:
+  contents: read
+
 jobs:
   build-wheels:
     name: Build Wheels
@@ -98,6 +101,9 @@ jobs:
     name: Publish Wheels
     runs-on: ubuntu-latest
     needs: build-wheels
+    permissions:
+      contents: read
+      id-token: write
     steps:
       - name: Download Wheel Artifacts
         uses: actions/download-artifact@v4
@@ -106,9 +112,16 @@ jobs:
           merge-multiple: true
       - name: Display structure of downloaded files
         run: ls -R downloaded_wheels
-      - name: Publish Wheels to PyPI
+      - name: Publish to TestPyPI
+        uses: pypa/gh-action-pypi-publish@release/v1
+        if: ${{ startsWith(github.ref, 'refs/tags/') && contains(github.ref, 
'-') }}
+        with:
+          repository-url: https://test.pypi.org/legacy/
+          skip-existing: true
+          packages-dir: downloaded_wheels
+      - name: Publish to PyPI
         uses: pypa/gh-action-pypi-publish@release/v1
+        if: ${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 
'-') }}
         with:
-          user: __token__
-          password: ${{ secrets.PYPI_API_TOKEN }}
-          packages-dir: downloaded_wheels/
+          skip-existing: true
+          packages-dir: downloaded_wheels


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

Reply via email to