2828 description : " Upload build output GitHub artifact (for local output)"
2929 required : false
3030 default : false
31+ artifact-merge :
32+ type : boolean
33+ description : " Merge output for multi-platforms build into a single artifact (for local output)"
34+ required : false
35+ default : true
3136 annotations :
3237 type : string
3338 description : " List of annotations to set to the image (for image output)"
141146 artifact-name :
142147 description : " Name of the uploaded artifact (for local output)"
143148 value : ${{ jobs.finalize.outputs.artifact-name }}
149+ artifact-merge :
150+ description : " Whether multiple artifacts were merged (for local output)"
151+ value : ${{ jobs.finalize.outputs.artifact-merge }}
144152 output-type :
145153 description : " Build output type"
146154 value : ${{ jobs.finalize.outputs.output-type }}
@@ -497,6 +505,7 @@ jobs:
497505 INPUT_SBOM-IMAGE : ${{ env.SBOM_IMAGE }}
498506 INPUT_LOCAL-EXPORT-DIR : ${{ env.LOCAL_EXPORT_DIR }}
499507 INPUT_DISTRIBUTE : ${{ inputs.distribute }}
508+ INPUT_ARTIFACT-MERGE : ${{ inputs.artifact-merge }}
500509 INPUT_ANNOTATIONS : ${{ inputs.annotations }}
501510 INPUT_CACHE : ${{ inputs.cache }}
502511 INPUT_CACHE-SCOPE : ${{ inputs.cache-scope }}
@@ -519,11 +528,11 @@ jobs:
519528
520529 const inpPlatform = core.getInput('platform');
521530 const platformPairSuffix = inpPlatform ? `-${inpPlatform.replace(/\//g, '-')}` : '';
522- core.setOutput('platform-pair-suffix', platformPairSuffix);
523531
524532 const inpSbomImage = core.getInput('sbom-image');
525533 const inpLocalExportDir = core.getInput('local-export-dir');
526534 const inpDistribute = core.getBooleanInput('distribute');
535+ const inpArtifactMerge = core.getBooleanInput('artifact-merge');
527536
528537 const inpAnnotations = core.getMultilineInput('annotations');
529538 const inpCache = core.getBooleanInput('cache');
@@ -546,6 +555,12 @@ jobs:
546555 const buildContext = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}.git#${process.env.GITHUB_REF}:${inpContext}`;
547556 core.setOutput('context', buildContext);
548557
558+ if (platformPairSuffix) {
559+ core.setOutput('artifact-suffix', platformPairSuffix);
560+ } else if (inpArtifactMerge) {
561+ core.setOutput('artifact-suffix', '0');
562+ }
563+
549564 switch (inpOutput) {
550565 case 'image':
551566 if (inpMetaImages.length == 0) {
@@ -717,7 +732,7 @@ jobs:
717732 if : ${{ inputs.output == 'local' && inputs.artifact-upload }}
718733 uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
719734 with :
720- name : ${{ inputs.artifact-name }}${{ steps.prepare.outputs.platform-pair- suffix || '0' }}
735+ name : ${{ inputs.artifact-name }}${{ steps.prepare.outputs.artifact- suffix }}
721736 path : ${{ env.LOCAL_EXPORT_DIR }}
722737 if-no-files-found : error
723738 -
@@ -728,22 +743,17 @@ jobs:
728743 INPUT_INDEX : ${{ matrix.index }}
729744 INPUT_VERIFY-COMMANDS : ${{ steps.signing-attestation-manifests.outputs.verify-commands || steps.signing-local-artifacts.outputs.verify-commands }}
730745 INPUT_IMAGE-DIGEST : ${{ steps.build.outputs.digest }}
731- INPUT_ARTIFACT-NAME : ${{ inputs.artifact-name }}${{ steps.prepare.outputs.platform-pair-suffix }}
732- INPUT_ARTIFACT-UPLOAD : ${{ inputs.artifact-upload }}
733746 INPUT_SIGNED : ${{ needs.prepare.outputs.sign }}
734747 with :
735748 script : |
736749 const inpIndex = core.getInput('index');
737750 const inpVerifyCommands = core.getInput('verify-commands');
738751 const inpImageDigest = core.getInput('image-digest');
739- const inpArtifactName = core.getInput('artifact-name');
740- const inpArtifactUpload = core.getBooleanInput('artifact-upload');
741752 const inpSigned = core.getBooleanInput('signed');
742753
743754 const result = {
744755 verifyCommands: inpVerifyCommands,
745756 imageDigest: inpImageDigest,
746- artifactName: inpArtifactUpload ? inpArtifactName : '',
747757 signed: inpSigned
748758 }
749759 core.info(JSON.stringify(result, null, 2));
@@ -757,6 +767,7 @@ jobs:
757767 cosign-version : ${{ env.COSIGN_VERSION }}
758768 cosign-verify-commands : ${{ steps.set.outputs.cosign-verify-commands }}
759769 artifact-name : ${{ inputs.artifact-upload && inputs.artifact-name || '' }}
770+ artifact-merge : ${{ inputs.artifact-merge }}
760771 output-type : ${{ inputs.output }}
761772 signed : ${{ needs.prepare.outputs.sign }}
762773 needs :
@@ -837,7 +848,7 @@ jobs:
837848 }
838849 -
839850 name : Merge artifacts
840- if : ${{ inputs.output == 'local' && inputs.artifact-upload }}
851+ if : ${{ inputs.output == 'local' && inputs.artifact-upload && inputs.artifact-merge }}
841852 uses : actions/upload-artifact/merge@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
842853 with :
843854 name : ${{ inputs.artifact-name }}
0 commit comments