Skip to content

Commit

Permalink
wip: bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
ManasJayanth committed May 20, 2024
1 parent 444f3af commit baf273e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
20 changes: 20 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ inputs:
Runs a steps that prepare artifacts for release the app to NPM. These
artifacts are later used by, `prepare-x-plat-npm-tarball-mode`
required: false
artifact-ids:
description:
Provide IDs of artifacts created in the prepare-npm-artifacts-mode step.
Accepts an array
outputs:
darwin-arm64:
description:
Artifact IDs of the tarball darwin-arm64 created by
prepare-npm-artifacts-mode
darwin-x64:
description:
Artifact ID of the darwin-x64 tarball created by
prepare-npm-artifacts-mode
linux-x64:
description:
Artifact ID of the linux-x64 tarball created by prepare-npm-artifacts-mode
windows-x64:
description:
Artifact ID of the windows-x64 tarball created by
prepare-npm-artifacts-mode
runs:
using: node20
main: dist/index.js
Expand Down
9 changes: 9 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180739,6 +180739,8 @@ const cacheKey = core.getInput("cache-key");
const sourceCacheKey = core.getInput("source-cache-key");
const manifestKey = core.getInput("manifest");
const prepareNPMArtifactsMode = core.getInput("prepare-npm-artifacts-mode");
const bundleNPMArtifactsMode = core.getInput("bundle-npm-artifacts-mode");
const artifactIDs = core.getInput("artifact-ids");
function run(name, command, args) {
return __awaiter(this, void 0, void 0, function* () {
const PATH = process.env.PATH ? process.env.PATH : "";
Expand Down Expand Up @@ -180842,6 +180844,7 @@ function prepareNPMArtifacts() {
// if unspecified, defaults to repository/org retention settings (the limit of this value)
retentionDays: 10,
});
core.setOutput(`${index_platform}-${arch}`, `${id}`);
console.log(`Created artifact with id: ${id} (bytes: ${size}`);
}
catch (error) {
Expand All @@ -180854,9 +180857,15 @@ function prepareNPMArtifacts() {
}
});
}
function bundleNPMArtifacts() {
console.log(artifactIDs);
}
if (prepareNPMArtifactsMode) {
prepareNPMArtifacts();
}
else if (bundleNPMArtifactsMode) {
bundleNPMArtifacts();
}
else {
main();
}
Expand Down
9 changes: 9 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const cacheKey = core.getInput("cache-key");
const sourceCacheKey = core.getInput("source-cache-key");
const manifestKey = core.getInput("manifest");
const prepareNPMArtifactsMode = core.getInput("prepare-npm-artifacts-mode");
const bundleNPMArtifactsMode = core.getInput("bundle-npm-artifacts-mode");
const artifactIDs = core.getInput("artifact-ids");

async function run(name: string, command: string, args: string[]) {
const PATH = process.env.PATH ? process.env.PATH : "";
Expand Down Expand Up @@ -146,6 +148,7 @@ async function prepareNPMArtifacts() {
}
);

core.setOutput(`${platform}-${arch}`, `${id}`);
console.log(`Created artifact with id: ${id} (bytes: ${size}`);
} catch (error) {
if (error instanceof Error) {
Expand All @@ -156,8 +159,14 @@ async function prepareNPMArtifacts() {
}
}

function bundleNPMArtifacts() {
console.log(artifactIDs);
}

if (prepareNPMArtifactsMode) {
prepareNPMArtifacts();
} else if (bundleNPMArtifactsMode) {
bundleNPMArtifacts();
} else {
main();
}

0 comments on commit baf273e

Please sign in to comment.