Skip to content

ci: fix nexus upload pipeline and release auto-trigger#2252

Merged
alandtse merged 4 commits into
community-shaders:devfrom
alandtse:fix/ci-build-issues
May 1, 2026
Merged

ci: fix nexus upload pipeline and release auto-trigger#2252
alandtse merged 4 commits into
community-shaders:devfrom
alandtse:fix/ci-build-issues

Conversation

@alandtse
Copy link
Copy Markdown
Collaborator

@alandtse alandtse commented May 1, 2026

Summary

  • Nexus upload bash quoting: Fixed multiline GITHUB_OUTPUT with random delimiter; was crashing with exit code 2 on every run
  • Skip vs2022 for releases: Use matrix exclude so tag/release builds only run vs2026; vs2022 excluded via strategy.matrix.exclude (matrix context not valid in job-level if)
  • Nexus stable-tag baseline: PREVIOUS_TAG was resolving to v1.5.0-rc.5 instead of v1.4.11 due to version sort ordering; fixed with grep -v -- '-' to skip pre-release tags
  • Nexus auto-trigger on publish: Replaced workflow_run trigger (fired while release still a draft, causing gh release download 404) with release: [published]; added explicit draft-release guard in resolve step for manual dispatch

Test plan

  • Trigger Upload Nexus Release manually with a published stable tag — should pass resolve step
  • Trigger Upload Nexus Release manually with a draft tag — should fail fast at resolve with clear error
  • Publish a draft release — Nexus Upload (Post Release) should fire automatically
  • Publish a pre-release (RC) — auto-trigger should be skipped by if condition
  • Tag-triggered build: verify only vs2026 matrix runs

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced release workflow to trigger on GitHub release events and added validation to ensure only published releases are processed for artifact upload.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

📝 Walkthrough

Walkthrough

The PR modifies GitHub Actions workflows for Nexus artifact uploads. The trigger mechanism switches from a conditional upstream workflow completion to the GitHub release event, with added draft-vs-published validation and pre-release tag filtering in the upload logic.

Changes

Cohort / File(s) Summary
Release Trigger Refactoring
.github/workflows/nexus-upload-on-release.yaml
Workflow trigger mechanism changed from workflow_run (upstream build completion) to release event (published releases). Conditional logic simplified to filter only stable releases (excluding tags containing -). Tag variable updated to source from release event instead of upstream workflow branch.
Release Validation Logic
.github/workflows/upload-nexus.yaml
Added published-vs-draft validation step that queries GitHub Releases API to reject draft releases. Updated PREVIOUS_TAG selection to exclude pre-release-like tags (containing -) from consideration. Introduced GH_TOKEN environment variable for API access.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A release springs forth without delay,
No draft can sneak past us today!
Pre-release tags we kindly shun,
To Nexus flows the stable one! 🚀
Stable branches, published and true,
Workflow hops through, just like we do! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: CI fixes to the release pipeline, Nexus upload workflow, and GitHub Action version updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

No actionable suggestions for changed features.

alandtse and others added 4 commits May 1, 2026 03:14
- upload-nexus: the has_uploads output line used nested \" escapes
  inside echo "...$(python -c \"...\")". When GitHub Actions writes
  the YAML run block to a temp shell script the \" become literal "
  creating unbalanced quotes; bash exits with code 2 after the
  matrix<<EOF block is already open in GITHUB_OUTPUT, causing the
  secondary "Matching delimiter not found 'EOF'" error. Fixed by
  capturing the result in a variable with a single-quoted python
  command. Also switched to a random delimiter to prevent any future
  content collisions.
- _build: add run-vs2022 input (default true); build.yaml passes
  false to skip the vs2022 job for tag/release builds where only
  the vs2026 artifact is shipped. PR builds continue running both.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
matrix context is not available in job-level if conditions (only in
steps); using it there fails GitHub Actions static validation. Switch
to strategy.matrix.exclude with a conditional value: when run-vs2022
is false the exclude entry matches the vs2022 compiler and removes it
from the matrix; when true the value is empty so nothing is excluded.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PREVIOUS_TAG was picking v1.5.0-rc.5 over v1.4.11 because version
sort puts RCs ahead of the prior stable. Features bumped before the
first RC would never be detected as needing a Nexus upload.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace workflow_run trigger with release: [published] so Nexus
  upload fires automatically when a draft is published, not when
  the build completes (which was too early — release still a draft)
- Add explicit draft-release guard in resolve step so manual dispatch
  on an unpublished release fails fast with a clear error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alandtse alandtse force-pushed the fix/ci-build-issues branch from 7a5d0eb to fcea21a Compare May 1, 2026 10:15
@alandtse alandtse changed the title ci: fix release pipeline, nexus upload, and action version bumps ci: fix nexus upload pipeline and release auto-trigger May 1, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/nexus-upload-on-release.yaml:
- Around line 13-17: The workflow caller sets the reusable workflow input
dry_run to "true", which prevents the upload step gated by the upload-to-nexus
condition from ever running; change the dry_run input passed to the reusable
workflow (in .github/workflows/nexus-upload-on-release.yaml where it calls
./.github/workflows/upload-nexus.yaml) from "true" to "false" (or wire it to a
release/input variable that evaluates to false) so the upload-to-nexus gate in
upload-nexus.yaml will allow the actual upload to run.

In @.github/workflows/upload-nexus.yaml:
- Around line 101-106: The script uses the list releases endpoint and
client-side filtering which hits pagination; change the gh api call that sets
DRAFT (currently calling "repos/$GITHUB_REPOSITORY/releases" with TAG filtering)
to call the tag-specific endpoint "repos/$GITHUB_REPOSITORY/releases/tags/$TAG"
so the release is looked up directly, then extract .draft from that response and
handle a non-existent/404 response (treat as error); update the DRAFT assignment
and the subsequent check that compares DRAFT to "false" accordingly (symbols:
DRAFT, TAG, the gh api invocation).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 770ea058-72bb-463a-929c-5c1733a32f22

📥 Commits

Reviewing files that changed from the base of the PR and between 7772e8f and fcea21a.

📒 Files selected for processing (2)
  • .github/workflows/nexus-upload-on-release.yaml
  • .github/workflows/upload-nexus.yaml

Comment on lines 13 to 17
uses: ./.github/workflows/upload-nexus.yaml
with:
tag: ${{ github.event.workflow_run.head_branch }}
tag: ${{ github.event.release.tag_name }}
artifact_pattern: "CommunityShaders-*.7z"
dry_run: "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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

This published-release workflow still never performs the upload.

Because .github/workflows/upload-nexus.yaml gates upload-to-nexus on dry_run != 'true' at Lines 245-247, this caller can only do the preview path. If the intent is to upload automatically after publish, this input needs to be false.

Suggested fix
         with:
             tag: ${{ github.event.release.tag_name }}
             artifact_pattern: "CommunityShaders-*.7z"
-            dry_run: "true"
+            dry_run: "false"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: ./.github/workflows/upload-nexus.yaml
with:
tag: ${{ github.event.workflow_run.head_branch }}
tag: ${{ github.event.release.tag_name }}
artifact_pattern: "CommunityShaders-*.7z"
dry_run: "true"
uses: ./.github/workflows/upload-nexus.yaml
with:
tag: ${{ github.event.release.tag_name }}
artifact_pattern: "CommunityShaders-*.7z"
dry_run: "false"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/nexus-upload-on-release.yaml around lines 13 - 17, The
workflow caller sets the reusable workflow input dry_run to "true", which
prevents the upload step gated by the upload-to-nexus condition from ever
running; change the dry_run input passed to the reusable workflow (in
.github/workflows/nexus-upload-on-release.yaml where it calls
./.github/workflows/upload-nexus.yaml) from "true" to "false" (or wire it to a
release/input variable that evaluates to false) so the upload-to-nexus gate in
upload-nexus.yaml will allow the actual upload to run.

Comment on lines +101 to +106
DRAFT=$(gh api "repos/$GITHUB_REPOSITORY/releases" \
--jq ".[] | select(.tag_name == \"$TAG\") | .draft" 2>/dev/null | head -1)
if [ "$DRAFT" != "false" ]; then
echo "ERROR: Release '$TAG' is not published. Publish the GitHub release before uploading to Nexus." >&2
exit 1
fi
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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/upload-nexus.yaml | sed -n '95,110p'

Repository: community-shaders/skyrim-community-shaders

Length of output: 1010


🏁 Script executed:

cat -n .github/workflows/upload-nexus.yaml | sed -n '1,50p'

Repository: community-shaders/skyrim-community-shaders

Length of output: 2181


🏁 Script executed:

wc -l .github/workflows/upload-nexus.yaml

Repository: community-shaders/skyrim-community-shaders

Length of output: 126


🏁 Script executed:

# Check GitHub CLI documentation for releases endpoint behavior
gh api --help 2>&1 | head -50

Repository: community-shaders/skyrim-community-shaders

Length of output: 2767


🏁 Script executed:

# Test what happens when gh api returns empty result
TEST_EMPTY=$(echo "" | head -1)
if [ "$TEST_EMPTY" != "false" ]; then
  echo "Empty string test: condition is TRUE (empty != false)"
else
  echo "Empty string test: condition is FALSE"
fi

# Test what the condition does with actual empty output
TEST_EMPTY2=$( { echo ""; } | head -1)
if [ "$TEST_EMPTY2" != "false" ]; then
  echo "Empty output test: condition is TRUE"
else
  echo "Empty output test: condition is FALSE"
fi

Repository: community-shaders/skyrim-community-shaders

Length of output: 177


🌐 Web query:

GitHub API GET /repos/{owner}/{repo}/releases pagination default per_page

💡 Result:

The default per_page for the GitHub REST API GET /repos/{owner}/{repo}/releases endpoint is 30. This is explicitly stated in the official GitHub documentation for the releases endpoint. The maximum per_page is 100. Pagination also supports a page parameter with default 1.

Citations:


🌐 Web query:

GitHub API GET /repos/{owner}/{repo}/releases/tags/{tag} endpoint

💡 Result:

The GitHub REST API endpoint GET /repos/{owner}/{repo}/releases/tags/{tag} retrieves a published release associated with the specified tag name. Path parameters: - owner (string, required): The account owner of the repository. The name is not case sensitive. - repo (string, required): The name of the repository without the .git extension. The name is not case sensitive. - tag (string, required): The tag name. HTTP method: GET Base URL: https://api.github.com Example: curl -L -X GET https://api.github.com/repos/OWNER/REPO/releases/tags/TAG Response: On success (200), returns the full release object (same schema as the "Create a release" endpoint), including fields like id, tag_name, name, body, author, assets, etc. This endpoint gets releases only; it does not return regular Git tags without an associated release. Use the Repository Tags API for plain tags. No authentication is strictly required for public repositories, but recommended for rate limits. Uses standard GitHub API headers like Accept: application/vnd.github+json.

Citations:


Use the tag-specific release endpoint to avoid pagination issues.

The list endpoint defaults to 30 items per page. When manually dispatched against older published tags (beyond the first page), the client-side filter fails to find the release, DRAFT becomes empty, and the condition [ "$DRAFT" != "false" ] incorrectly evaluates to true, causing a false "not published" error. Query the release by tag directly instead.

Suggested fix
-                  DRAFT=$(gh api "repos/$GITHUB_REPOSITORY/releases" \
-                    --jq ".[] | select(.tag_name == \"$TAG\") | .draft" 2>/dev/null | head -1)
+                  DRAFT=$(gh api "repos/$GITHUB_REPOSITORY/releases/tags/$TAG" \
+                    --jq '.draft' 2>/dev/null)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
DRAFT=$(gh api "repos/$GITHUB_REPOSITORY/releases" \
--jq ".[] | select(.tag_name == \"$TAG\") | .draft" 2>/dev/null | head -1)
if [ "$DRAFT" != "false" ]; then
echo "ERROR: Release '$TAG' is not published. Publish the GitHub release before uploading to Nexus." >&2
exit 1
fi
DRAFT=$(gh api "repos/$GITHUB_REPOSITORY/releases/tags/$TAG" \
--jq '.draft' 2>/dev/null)
if [ "$DRAFT" != "false" ]; then
echo "ERROR: Release '$TAG' is not published. Publish the GitHub release before uploading to Nexus." >&2
exit 1
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/upload-nexus.yaml around lines 101 - 106, The script uses
the list releases endpoint and client-side filtering which hits pagination;
change the gh api call that sets DRAFT (currently calling
"repos/$GITHUB_REPOSITORY/releases" with TAG filtering) to call the tag-specific
endpoint "repos/$GITHUB_REPOSITORY/releases/tags/$TAG" so the release is looked
up directly, then extract .draft from that response and handle a
non-existent/404 response (treat as error); update the DRAFT assignment and the
subsequent check that compares DRAFT to "false" accordingly (symbols: DRAFT,
TAG, the gh api invocation).

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

✅ A pre-release build is available for this PR:
Download

@alandtse alandtse merged commit f5bd0a7 into community-shaders:dev May 1, 2026
16 checks passed
ParticleTroned added a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 15, 2026
…ders#2252)

Adapted from PR community-shaders#2252. Kept this branch's existing release trigger and draft-release guard; applied the missing stable-tag base selection filter.
ParticleTroned added a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 16, 2026
…ders#2252)

Adapted from PR community-shaders#2252. Kept this branch's existing release trigger and draft-release guard; applied the missing stable-tag base selection filter.
IgorAlanAlbuquerque pushed a commit to IgorAlanAlbuquerque/skyrim-community-shaders that referenced this pull request May 29, 2026
…ders#2252)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants