You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: replace nuget.exe with dotnet nuget CLI in C# workflow
The pushNuGetPackageToGitHubPackageRegistry job failed because nuget.exe
requires Mono, which is not installed on Ubuntu 24.04 runners. This has
been broken since at least July 2025 (run 16390287640).
Changes:
- Replace nuget CLI with dotnet nuget commands (no Mono needed)
- Remove nuget/setup-nuget@v1 dependency
- Update actions/checkout from v1/v3 to v4
- Update tj-actions/changed-files from v21 to v46
- Replace deprecated ::set-output with $GITHUB_OUTPUT
- Update case study with C# CI failure analysis
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
-**Job:** Auto Release → "Determine bump type from changelog fragments"
9
-
-**Status:** Root cause identified and fixed.
10
+
-**Status:** Root causes identified and fixed.
10
11
11
12
---
12
13
13
14
## Timeline / Sequence of Events
14
15
15
16
1. Commit `bde6c03` was pushed to `main` (merge of PR #134).
16
-
2. The Rust CI/CD Pipeline was triggered.
17
-
3. All jobs passed except **Auto Release**.
18
-
4. The "Determine bump type from changelog fragments" step ran `rust-script scripts/get-bump-type.rs`.
19
-
5. The Rust compiler emitted a fatal error due to `RUSTFLAGS: -Dwarnings` treating unused imports as errors.
20
-
6.`rust-script` exited with code 1, failing the step and the entire Auto Release job.
17
+
2. Both the Rust CI/CD Pipeline and the C# workflow were triggered.
18
+
3.**Rust:** All jobs passed except **Auto Release** — the "Determine bump type from changelog fragments" step failed.
19
+
4.**C#:** All jobs passed except **pushNuGetPackageToGitHubPackageRegistry** — the `nuget source Add` command failed.
21
20
22
21
---
23
22
24
23
## Root Cause Analysis
25
24
26
-
### Primary Root Cause
25
+
### Rust CI Failure: Unused Import in get-bump-type.rs
26
+
27
+
**Primary Root Cause:**
27
28
28
29
In `scripts/get-bump-type.rs`, line 30 contained:
29
30
@@ -33,7 +34,7 @@ use std::process::exit;
33
34
34
35
This import is **never used** anywhere in the file. All other scripts that import `exit` do call it; only `get-bump-type.rs` does not.
35
36
36
-
### Why It Became a Fatal Error
37
+
**Why It Became a Fatal Error:**
37
38
38
39
The CI workflow (`rust.yml`, line 48) sets:
39
40
@@ -44,50 +45,75 @@ env:
44
45
45
46
The `-Dwarnings` flag promotes all Rust compiler warnings to errors. The `unused-imports` lint (normally a warning) became a compile error, preventing `rust-script` from building and running the script.
46
47
47
-
### Why Other Scripts Were Not Affected
48
+
**Fix:** Remove the unused import from `scripts/get-bump-type.rs`.
49
+
50
+
### C# CI Failure: Mono Not Found on Ubuntu 24.04
51
+
52
+
**Primary Root Cause:**
53
+
54
+
The `pushNuGetPackageToGitHubPackageRegistry` job used `nuget/setup-nuget@v1` to install `nuget.exe`, then ran:
On Linux, `nuget.exe` is a .NET Framework executable that requires **Mono** to run. Ubuntu 24.04 GitHub-hosted runners **do not have Mono pre-installed**, resulting in:
62
+
63
+
```
64
+
/opt/hostedtoolcache/nuget.exe/7.3.0/x64/nuget: 2: mono: not found
65
+
##[error]Process completed with exit code 127.
66
+
```
48
67
49
-
All other scripts that declare `use std::process::exit;` actually call `exit()`:
This same failure occurred in CI run [16390287640](https://github.com/linksplatform/Numbers/actions/runs/16390287640) on **2025-07-19**, confirming the issue has persisted for at least **8 months**.
60
71
61
-
### Why the Import Was Present
72
+
**Fix:** Replace `nuget.exe` CLI commands with `dotnet nuget` commands, which are part of the .NET SDK already installed on the runner:
The `get-bump-type.rs` script was likely refactored at some point to use Rust's `std::process::exit()` for error handling, then changed to use `return` or `eprintln!` patterns instead, leaving the `use` statement behind without removing it.
87
+
### Additional Issues Fixed in C# Workflow
88
+
89
+
| Issue | Before | After | Why |
90
+
|-------|--------|-------|-----|
91
+
| Outdated checkout action | `actions/checkout@v1` | `actions/checkout@v4` | v1 is 5+ years old, missing security fixes and features |
0 commit comments