Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 81 additions & 14 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2025-2026, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -11,17 +11,23 @@
# 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.
name: "Release Emerging-Optimizers"
name: "Build, validate, and release Emerging-Optimizers"

on:
push:
branches:
- main
- "r**"
- "pull-request/**"
- "deploy-release/*"
workflow_dispatch:
inputs:
release-ref:
description: Ref (SHA or branch name) to release
required: true
type: string
dry-run:
description: Do not publish a wheel and GitHub release.
description: Compute the release but do not publish wheel, GH release, or docs.
required: true
default: true
type: boolean
Expand All @@ -30,25 +36,86 @@ on:
required: true
default: true
type: boolean
generate-changelog:
description: Generate changelog
required: false
default: true
type: boolean
version-bump-branch:
description: Branch for version bump
required: true
type: string
gh-release-from-tag:
description: Tag of previous release for changelog builder
required: false
type: string
default: ""
publish-docs:
description: Publish docs
required: false
default: true
type: boolean

defaults:
run:
shell: bash -x -e -u -o pipefail {0}

permissions:
id-token: write
contents: write
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event_name }}
cancel-in-progress: ${{ github.event_name == 'push' }}

jobs:
pre-flight:
if: github.event_name != 'workflow_dispatch'
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_cicd_preflight.yml@v0.94.1

release:
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_release_library.yml@v0.57.0
needs: [pre-flight]
if: |
!cancelled() && !failure()
&& !(needs.pre-flight.outputs.docs_only == 'true'
|| needs.pre-flight.outputs.is_deployment_workflow == 'true')
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_release_library.yml@v1.1.0
with:
release-ref: ${{ inputs.release-ref }}
release-ref: ${{ inputs.release-ref || github.sha }}
python-package: emerging_optimizers
library-name: Emerging-Optimizers
dry-run: ${{ inputs.dry-run }}
version-bump-branch: ${{ inputs.version-bump-branch }}
create-gh-release: ${{ inputs.create-gh-release }}
validate-only: ${{ github.event_name != 'workflow_dispatch' }}
dry-run: ${{ inputs.dry-run || false }}
version-bump-branch: ${{ inputs.version-bump-branch || github.ref_name }}
create-gh-release: ${{ inputs.create-gh-release || true }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 When workflow_dispatch fires and the user explicitly sets create-gh-release: false, the expression inputs.create-gh-release || true evaluates to false || true = true, silently overriding the user's intent and always creating a GH release. This is the only boolean input that uses a truthy fallback (|| true); the others use || false which is safe.

Suggested change
create-gh-release: ${{ inputs.create-gh-release || true }}
create-gh-release: ${{ inputs.create-gh-release != '' && inputs.create-gh-release || true }}

packaging: uv
secrets:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
SLACK_WEBHOOK_ADMIN: ${{ secrets.SLACK_WEBHOOK_ADMIN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ENDPOINT }}
PAT: ${{ secrets.PAT }}
skip-wheel-build: true
app-id: ${{ vars.BOT_ID }}
gh-release-use-changelog-builder: ${{ inputs.generate-changelog || false }}
publish-docs: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 The publish-docs input is declared for workflow_dispatch (line 53–57) but the release job hardcodes publish-docs: true, so a caller setting publish-docs: false via workflow_dispatch is silently ignored and docs are always published. The pattern used for other boolean inputs in this file (inputs.X || <default>) should be applied here.

Suggested change
publish-docs: true
publish-docs: ${{ inputs.publish-docs || true }}

docs-target-path: nemo/emerging-optimizers
docs-sync-all: true
gh-release-from-tag: ${{ inputs.gh-release-from-tag || '' }}
restrict-to-admins: true
secrets: inherit # pragma: allowlist secret

release-summary:
needs: [pre-flight, release]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- name: Result
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
FAILED_JOBS=$(gh run view $GITHUB_RUN_ID --repo ${{ github.repository }} --json jobs --jq '[.jobs[] | select(.conclusion == "failure" or .conclusion == "timed_out" or .conclusion == "action_required")] | length')

if [ "${FAILED_JOBS:-0}" -eq 0 ]; then
echo "✅ All previous jobs completed successfully"
exit 0
else
echo "❌ Found $FAILED_JOBS failed job(s)"
gh run view $GITHUB_RUN_ID --repo ${{ github.repository }} --json jobs --jq '.jobs[] | select(.conclusion == "failure" or .conclusion == "timed_out" or .conclusion == "action_required") | .name'
exit 1
fi
Loading