also looking at this
fix(action): normalize zig package name underscores to hyphens on publish
#206
2 files
+311
-304
| @@ -954,8 +954,15 @@ async function publishZigPackage(registryUrl: string, token: string, cwd: string | ||
| 954 | 954 | if (!nameMatch) throw new Error('Could not parse .name from build.zig.zon') |
| 955 | 955 | if (!versionMatch) throw new Error('Could not parse .version from build.zig.zon') |
| 956 | 956 | |
| 957 | const name = nameMatch[1] || nameMatch[2] || nameMatch[3] | |
| 957 | // Zig's `.name` field must be a valid enum literal, so packages use | |
| 958 | // underscores (e.g. `.zig_tls`). The pantry registry's canonical package | |
| 959 | // name uses hyphens (`zig-tls`) — normalize so Actions publish under the | |
| 960 | // same name the registry/site lists instead of a parallel `_` namespace. | |
| 961 | const rawName = nameMatch[1] || nameMatch[2] || nameMatch[3] | |
| 962 | const name = rawName.replace(/_/g, '-') | |
| 958 | 963 | const version = versionMatch[1] |
| 964 | if (name !== rawName) | |
| 965 | core.info(`Normalized package name ${rawName} -> ${name}`) | |
| 959 | 966 | core.info(`Package: ${name}@${version}`) |
| 960 | 967 | |
| 961 | 968 | // Collect paths from build.zig.zon .paths field |