Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(NODE-6156): add signature to github releases #692

Merged
merged 25 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/release-5.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,33 @@ jobs:
- if: ${{ steps.release.outputs.release_created }}
name: actions/setup
uses: ./.github/actions/setup
- if: steps.release.outputs.release_created
run: npm pack
shell: bash
- if: steps.release.outputs.release_created
name: Get release version and release package file name
run: |
PACKAGE_VERSION=$(jq '.version' package.json | tr -d '"')
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> "$GITHUB_ENV"
echo "PACKAGE_FILE=bson-${PACKAGE_VERSION}.tgz" >> "$GITHUB_ENV"
- if: steps.release.outputs.release_created
name: Create detached signature
uses: mongodb-labs/drivers-github-tools/garasign/gpg-sign@main
with:
filenames: ${{ env.PACKAGE_FILE }}
garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
artifactory_username: ${{ secrets.ARTIFACTORY_USER }}
artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }}
- if: steps.release.outputs.release_created
name: "Upload artifacts"
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE_FILE }}
path: |
${{ env.PACKAGE_FILE }}
${{ env.PACKAGE_FILE }}.sig
baileympearson marked this conversation as resolved.
Show resolved Hide resolved
retention-days: 3
- if: ${{ steps.release.outputs.release_created }}
run: npm publish --provenance --tag=5x
env:
Expand Down
34 changes: 31 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,41 @@ jobs:
- id: release
uses: google-github-actions/release-please-action@v4


# If release-please created a release, publish to npm
- if: ${{ steps.release.outputs.release_created }}
- if: steps.release.outputs.release_created
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/checkout@v4
- if: ${{ steps.release.outputs.release_created }}
- if: steps.release.outputs.release_created
name: actions/setup
uses: ./.github/actions/setup
- if: ${{ steps.release.outputs.release_created }}
- if: steps.release.outputs.release_created
run: npm pack
shell: bash
- if: steps.release.outputs.release_created
name: Get release version and release package file name
run: |
PACKAGE_VERSION=$(jq '.version' package.json | tr -d '"')
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> "$GITHUB_ENV"
echo "PACKAGE_FILE=bson-${PACKAGE_VERSION}.tgz" >> "$GITHUB_ENV"
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved
- if: steps.release.outputs.release_created
name: Create detached signature
uses: mongodb-labs/drivers-github-tools/garasign/gpg-sign@main
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved
with:
filenames: ${{ env.PACKAGE_FILE }}
garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
artifactory_username: ${{ secrets.ARTIFACTORY_USER }}
artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }}
- if: steps.release.outputs.release_created
name: "Upload artifacts"
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE_FILE }}
path: |
${{ env.PACKAGE_FILE }}
${{ env.PACKAGE_FILE }}.sig
retention-days: 3
- if: steps.release.outputs.release_created
run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ You can learn more about it in [the specification](http://bsonspec.org).
- [Documentation](#documentation)
- [FAQ](#faq)


### Release Integrity

The GitHub release contains a detached signature file for the NPM package (named
`mongodb-X.Y.Z.tgz.sig`).

To verify the integrity of the downloaded package, run the following command:

```shell
gpg --verify bson-X.Y.Z.tgz.sig bson-X.Y.Z.tgz
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved
```


## Bugs / Feature Requests

Think you've found a bug? Want to see a new feature in `bson`? Please open a case in our issue management tool, JIRA:
Expand Down