Skip to content

Commit 11eadb4

Browse files
committed
wip
1 parent 09d4f0c commit 11eadb4

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

dist/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176186,11 +176186,11 @@ function prepareNPMArtifacts() {
176186176186
}
176187176187
function bundleNPMArtifacts() {
176188176188
return __awaiter(this, void 0, void 0, function* () {
176189-
const releaseFolder = "_npm-release";
176190-
external_fs_.mkdirSync(releaseFolder);
176191176189
const workingDirectory = core.getInput("working-directory") || process.cwd();
176192176190
external_fs_.statSync(workingDirectory);
176193176191
process.chdir(workingDirectory);
176192+
const releaseFolder = external_path_.join(workingDirectory, "_npm-release");
176193+
external_fs_.mkdirSync(releaseFolder);
176194176194
const { artifacts } = yield artifact_default().listArtifacts();
176195176195
const artifactFoldersList = yield Promise.all(artifacts.map((a) => __awaiter(this, void 0, void 0, function* () {
176196176196
const folderName = `platform-${a.name}`;
@@ -176245,20 +176245,20 @@ function bundleNPMArtifacts() {
176245176245
"esyInstallRelease.js",
176246176246
].concat(artifactFolders),
176247176247
}, null, 2);
176248-
external_fs_.writeFileSync(external_path_.join(__dirname, "..", "_release", "package.json"), packageJson, {
176248+
external_fs_.writeFileSync(external_path_.join(releaseFolder, "package.json"), packageJson, {
176249176249
encoding: "utf8",
176250176250
});
176251176251
try {
176252176252
console.log("Copying LICENSE");
176253-
external_fs_.copyFileSync(external_path_.join("LICENSE"), external_path_.join(releaseFolder, "LICENSE"));
176253+
external_fs_.copyFileSync(external_path_.join(workingDirectory, "LICENSE"), external_path_.join(releaseFolder, "LICENSE"));
176254176254
}
176255176255
catch (e) {
176256176256
console.warn("No LICENSE found");
176257176257
}
176258176258
console.log("Copying README.md");
176259-
external_fs_.copyFileSync(external_path_.join("README.md"), external_path_.join(releaseFolder, "_release", "README.md"));
176259+
external_fs_.copyFileSync(external_path_.join(workingDirectory, "README.md"), external_path_.join(releaseFolder, "README.md"));
176260176260
console.log("Copying postinstall.js");
176261-
external_fs_.copyFileSync(external_path_.join("release-postinstall.js"), external_path_.join(releaseFolder, "postinstall.js"));
176261+
external_fs_.copyFileSync(external_path_.join(workingDirectory, "release-postinstall.js"), external_path_.join(releaseFolder, "postinstall.js"));
176262176262
console.log("Creating placeholder files");
176263176263
const placeholderFile = `:; echo "You need to have postinstall enabled"; exit $?
176264176264
@ECHO OFF
@@ -176276,7 +176276,7 @@ ECHO You need to have postinstall enabled`;
176276176276
}
176277176277
});
176278176278
let tarFile = `npm-release.tgz`;
176279-
yield compress("_release", tarFile);
176279+
yield compress(releaseFolder, tarFile);
176280176280
yield artifact_default().uploadArtifact("npm-release", [tarFile], process.env.GITHUB_WORKSPACE, {
176281176281
// The level of compression for Zlib to be applied to the artifact archive.
176282176282
// - 0: No compression

index.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ async function prepareNPMArtifacts() {
153153
}
154154

155155
async function bundleNPMArtifacts() {
156-
const releaseFolder = "_npm-release";
157-
fs.mkdirSync(releaseFolder);
158156
const workingDirectory = core.getInput("working-directory") || process.cwd();
159157
fs.statSync(workingDirectory);
160158
process.chdir(workingDirectory);
159+
const releaseFolder = path.join(workingDirectory, "_npm-release");
160+
fs.mkdirSync(releaseFolder);
161161
const { artifacts } = await artifact.listArtifacts();
162162
const artifactFoldersList = await Promise.all(
163163
artifacts.map(async (a: Artifact) => {
@@ -237,30 +237,29 @@ async function bundleNPMArtifacts() {
237237
2
238238
);
239239

240-
fs.writeFileSync(
241-
path.join(__dirname, "..", "_release", "package.json"),
242-
packageJson,
243-
{
244-
encoding: "utf8",
245-
}
246-
);
240+
fs.writeFileSync(path.join(releaseFolder, "package.json"), packageJson, {
241+
encoding: "utf8",
242+
});
247243

248244
try {
249245
console.log("Copying LICENSE");
250-
fs.copyFileSync(path.join("LICENSE"), path.join(releaseFolder, "LICENSE"));
246+
fs.copyFileSync(
247+
path.join(workingDirectory, "LICENSE"),
248+
path.join(releaseFolder, "LICENSE")
249+
);
251250
} catch (e) {
252251
console.warn("No LICENSE found");
253252
}
254253

255254
console.log("Copying README.md");
256255
fs.copyFileSync(
257-
path.join("README.md"),
258-
path.join(releaseFolder, "_release", "README.md")
256+
path.join(workingDirectory, "README.md"),
257+
path.join(releaseFolder, "README.md")
259258
);
260259

261260
console.log("Copying postinstall.js");
262261
fs.copyFileSync(
263-
path.join("release-postinstall.js"),
262+
path.join(workingDirectory, "release-postinstall.js"),
264263
path.join(releaseFolder, "postinstall.js")
265264
);
266265

@@ -282,7 +281,7 @@ ECHO You need to have postinstall enabled`;
282281
});
283282

284283
let tarFile = `npm-release.tgz`;
285-
await compress("_release", tarFile);
284+
await compress(releaseFolder, tarFile);
286285

287286
await artifact.uploadArtifact(
288287
"npm-release",

0 commit comments

Comments
 (0)