@@ -446,20 +446,21 @@ function pushArtifactToOCI(repositoryOwner, version, featureName, artifactPath)
446446 return __awaiter(this, void 0, void 0, function* () {
447447 const exec = (0, util_1.promisify)(child_process.exec);
448448 const versions = [version, '1.0', '1']; // TODO: don't hardcode ofc.
449- for (const v in versions) {
449+ yield Promise.all(versions.map((v) => __awaiter(this, void 0, void 0, function* () {
450+ core.info(`Starting to push artifact (tag ${v}) to OCI...`);
450451 const ociRepo = `${repositoryOwner}/${featureName}:${v}`;
451452 try {
452453 const cmd = `oras push ghcr.io/${ociRepo} \
453- --manifest-config /dev/null:application/vnd.devcontainers \
454- ./${artifactPath}:application/vnd.devcontainers.layer.v1+tar`;
454+ --manifest-config /dev/null:application/vnd.devcontainers \
455+ ./${artifactPath}:application/vnd.devcontainers.layer.v1+tar`;
455456 yield exec(cmd);
456- console.log (`Pushed artifact to '${ociRepo}'`);
457+ core.info (`Pushed artifact to '${ociRepo}'`);
457458 }
458459 catch (error) {
459460 if (error instanceof Error)
460461 core.setFailed(`Failed to push '${ociRepo}': ${error.message}`);
461462 }
462- }
463+ })));
463464 });
464465}
465466function loginToGHCR() {
@@ -487,6 +488,9 @@ function getFeaturesAndPackage(basePath, opts) {
487488 const featureDirs = fs.readdirSync(basePath);
488489 let metadatas = [];
489490 const exec = (0, util_1.promisify)(child_process.exec);
491+ if (shouldPublishToOCI) {
492+ yield loginToGHCR();
493+ }
490494 yield Promise.all(featureDirs.map((f) => __awaiter(this, void 0, void 0, function* () {
491495 var _a;
492496 core.info(`feature ==> ${f}`);
@@ -518,7 +522,6 @@ function getFeaturesAndPackage(basePath, opts) {
518522 // ---- PUBLISH TO NPM ----
519523 if (shouldPublishToOCI) {
520524 core.info(`** Publishing to OCI`);
521- yield loginToGHCR();
522525 yield pushArtifactToOCI(sourceInfo.owner, featureMetadata.version, f, archiveName);
523526 }
524527 // ---- TAG INDIVIDUAL FEATURES ----
0 commit comments