mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-24 10:12:44 +00:00
fix(release): run release scripts as main on Windows runners (#4474)
The ESM main-module guard compared import.meta.url with "file://" + process.argv[1],
which never matches on Windows (file://D:\a\... vs file:///D:/a/...). On the Windows
desktop release job, scripts/github-release.mjs therefore printed nothing and
gh release upload received an empty release lookup ("release not found"), leaving
v0.8.0-beta.1 without a Windows build. Compare resolved paths instead, shared by
every release script that runs as a CLI.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { execFileSync as nodeExecFileSync } from "node:child_process";
|
||||
import { isMainModule } from "./is-main-module.mjs";
|
||||
|
||||
function parseJson(output) {
|
||||
return JSON.parse(output);
|
||||
@@ -67,7 +68,7 @@ function parseArgs(argv) {
|
||||
return { cleanupDuplicates, repo, tag };
|
||||
}
|
||||
|
||||
if (import.meta.url === `file://${process.argv[1]}`) {
|
||||
if (isMainModule(import.meta.url)) {
|
||||
const { cleanupDuplicates, repo, tag } = parseArgs(process.argv.slice(2));
|
||||
let release = null;
|
||||
for (let attempt = 0; attempt < 5 && !release; attempt += 1) {
|
||||
|
||||
Reference in New Issue
Block a user