Skip to content

Commit

Permalink
Merge pull request #291 from zowe/user/markackert/sigstore-bundles
Browse files Browse the repository at this point in the history
create sigstore signature for cli bundles
  • Loading branch information
MarkAckert authored Oct 3, 2024
2 parents d20c502 + d12e7a7 commit 07dfd5c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/zowe-cli-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
pull-requests: write
steps:
- name: Checkout
Expand Down Expand Up @@ -164,6 +165,16 @@ jobs:
name: 'zowe-cli-bundle_${{ inputs.package-tag }}'
path: '*.zip'

- name: Sigstore sign bundles
uses: zowe-actions/shared-actions/sigstore-sign-artifacts@main
with:
artifacts: |
zowe-cli-package-${{ env.BUNDLE_VERSION }}.zip
zowe-cli-plugins-${{ env.BUNDLE_VERSION }}.zip
zowe-nodejs-sdk*-${{ env.BUNDLE_VERSION }}.zip
zowe-python-sdk*-${{ env.BUNDLE_VERSION }}.zip
# prepare-upload attachs the sigstore bundles as well
- name: Add Bundles to Spec
run: |
node scripts/prepare-upload.js "zowe-cli-package-${{ env.BUNDLE_VERSION }}.zip" \
Expand Down
6 changes: 6 additions & 0 deletions scripts/prepare-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ if (fs.existsSync(uploadSpecFile)) {
uploadSpecJson = jsonfile.readFileSync(uploadSpecFile);
}
uploadSpecJson.files.push({ pattern: sourcePath, target: targetPath });

// check for an associated sigstore signature, in case of wildcard let jfrog cli find it
if (fs.existsSync(`${sourcePath}.bundle`) || sourcePath.includes('*')) {
uploadSpecJson.files.push({ pattern: `${sourcePath}.bundle`, target: targetPath})
}

jsonfile.writeFileSync(uploadSpecFile, uploadSpecJson, { spaces: 4 });

if (!fs.existsSync(summaryFile)) {
Expand Down

0 comments on commit 07dfd5c

Please sign in to comment.