1
1
name : Compress, Sign and Upload to GH Release
2
2
description : ' Compresses package and signs with garasign and uploads to GH release'
3
3
4
- inputs :
4
+ inputs :
5
5
aws_role_arn :
6
6
description : ' AWS role input for drivers-github-tools/gpg-sign@v2'
7
7
required : true
@@ -12,45 +12,80 @@ inputs:
12
12
description : ' AWS secret id input for drivers-github-tools/gpg-sign@v2'
13
13
required : true
14
14
npm_package_name :
15
- description : the npm package name
15
+ description : ' The name for the npm package this repository represents '
16
16
required : true
17
17
dry_run :
18
18
description : ' Should we upload files to the release?'
19
19
required : false
20
20
default : ' true'
21
+ artifact_directory :
22
+ description : The directory in which to output signatures.
23
+ required : true
24
+ sign_native :
25
+ description : Download and sign native packages
26
+ default : " false"
21
27
22
28
runs :
23
29
using : composite
24
30
steps :
31
+ - uses : actions/download-artifact@v4
32
+ if : ${{ inputs.sign_native == 'true' }}
33
+
25
34
- run : npm pack
26
35
shell : bash
27
36
28
- - name : Determine version and package info
37
+ - name : Make signatures directory
38
+ shell : bash
39
+ run : mkdir ${{ inputs.artifact_directory }}
40
+
41
+ - name : Load version and package info
29
42
uses : baileympearson/drivers-github-tools/node/get_version_info@add-signing-env-action-for-node
30
43
with :
31
44
npm_package_name : ${{ inputs.npm_package_name }}
32
45
33
46
- name : Set up drivers-github-tools
34
47
uses : mongodb-labs/drivers-github-tools/setup@v2
35
- with :
48
+ with :
36
49
aws_region_name : ${{ inputs.aws_region_name }}
37
50
aws_role_arn : ${{ inputs.aws_role_arn }}
38
51
aws_secret_id : ${{ inputs.aws_secret_id }}
39
52
53
+ - name : Determine what files to sign
54
+ if : ${{ inputs.sign_native == 'true' }}
55
+ shell : bash
56
+ run : |
57
+ FILENAMES="build-*/*.tar.gz"
58
+ if [[ $FILENAMES =~ '*' ]]; then
59
+ FILENAMES=$(ls $FILENAMES | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g')
60
+ fi
61
+ FILENAMES="$FILENAMES ${{ env.package_file }}"
62
+ echo "FILES_TO_SIGN=${FILENAMES}" >> "$GITHUB_ENV"
63
+
64
+ - name : Determine what files to sign
65
+ if : ${{ inputs.sign_native != 'true' }}
66
+ shell : bash
67
+ run : |
68
+ FILENAMES="${{ env.package_file }}"
69
+ echo "FILES_TO_SIGN=${FILENAMES}" >> "$GITHUB_ENV"
70
+
40
71
- name : Create detached signature
41
- uses : mongodb-labs/drivers-github-tools/gpg-sign@v2
42
- with :
43
- filenames : ${{ env.package_file }}
44
- env :
45
- RELEASE_ASSETS : ${{ env.package_file }}.temp.sig
72
+ uses : baileympearson/drivers-github-tools/gpg-sign@add-signing-env-action-for-node
73
+ with :
74
+ filenames : ${{ env.FILES_TO_SIGN }}
75
+ env :
76
+ RELEASE_ASSETS : ${{ inputs.artifact_directory }}
77
+
78
+ - name : Copy the tarballs to the artifacts directory
79
+ shell : bash
80
+ run : for filename in ${{ env.FILES_TO_SIGN }}; do cp ${filename} artifacts/; done
46
81
47
- - name : Name release asset correctly
48
- run : mv ${{ env.package_file }}.temp.sig ${{ env.package_file }}.sig
82
+ - name : Display structure of downloaded files
49
83
shell : bash
84
+ run : ls -la artifacts/
50
85
51
86
- name : " Upload release artifacts"
52
87
if : ${{ inputs.dry_run == false }}
53
- run : gh release upload v${{ env.package_version }} ${{ env.package_file }}.sig
88
+ run : gh release upload v${{ env.package_version }} artifacts/*.*
54
89
shell : bash
55
90
env :
56
- GH_TOKEN : ${{ github.token }}
91
+ GH_TOKEN : ${{ github.token }}
0 commit comments