1
+ name : Sign and Upload Package
2
+ description : ' Signs native modules with garasign'
3
+
4
+ inputs :
5
+ aws_role_arn :
6
+ description : ' AWS role input for drivers-github-tools/gpg-sign@v2'
7
+ required : true
8
+ aws_region_name :
9
+ description : ' AWS region name input for drivers-github-tools/gpg-sign@v2'
10
+ required : true
11
+ aws_secret_id :
12
+ description : ' AWS secret id input for drivers-github-tools/gpg-sign@v2'
13
+ required : true
14
+ npm_package_name :
15
+ description : ' The name for the npm package this repository represents'
16
+ required : true
17
+
18
+ runs :
19
+ using : composite
20
+ steps :
21
+ - uses : actions/download-artifact@v4
22
+
23
+ - name : Make signatures directory
24
+ shell : bash
25
+ run : mkdir artifacts
26
+
27
+ - name : Set up drivers-github-tools
28
+ uses : mongodb-labs/drivers-github-tools/setup@v2
29
+ with :
30
+ aws_region_name : ${{ inputs.aws_region_name }}
31
+ aws_role_arn : ${{ inputs.aws_role_arn }}
32
+ aws_secret_id : ${{ inputs.aws_secret_id }}
33
+
34
+ - name : Create detached signature
35
+ uses : mongodb-labs/drivers-github-tools/gpg-sign@v2
36
+ with :
37
+ filenames : ' build-*/*.tar.gz'
38
+ env :
39
+ RELEASE_ASSETS : artifacts/
40
+
41
+ - name : Copy the tarballs to the artifacts directory
42
+ shell : bash
43
+ run : for filename in build-*/*.tar.gz; do cp ${filename} artifacts/; done
44
+
45
+ - run : npm pack
46
+ shell : bash
47
+
48
+ - name : Get release version and release package file name
49
+ id : get_vars
50
+ shell : bash
51
+ run : |
52
+ package_version=$(jq --raw-output '.version' package.json)
53
+ echo "package_version=${package_version}" >> "$GITHUB_OUTPUT"
54
+ echo "package_file=${{ inputs.npm_package_name }}-${package_version}.tgz" >> "$GITHUB_OUTPUT"
55
+
56
+ - name : Create detached signature for module
57
+ uses : mongodb-labs/drivers-github-tools/gpg-sign@v2
58
+ with :
59
+ filenames : ${{ steps.get_vars.outputs.package_file }}
60
+ env :
61
+ RELEASE_ASSETS : artifacts/
62
+
63
+ - name : Display structure of downloaded files
64
+ shell : bash
65
+ run : ls -la artifacts/
66
+
67
+ - name : " Upload release artifacts"
68
+ run : gh release upload v${{ steps.get_vars.outputs.package_version }} artifacts/*.*
69
+ shell : bash
70
+ env :
71
+ GH_TOKEN : ${{ github.token }}
0 commit comments