Skip to content

Commit 5ec93cc

Browse files
copied over changes
1 parent 652af8d commit 5ec93cc

File tree

4 files changed

+98
-19
lines changed

4 files changed

+98
-19
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Compress and Sign
2+
description: 'Compresses package and signs with garasign'
3+
4+
inputs:
5+
garasign_username:
6+
description: 'Garasign username input for drivers-github-tools/garasign/gpg-sign'
7+
required: true
8+
garasign_password:
9+
description: 'Garasign password input for drivers-github-tools/garasign/gpg-sign'
10+
required: true
11+
artifactory_username:
12+
description: 'Artifactory username input for drivers-github-tools/garasign/gpg-sign'
13+
required: true
14+
artifactory_password:
15+
description: 'Artifactory password input for drivers-github-tools/garasign/gpg-sign'
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: 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=mongodb-${package_version}.tgz" >> "$GITHUB_OUTPUT"
31+
- name: Create detached signature
32+
uses: mongodb-labs/drivers-github-tools/garasign/gpg-sign@v1
33+
with:
34+
filenames: ${{ steps.vars.package_file }}
35+
garasign_username: ${{ inputs.garasign_username }}
36+
garasign_password: ${{ inputs.garasign_password }}
37+
artifactory_username: ${{ inputs.artifactory_username }}
38+
artifactory_password: ${{ inputs.artifactory_password }}
39+
40+
- name: "Upload release artifacts"
41+
run: gh release upload v${{ steps.vars.package_version }} ${{ steps.vars.package_file }}.sig
42+
shell: bash

.github/workflows/release-5.x.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,30 @@ permissions:
1111
name: release-5x
1212

1313
jobs:
14-
release-please:
14+
release_please:
1515
runs-on: ubuntu-latest
16+
outputs:
17+
release_created: ${{ steps.release.outputs.release_created }}
1618
steps:
1719
- id: release
1820
uses: google-github-actions/release-please-action@v4
1921
with:
2022
target-branch: 5.x
21-
22-
# If release-please created a release, publish to npm
23-
- if: ${{ steps.release.outputs.release_created }}
24-
uses: actions/checkout@v4
25-
- if: ${{ steps.release.outputs.release_created }}
26-
name: actions/setup
23+
24+
compress-sign-and-upload:
25+
needs: [release_please]
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: actions/setup
2730
uses: ./.github/actions/setup
28-
- if: ${{ steps.release.outputs.release_created }}
29-
run: npm publish --provenance --tag=5x
31+
- name: actions/compress_sign_and_upload
32+
uses: ./.github/actions/compress_sign_and_upload
33+
with:
34+
garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
35+
garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
36+
artifactory_username: ${{ secrets.ARTIFACTORY_USER }}
37+
artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }}
38+
- run: npm publish --provenance --tag=5x
3039
env:
31-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,28 @@ permissions:
1111
name: release
1212

1313
jobs:
14-
release-please:
14+
release_please:
1515
runs-on: ubuntu-latest
16+
outputs:
17+
release_created: ${{ steps.release.outputs.release_created }}
1618
steps:
1719
- id: release
18-
uses: googleapis/release-please-action@v4
20+
uses: google-github-actions/release-please-action@v4
1921

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+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: actions/setup
2528
uses: ./.github/actions/setup
26-
- if: ${{ steps.release.outputs.release_created }}
27-
run: npm publish --provenance
29+
- name: actions/compress_sign_and_upload
30+
uses: ./.github/actions/compress_sign_and_upload
31+
with:
32+
garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
33+
garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
34+
artifactory_username: ${{ secrets.ARTIFACTORY_USER }}
35+
artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }}
36+
- run: npm publish --provenance
2837
env:
2938
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,25 @@ The official [MongoDB](https://www.mongodb.com/) driver for Node.js.
2020
| Contributing | [CONTRIBUTING.md](https://github.com/mongodb/node-mongodb-native/blob/HEAD/CONTRIBUTING.md) |
2121
| Changelog | [HISTORY.md](https://github.com/mongodb/node-mongodb-native/blob/HEAD/HISTORY.md) |
2222

23+
24+
25+
### Release Integrity
26+
27+
The GitHub release contains a detached signature file for the NPM package (named
28+
`bson-X.Y.Z.tgz.sig`).
29+
30+
The following command returns the link npm package.
31+
```shell
32+
npm view [email protected] dist.tarball
33+
```
34+
35+
Using the result of the above command, a `curl` command can return the official npm package for the release.
36+
37+
To verify the integrity of the downloaded package, run the following command:
38+
```shell
39+
gpg --verify mongodb-X.Y.Z.tgz.sig mongodb-X.Y.Z.tgz
40+
```
41+
2342
### Bugs / Feature Requests
2443

2544
Think you’ve found a bug? Want to see a new feature in `node-mongodb-native`? Please open a

0 commit comments

Comments
 (0)