Skip to content

Commit baf273e

Browse files
committed
wip: bundle
1 parent 444f3af commit baf273e

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

action.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,26 @@ inputs:
2121
Runs a steps that prepare artifacts for release the app to NPM. These
2222
artifacts are later used by, `prepare-x-plat-npm-tarball-mode`
2323
required: false
24+
artifact-ids:
25+
description:
26+
Provide IDs of artifacts created in the prepare-npm-artifacts-mode step.
27+
Accepts an array
28+
outputs:
29+
darwin-arm64:
30+
description:
31+
Artifact IDs of the tarball darwin-arm64 created by
32+
prepare-npm-artifacts-mode
33+
darwin-x64:
34+
description:
35+
Artifact ID of the darwin-x64 tarball created by
36+
prepare-npm-artifacts-mode
37+
linux-x64:
38+
description:
39+
Artifact ID of the linux-x64 tarball created by prepare-npm-artifacts-mode
40+
windows-x64:
41+
description:
42+
Artifact ID of the windows-x64 tarball created by
43+
prepare-npm-artifacts-mode
2444
runs:
2545
using: node20
2646
main: dist/index.js

dist/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180739,6 +180739,8 @@ const cacheKey = core.getInput("cache-key");
180739180739
const sourceCacheKey = core.getInput("source-cache-key");
180740180740
const manifestKey = core.getInput("manifest");
180741180741
const prepareNPMArtifactsMode = core.getInput("prepare-npm-artifacts-mode");
180742+
const bundleNPMArtifactsMode = core.getInput("bundle-npm-artifacts-mode");
180743+
const artifactIDs = core.getInput("artifact-ids");
180742180744
function run(name, command, args) {
180743180745
return __awaiter(this, void 0, void 0, function* () {
180744180746
const PATH = process.env.PATH ? process.env.PATH : "";
@@ -180842,6 +180844,7 @@ function prepareNPMArtifacts() {
180842180844
// if unspecified, defaults to repository/org retention settings (the limit of this value)
180843180845
retentionDays: 10,
180844180846
});
180847+
core.setOutput(`${index_platform}-${arch}`, `${id}`);
180845180848
console.log(`Created artifact with id: ${id} (bytes: ${size}`);
180846180849
}
180847180850
catch (error) {
@@ -180854,9 +180857,15 @@ function prepareNPMArtifacts() {
180854180857
}
180855180858
});
180856180859
}
180860+
function bundleNPMArtifacts() {
180861+
console.log(artifactIDs);
180862+
}
180857180863
if (prepareNPMArtifactsMode) {
180858180864
prepareNPMArtifacts();
180859180865
}
180866+
else if (bundleNPMArtifactsMode) {
180867+
bundleNPMArtifacts();
180868+
}
180860180869
else {
180861180870
main();
180862180871
}

index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const cacheKey = core.getInput("cache-key");
1515
const sourceCacheKey = core.getInput("source-cache-key");
1616
const manifestKey = core.getInput("manifest");
1717
const prepareNPMArtifactsMode = core.getInput("prepare-npm-artifacts-mode");
18+
const bundleNPMArtifactsMode = core.getInput("bundle-npm-artifacts-mode");
19+
const artifactIDs = core.getInput("artifact-ids");
1820

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

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

162+
function bundleNPMArtifacts() {
163+
console.log(artifactIDs);
164+
}
165+
159166
if (prepareNPMArtifactsMode) {
160167
prepareNPMArtifacts();
168+
} else if (bundleNPMArtifactsMode) {
169+
bundleNPMArtifacts();
161170
} else {
162171
main();
163172
}

0 commit comments

Comments
 (0)