diff --git a/.github/workflows/wheel_mac.yaml b/.github/workflows/wheel_mac.yaml index 3ae0fab..1b87239 100644 --- a/.github/workflows/wheel_mac.yaml +++ b/.github/workflows/wheel_mac.yaml @@ -13,11 +13,6 @@ jobs: platform: ['macos-13', 'macos-latest'] runs-on: ${{ matrix.platform }} - environment: - name: pypi - url: https://pypi.org/p/xgrammar - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing defaults: run: shell: 'bash -l {0}' @@ -101,6 +96,31 @@ jobs: python -m pip install setuptools Cython wheel cd python python setup.py bdist_wheel + - uses: actions/upload-artifact@v4 + with: + name: xgrammar-wheel-${{ matrix.platform }} + path: python/dist/ + retention-days: 3 + overwrite: true + + Publish-to-PyPI: + needs: + - Build + runs-on: ubuntu-latest + + environment: + name: pypi + url: https://pypi.org/p/xgrammar + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the wheels + uses: actions/download-artifact@v4 + with: + pattern: xgrammar-wheel-macos-* + path: python/dist/ + merge-multiple: true - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/.github/workflows/wheel_windows.yaml b/.github/workflows/wheel_windows.yaml index afd0ce5..70fda30 100644 --- a/.github/workflows/wheel_windows.yaml +++ b/.github/workflows/wheel_windows.yaml @@ -9,11 +9,6 @@ on: jobs: Build: runs-on: windows-latest - environment: - name: pypi - url: https://pypi.org/p/xgrammar - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing defaults: run: shell: 'cmd /C call {0}' @@ -100,6 +95,30 @@ jobs: python -m pip install setuptools Cython wheel cd python python setup.py bdist_wheel + - uses: actions/upload-artifact@v4 + with: + name: xgrammar-wheel-windows + path: python/dist/ + retention-days: 3 + overwrite: true + + Publish-to-PyPI: + needs: + - Build + runs-on: ubuntu-latest + + environment: + name: pypi + url: https://pypi.org/p/xgrammar + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the wheels + uses: actions/download-artifact@v4 + with: + name: xgrammar-wheel-windows + path: python/dist/ - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: