-
Notifications
You must be signed in to change notification settings - Fork 37
ci: Major refactor of release-workflows #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
918fa5a
eb723b5
6a8f8e7
0384a1f
888df7b
66de54d
c3dfa12
06eb6d9
7a13f48
cdd2694
0a90778
7c1e8d4
fc0e75b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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. | ||||||
|
|
@@ -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 | ||||||
|
|
@@ -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 }} | ||||||
| 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 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 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 | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workflow_dispatchfires and the user explicitly setscreate-gh-release: false, the expressioninputs.create-gh-release || trueevaluates tofalse || 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|| falsewhich is safe.