Skip to content

Commit f934e4d

Browse files
sign files
1 parent b4af849 commit f934e4d

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

.github/actions/sign_and_upload_package/action.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ inputs:
1818
description: 'Should we upload files to the release?'
1919
required: false
2020
default: 'true'
21-
filenames:
22-
description: The files to sign.
23-
required: true
2421
artifact_directory:
2522
description: The directory in which to output signatures.
2623
required: true
@@ -29,6 +26,7 @@ runs:
2926
using: composite
3027
steps:
3128
- uses: actions/download-artifact@v4
29+
if: ${{ always() }}
3230

3331
- run: npm pack
3432
shell: bash
@@ -49,16 +47,30 @@ runs:
4947
aws_role_arn: ${{ inputs.aws_role_arn }}
5048
aws_secret_id: ${{ inputs.aws_secret_id }}
5149

50+
- name: Determine what files to sign
51+
if: ${{ always() }}
52+
shell: bash
53+
run: |
54+
export FILENAMES=build-*/*.tar.gz
55+
if [[ $FILENAMES =~ '*' ]]; then
56+
FILENAMES=$(ls $FILENAMES | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g')
57+
fi
58+
FILENAMES="$FILENAMES ${{ env.package_file }}"
59+
echo "FILES FILES"
60+
echo $FILENAMES
61+
echo "FILES_TO_SIGN=${FILENAMES}" >> "$GITHUB_ENV"
62+
63+
5264
- name: Create detached signature
5365
uses: mongodb-labs/drivers-github-tools/gpg-sign@v2
5466
with:
55-
filenames: ${{ inputs.filenames }}
67+
filenames: ${{ env.FILES_TO_SIGN }}
5668
env:
5769
RELEASE_ASSETS: ${{ inputs.artifact_directory }}
5870

5971
- name: Copy the tarballs to the artifacts directory
6072
shell: bash
61-
run: for filename in ${{ inputs.filenames }}; do cp ${filename} artifacts/; done
73+
run: for filename in ${{ env.FILES_TO_SIGN }}; do cp ${filename} artifacts/; done
6274

6375
- name: Display structure of downloaded files
6476
shell: bash

.github/workflows/release.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,6 @@ jobs:
4646
with:
4747
npm_package_name: mongodb-client-encryption
4848

49-
- uses: actions/download-artifact@v4
50-
- run: |
51-
# export FILENAMES=build-*/*.tar.gz
52-
# if [[ $FILENAMES =~ '*' ]]; then
53-
# FILENAMES=$(ls $FILENAMES | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g')
54-
# fi
55-
FILENAMES=find build-*/*.tar.gz -name '*'
56-
FILENAMES="$FILENAMES ${{ env.package_file }}"
57-
echo "FILES FILES"
58-
echo $FILENAMES
59-
echo "FILES_TO_SIGN=${FILENAMES}" >> "$GITHUB_ENV"
60-
shell: bash
61-
6249
- name: actions/sign_and_upload_package
6350
uses: ./.github/actions/sign_and_upload_package
6451
with:
@@ -67,7 +54,6 @@ jobs:
6754
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
6855
npm_package_name: 'mongodb-client-encryption'
6956
dry_run: ${{ needs.release_please.outputs.release_created == '' }}
70-
filenames: ${{ env.FILES_TO_SIGN }}
7157
artifact_directory: artifacts
7258

7359
- name: Copy sbom file to release assets

0 commit comments

Comments
 (0)