File tree Expand file tree Collapse file tree 3 files changed +91
-8
lines changed
actions/compress_sign_and_upload Expand file tree Collapse file tree 3 files changed +91
-8
lines changed Original file line number Diff line number Diff line change
1
+ name : Compress and Sign
2
+ description : ' Compresses package and signs 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
+ - run : npm pack
22
+ shell : bash
23
+
24
+ - name : Get release version and release package file name
25
+ id : get_vars
26
+ shell : bash
27
+ run : |
28
+ package_version=$(jq --raw-output '.version' package.json)
29
+ echo "package_version=${package_version}" >> "$GITHUB_OUTPUT"
30
+ echo "package_file=${{ inputs.npm_package_name }}-${package_version}.tgz" >> "$GITHUB_OUTPUT"
31
+
32
+ - name : Set up drivers-github-tools
33
+ uses : mongodb-labs/drivers-github-tools/setup@v2
34
+ with :
35
+ aws_region_name : ${{ inputs.aws_region_name }}
36
+ aws_role_arn : ${{ inputs.aws_role_arn }}
37
+ aws_secret_id : ${{ inputs.aws_secret_id }}
38
+
39
+ - name : Create detached signature
40
+ uses : mongodb-labs/drivers-github-tools/gpg-sign@v2
41
+ with :
42
+ filenames : ${{ steps.get_vars.outputs.package_file }}
43
+ env :
44
+ RELEASE_ASSETS : ${{ steps.get_vars.outputs.package_file }}.temp.sig
45
+
46
+ - name : Name release asset correctly
47
+ run : mv ${{ steps.get_vars.outputs.package_file }}.temp.sig ${{ steps.get_vars.outputs.package_file }}.sig
48
+ shell : bash
49
+
50
+ - name : " Upload release artifacts"
51
+ run : gh release upload v${{ steps.get_vars.outputs.package_version }} ${{ steps.get_vars.outputs.package_file }}.sig
52
+ shell : bash
53
+ env :
54
+ GH_TOKEN : ${{ github.token }}
Original file line number Diff line number Diff line change @@ -11,19 +11,30 @@ permissions:
11
11
name : release
12
12
13
13
jobs :
14
- release-please :
14
+ release_please :
15
15
runs-on : ubuntu-latest
16
+ outputs :
17
+ release_created : ${{ steps.release.outputs.release_created }}
16
18
steps :
17
19
- id : release
18
20
uses : googleapis/release-please-action@v4
19
21
20
- # If release-please created a release, publish to npm
21
- - if : ${{ steps.release.outputs.release_created }}
22
- uses : actions/checkout@v4
23
- - if : ${{ steps.release.outputs.release_created }}
24
- name : actions/setup
22
+ compress_sign_and_upload :
23
+ needs : [release_please]
24
+ if : ${{ needs.release_please.outputs.release_created }}
25
+ environment : release
26
+ runs-on : ubuntu-latest
27
+ steps :
28
+ - uses : actions/checkout@v4
29
+ - name : actions/setup
25
30
uses : ./.github/actions/setup
26
- - if : ${{ steps.release.outputs.release_created }}
27
- run : npm publish --provenance
31
+ - name : actions/compress_sign_and_upload
32
+ uses : ./.github/actions/compress_sign_and_upload
33
+ with :
34
+ aws_role_arn : ${{ secrets.AWS_ROLE_ARN }}
35
+ aws_region_name : ' us-east-1'
36
+ aws_secret_id : ${{ secrets.AWS_SECRET_ID }}
37
+ npm_package_name : ' mongodb-legacy'
38
+ - run : npm publish --provenance
28
39
env :
29
40
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change @@ -62,6 +62,24 @@ In your existing project add `mongodb-legacy` to your `package.json` with the fo
62
62
npm install mongodb-legacy
63
63
```
64
64
65
+
66
+ ### Release Integrity
67
+
68
+ The GitHub release contains a detached signature file for the NPM package (named
69
+ ` mongodb-legacy-X.Y.Z.tgz.sig ` ).
70
+
71
+ The following command returns the link npm package.
72
+ ``` shell
73
+ npm view
[email protected] dist.tarball
74
+ ```
75
+
76
+ Using the result of the above command, a ` curl ` command can return the official npm package for the release.
77
+
78
+ To verify the integrity of the downloaded package, run the following command:
79
+ ``` shell
80
+ gpg --verify mongodb-legacy-X.Y.Z.tgz.sig mongodb-legacy-X.Y.Z.tgz
81
+ ```
82
+
65
83
### Versioning
66
84
67
85
We recommend replacing your ` mongodb ` dependency with this one.
You can’t perform that action at this time.
0 commit comments