From ca9a230c4c73778dd6e1dc83d04ffc7d052029ea Mon Sep 17 00:00:00 2001 From: Will Killian <2007799+willkill07@users.noreply.github.com> Date: Fri, 15 May 2026 07:12:15 -0400 Subject: [PATCH] ci: trigger gitlab publishing from tags (#116) #### Overview Updates the mirrored GitLab publishing workflow so NVIDIA Artifactory publication is triggered by a tag push instead of a GitLab pipeline schedule. - [x] I confirm this contribution is my own work, or I have the right to submit it under this project's license. - [x] I searched existing issues and open pull requests, and this does not duplicate existing work. #### Details - Changes the GitLab workflow and Artifactory publish jobs to run on `CI_COMMIT_TAG` tag push pipelines. - Uses the GitLab tag directly when waiting for the mirrored GitHub tag and matching GitHub Actions artifact run. - Removes the scheduled nightly-alpha tag calculation from the GitLab collector path. - Documents that the mirrored GitLab Artifactory publishing path is tag-driven and does not require a GitLab cron. #### Where should the reviewer start? Start with `.gitlab-ci.yml` to review the trigger and artifact collection change, then `RELEASING.md` for the release-process documentation update. #### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) - Relates to: none ## Summary by CodeRabbit * **Chores** * Refactored CI/CD pipeline to trigger releases via tag pushes instead of scheduled builds, updating artifact collection and publication workflows. * **Documentation** * Updated release process documentation to describe tag-driven publishing to Python, Cargo, and npm registries. Signed-off-by: Will Killian --- .gitlab-ci.yml | 41 +++++++++++++++++++---------------------- RELEASING.md | 15 +++++++++++++++ 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index adc7658b..329ff8fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,11 @@ # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# Configure the GitLab pipeline schedule with cron `12 9 * * *`. +# Push a raw SemVer tag, such as `0.1.0` or `0.1.0-alpha.20260515`, +# to run the publishing pipeline. workflow: rules: - - if: $CI_PIPELINE_SOURCE == 'schedule' + - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_TAG - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH - when: never @@ -51,7 +52,7 @@ collect:github-artifacts: name: alpine:3.22 pull_policy: if-not-present rules: - - if: $CI_PIPELINE_SOURCE == 'schedule' + - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_TAG - when: never before_script: - apk add --no-cache findutils github-cli unzip @@ -67,25 +68,19 @@ collect:github-artifacts: mkdir -p collected/wheels collected/wasm collected/node downloaded - version="$(sed -n 's/^version = "\(.*\)"$/\1/p' Cargo.toml | head -n1)" - if [ -z "$version" ]; then - echo "Error: failed to read workspace version from Cargo.toml." >&2 - exit 1 - fi - if ! printf '%s\n' "$version" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then - echo "Error: workspace version must be a stable SemVer base for nightly alpha tags: ${version}" >&2 + tag="${CI_COMMIT_TAG:-}" + if [ -z "$tag" ]; then + echo "Error: CI_COMMIT_TAG is required to collect GitHub Actions artifacts for publishing." >&2 exit 1 fi - tag_date="$(date -u +%Y%m%d)" - tag="${version}-alpha.${tag_date}" tag_ref="tags/${tag}" deadline="$(( $(date -u +%s) + NEMO_FLOW_CI_GITHUB_RUN_WAIT_SECONDS ))" - echo "Waiting for nightly alpha tag ${tag} in ${NEMO_FLOW_CI_GITHUB_REPOSITORY}" + echo "Waiting for tag ${tag} in ${NEMO_FLOW_CI_GITHUB_REPOSITORY}" while ! gh api "repos/${NEMO_FLOW_CI_GITHUB_REPOSITORY}/git/ref/${tag_ref}" >/dev/null 2>&1; do if [ "$(date -u +%s)" -ge "$deadline" ]; then - echo "Error: nightly alpha tag ${tag} did not appear within ${NEMO_FLOW_CI_GITHUB_RUN_WAIT_SECONDS} seconds." >&2 + echo "Error: tag ${tag} did not appear within ${NEMO_FLOW_CI_GITHUB_RUN_WAIT_SECONDS} seconds." >&2 exit 1 fi sleep "$NEMO_FLOW_CI_GITHUB_RUN_POLL_SECONDS" @@ -108,13 +103,13 @@ collect:github-artifacts: break fi if [ "$(date -u +%s)" -ge "$deadline" ]; then - echo "Error: no GitHub Actions run found for nightly alpha tag ${tag} within ${NEMO_FLOW_CI_GITHUB_RUN_WAIT_SECONDS} seconds." >&2 + echo "Error: no GitHub Actions run found for tag ${tag} within ${NEMO_FLOW_CI_GITHUB_RUN_WAIT_SECONDS} seconds." >&2 exit 1 fi sleep "$NEMO_FLOW_CI_GITHUB_RUN_POLL_SECONDS" done if [ -z "$run_id" ]; then - echo "Error: no GitHub Actions run found for nightly alpha tag ${tag}." >&2 + echo "Error: no GitHub Actions run found for tag ${tag}." >&2 exit 1 fi @@ -124,13 +119,13 @@ collect:github-artifacts: --json url \ --jq '.url' )" - echo "Watching GitHub Actions run ${run_id} for nightly alpha tag ${tag}: ${run_html_url}" + echo "Watching GitHub Actions run ${run_id} for tag ${tag}: ${run_html_url}" if ! timeout "$NEMO_FLOW_CI_GITHUB_RUN_WAIT_SECONDS" \ gh run watch "$run_id" \ --repo "$NEMO_FLOW_CI_GITHUB_REPOSITORY" \ --interval "$NEMO_FLOW_CI_GITHUB_RUN_POLL_SECONDS" \ --exit-status; then - echo "Error: GitHub Actions run ${run_id} for nightly alpha tag ${tag} failed, was cancelled, or did not complete within ${NEMO_FLOW_CI_GITHUB_RUN_WAIT_SECONDS} seconds: ${run_html_url}" >&2 + echo "Error: GitHub Actions run ${run_id} for tag ${tag} failed, was cancelled, or did not complete within ${NEMO_FLOW_CI_GITHUB_RUN_WAIT_SECONDS} seconds: ${run_html_url}" >&2 exit 1 fi @@ -169,7 +164,7 @@ collect:github-artifacts: printf '}\n' } > collected/github-run.json artifacts: - name: github-nightly-package-artifacts + name: github-package-artifacts when: on_success expire_in: 7 days paths: @@ -184,7 +179,7 @@ publish:artifactory:wheels: name: ghcr.io/astral-sh/uv:${NEMO_FLOW_CI_UV_VERSION}-${NEMO_FLOW_CI_DEBIAN_VERSION}-slim pull_policy: if-not-present rules: - - if: $CI_PIPELINE_SOURCE == 'schedule' + - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_TAG - when: never needs: - job: collect:github-artifacts @@ -213,7 +208,7 @@ publish:artifactory:cargo: name: rust:${NEMO_FLOW_CI_RUST_VERSION}-${NEMO_FLOW_CI_DEBIAN_VERSION} pull_policy: if-not-present rules: - - if: $CI_PIPELINE_SOURCE == 'schedule' + - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_TAG - when: never needs: - job: collect:github-artifacts @@ -261,6 +256,8 @@ publish:artifactory:cargo: mkdir -p "$cargo_home" cat > "${cargo_home}/config.toml" <