chore: Add upper bound to kernels to fix bug with transformers (#563) #30
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
| # Copyright (c) 2024-2026, NVIDIA CORPORATION. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| # --------------------------------------------------------------------------- | |
| # Release: build wheel, publish to PyPI, create a GitHub release, and | |
| # publish versioned docs. | |
| # | |
| # No version-bump PR, no dummy branch push. | |
| # --------------------------------------------------------------------------- | |
| name: "Release NeMo Safe Synthesizer" | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| defaults: | |
| run: | |
| shell: bash -x -e -u -o pipefail {0} | |
| permissions: | |
| contents: read | |
| jobs: | |
| publish-wheel: | |
| name: Publish wheel Test PyPI and PyPI | |
| runs-on: linux-amd64-cpu4 | |
| outputs: | |
| version: ${{ steps.build.outputs.version }} | |
| is_prerelease: ${{ steps.build.outputs.is_prerelease }} | |
| steps: | |
| - name: Checkout at release ref | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Setup Python environment | |
| uses: ./.github/actions/setup-python-env | |
| with: | |
| checkout: "false" | |
| bootstrap-tools: "true" | |
| - name: Build wheel | |
| id: build | |
| run: | | |
| mise run build-wheel | |
| WHEEL=$(ls dist/*.whl) | |
| VERSION=$(echo "$WHEEL" | sed -n 's/.*-\([0-9][^-]*\)-.*/\1/p') | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| IS_PRERELEASE=false | |
| if echo "$VERSION" | grep -qE '(rc|alpha|beta|\.dev)'; then | |
| IS_PRERELEASE=true | |
| fi | |
| echo "is_prerelease=$IS_PRERELEASE" >> "$GITHUB_OUTPUT" | |
| echo "Built: $WHEEL (version $VERSION)" | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: nemo-safe-synthesizer-${{ steps.build.outputs.version }} | |
| path: dist/*.whl | |
| retention-days: 90 | |
| - name: Publish to Test PyPI (always, as pre-flight) | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PERSONAL_TOKEN }} | |
| run: | | |
| uvx twine upload \ | |
| --repository-url https://test.pypi.org/legacy/ \ | |
| --skip-existing \ | |
| --non-interactive \ | |
| --verbose \ | |
| dist/*.whl | |
| - name: Publish to PyPI | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_PERSONAL_TOKEN }} | |
| run: | | |
| uvx twine upload \ | |
| --non-interactive \ | |
| --verbose \ | |
| dist/*.whl | |
| create-gh-release: | |
| name: Create GitHub release | |
| needs: publish-wheel | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout at release ref | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Download wheel artifact | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 | |
| with: | |
| name: nemo-safe-synthesizer-${{ needs.publish-wheel.outputs.version }} | |
| path: dist/ | |
| - name: Create GitHub release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| VERSION: ${{ needs.publish-wheel.outputs.version }} | |
| IS_PRERELEASE: ${{ needs.publish-wheel.outputs.is_prerelease }} | |
| run: | | |
| PRERELEASE_FLAG="" | |
| if [ "$IS_PRERELEASE" = "true" ]; then | |
| PRERELEASE_FLAG="--prerelease" | |
| fi | |
| gh release create "v${VERSION}" \ | |
| dist/*.whl \ | |
| --title "v${VERSION}" \ | |
| --generate-notes \ | |
| $PRERELEASE_FLAG | |
| publish-release-docs: | |
| name: Publish release docs | |
| needs: publish-wheel | |
| if: ${{ needs.publish-wheel.outputs.is_prerelease != 'true' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout at release ref | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Setup Python environment | |
| uses: ./.github/actions/setup-python-env | |
| with: | |
| checkout: "false" | |
| bootstrap-tools: "true" | |
| - name: Install docs dependencies | |
| run: mise run bootstrap-nss dev | |
| - name: Configure git for mike | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Publish versioned docs to GitHub Pages | |
| env: | |
| VERSION: ${{ needs.publish-wheel.outputs.version }} | |
| run: | | |
| uv run --frozen --group docs mike deploy --push "${VERSION}" |