Wheel Release #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Wheel Release | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: write # Required to upload assets to the release | |
| jobs: | |
| build-upload-verify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: pip install tox | |
| # - name: Run basic unit tests | |
| # run: tox -e py312-torch29-tf_latest-unit | |
| - name: Build Wheel | |
| run: | | |
| tox -e build-wheel | |
| WHEEL_PATH=$(find dist -name "*.whl" | head -n 1) | |
| WHEEL_NAME=$(basename $WHEEL_PATH) | |
| echo "WHEEL_PATH=$WHEEL_PATH" >> $GITHUB_ENV | |
| echo "WHEEL_NAME=$WHEEL_NAME" >> $GITHUB_ENV | |
| - name: Upload GitHub Release Artifact | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release upload ${{ github.event.release.tag_name }} ${{ env.WHEEL_PATH }} | |
| - name: Publish to PyPI via KitMaker | |
| run: | | |
| DOWNLOAD_URL="https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/${{ env.WHEEL_NAME }}" | |
| echo "Releasing wheel to Kitmaker Portal..." | |
| RESPONSE=$(curl -s -X POST \ | |
| "${{ secrets.KITMAKER_RELEASE_URL }}" \ | |
| -H "Authorization: Bearer ${{ secrets.KITMAKER_API_TOKEN }}" \ | |
| -H "Content-Type: application/json" \ | |
| -d "{ | |
| \"project_name\": \"nvidia-modelopt\", | |
| \"payload\": [ | |
| { | |
| \"pic\": \"${{ secrets.KITMAKER_PIC_EMAIL }}\", | |
| \"job_type\": \"wheel-release-job\", | |
| \"publish_to\": \"${{ vars.KITMAKER_PUBLISH_TO }}\", | |
| \"url\": \"${DOWNLOAD_URL}\", | |
| \"size\": \"small\", | |
| \"upload\": true | |
| } | |
| ] | |
| }") | |
| echo "Release response: $RESPONSE" | |
| # Check if release was successful | |
| if echo "$RESPONSE" | jq -e '.release_uuid' > /dev/null; then | |
| echo "✅ Release created successfully" | |
| else | |
| echo "❌ Release failed" | |
| exit 1 | |
| fi |