Skip to content

Commit 016d857

Browse files
feat(NODE-6588): add ssdlc to zstd (#43)
1 parent bdb7dfa commit 016d857

File tree

2 files changed

+101
-68
lines changed

2 files changed

+101
-68
lines changed

.github/workflows/release.yml

Lines changed: 67 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -26,81 +26,80 @@ jobs:
2626
name: "Perform any build or bundling steps, as necessary."
2727
uses: ./.github/workflows/build.yml
2828

29-
# ssdlc:
30-
# needs: [release_please, build]
31-
# permissions:
32-
# # required for all workflows
33-
# security-events: write
34-
# id-token: write
35-
# contents: write
36-
# environment: release
37-
# runs-on: ubuntu-latest
38-
# steps:
39-
# - uses: actions/checkout@v4
29+
ssdlc:
30+
needs: [release_please, build]
31+
permissions:
32+
# required for all workflows
33+
security-events: write
34+
id-token: write
35+
contents: write
36+
environment: release
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
4040

41-
# - name: Install Node and dependencies
42-
# uses: mongodb-labs/drivers-github-tools/node/setup@v2
43-
# with:
44-
# ignore_install_scripts: true
41+
- name: Install Node and dependencies
42+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
43+
with:
44+
ignore_install_scripts: true
4545

46-
# - name: Load version and package info
47-
# uses: mongodb-labs/drivers-github-tools/node/get_version_info@v2
48-
# with:
49-
# npm_package_name: mongodb-client-encryption
46+
- name: Load version and package info
47+
uses: mongodb-labs/drivers-github-tools/node/get_version_info@v2
48+
with:
49+
npm_package_name: "@mongodb-js/zstd"
5050

51-
# - name: actions/compress_sign_and_upload
52-
# uses: mongodb-labs/drivers-github-tools/node/sign_node_package@v2
53-
# with:
54-
# aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
55-
# aws_region_name: us-east-1
56-
# aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
57-
# npm_package_name: mongodb-client-encryption
58-
# dry_run: ${{ needs.release_please.outputs.release_created == '' }}
59-
# sign_native: true
51+
- name: actions/compress_sign_and_upload
52+
uses: mongodb-labs/drivers-github-tools/node/sign_node_package@v2
53+
with:
54+
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
55+
aws_region_name: us-east-1
56+
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
57+
npm_package_name: "@mongodb-js/zstd"
58+
dry_run: ${{ needs.release_please.outputs.release_created == '' }}
59+
sign_native: true
6060

61-
# - name: Copy sbom file to release assets
62-
# shell: bash
63-
# if: ${{ 'mongodb-client-encryption-6.1' == '' }}
64-
# run: cp sbom.json ${{ env.S3_ASSETS }}/sbom.json
61+
- name: Copy sbom file to release assets
62+
shell: bash
63+
if: ${{ 'node-zstd' == '' }}
64+
run: cp sbom.json ${{ env.S3_ASSETS }}/sbom.json
6565

66-
# # only used for mongodb-client-encryption
67-
# - name: Augment SBOM and copy to release assets
68-
# if: ${{ 'mongodb-client-encryption-6.1' != '' }}
69-
# uses: mongodb-labs/drivers-github-tools/sbom@v2
70-
# with:
71-
# silk_asset_group: 'mongodb-client-encryption-6.1'
72-
# sbom_file_name: sbom.json
66+
- name: Augment SBOM and copy to release assets
67+
if: ${{ 'node-zstd' != '' }}
68+
uses: mongodb-labs/drivers-github-tools/sbom@v2
69+
with:
70+
silk_asset_group: "node-zstd"
71+
sbom_file_name: sbom.json
7372

74-
# - name: Generate authorized pub report
75-
# uses: mongodb-labs/drivers-github-tools/full-report@v2
76-
# with:
77-
# release_version: ${{ env.package_version }}
78-
# product_name: mongodb-client-encryption
79-
# sarif_report_target_ref: main
80-
# third_party_dependency_tool: n/a
81-
# dist_filenames: artifacts/*
82-
# token: ${{ github.token }}
83-
# sbom_file_name: sbom.json
73+
- name: Generate authorized pub report
74+
uses: mongodb-labs/drivers-github-tools/full-report@v2
75+
with:
76+
release_version: ${{ env.package_version }}
77+
product_name: "@mongodb-js/zstd"
78+
sarif_report_target_ref: main
79+
third_party_dependency_tool: n/a
80+
dist_filenames: artifacts/*
81+
token: ${{ github.token }}
82+
sbom_file_name: sbom.json
8483

85-
# - uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
86-
# with:
87-
# version: ${{ env.package_version }}
88-
# product_name: mongodb-client-encryption
89-
# dry_run: ${{ needs.release_please.outputs.release_created == '' }}
84+
- uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
85+
with:
86+
version: ${{ env.package_version }}
87+
product_name: "@mongodb-js/zstd"
88+
dry_run: ${{ needs.release_please.outputs.release_created == '' }}
9089

91-
# publish:
92-
# needs: [release_please, ssdlc, build]
93-
# environment: release
94-
# runs-on: ubuntu-latest
95-
# steps:
96-
# - uses: actions/checkout@v4
90+
publish:
91+
needs: [release_please, ssdlc, build]
92+
environment: release
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v4
9796

98-
# - name: Install Node and dependencies
99-
# uses: mongodb-labs/drivers-github-tools/node/setup@v2
100-
# with:
101-
# ignore_install_scripts: true
97+
- name: Install Node and dependencies
98+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
99+
with:
100+
ignore_install_scripts: true
102101

103-
# - run: npm publish --provenance
104-
# if: ${{ needs.release_please.outputs.release_created }}
105-
# env:
106-
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
102+
- run: npm publish --provenance
103+
if: ${{ needs.release_please.outputs.release_created }}
104+
env:
105+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,35 @@ Zstandard compression library for Node.js
1010
npm install @mongodb-js/zstd
1111
```
1212

13+
### Release Integrity
14+
15+
Releases are created automatically and signed using the [Node team's GPG key](https://pgp.mongodb.com/node-driver.asc). This applies to the git tag as well as all release packages provided as part of a GitHub release. To verify the provided packages, download the key and import it using gpg:
16+
17+
```
18+
gpg --import node-driver.asc
19+
```
20+
21+
The GitHub release contains a detached signature file for the NPM package (named
22+
`mongodb-js-zstd-X.Y.Z.tgz.sig`).
23+
24+
The following command returns the link npm package.
25+
```shell
26+
npm view @mongodb-js/[email protected] dist.tarball
27+
```
28+
29+
Using the result of the above command, a `curl` command can return the official npm package for the release.
30+
31+
To verify the integrity of the downloaded package, run the following command:
32+
```shell
33+
gpg --verify mongodb-js-zstd-X.Y.Z.tgz.sig mongodb-js-zstd-X.Y.Z.tgz
34+
```
35+
36+
>[!Note]
37+
No verification is done when using npm to install the package. The contents of the Github tarball and npm's tarball are identical.
38+
39+
To verify the native `.node` packages, follow the same steps as above using `mongodb-js-zstd-X.Y.Z-platform.tgz` and the corresponding `.sig` file.
40+
41+
1342
## OS Support matrix
1443

1544
| | node12 | node14 | node16 | node18 | node20 |
@@ -72,6 +101,11 @@ import { compress, decompress } from '@mongodb-js/zstd';
72101

73102
## Running Tests
74103

104+
First, install and build the zstd library:
105+
106+
`npm run install-zstd`
107+
108+
Then:
75109
`npm test`
76110

77111
## Releasing

0 commit comments

Comments
 (0)