-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(NODE-6160): sign and upload to releases
- Loading branch information
Showing
3 changed files
with
131 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Setup | ||
description: 'Installs node, driver dependencies, and builds source' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
cache: 'npm' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: npm install -g npm@latest | ||
shell: bash | ||
- run: npm clean-install | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Sign and Upload Package | ||
description: 'Signs native modules with garasign' | ||
|
||
inputs: | ||
aws_role_arn: | ||
description: 'AWS role input for drivers-github-tools/gpg-sign@v2' | ||
required: true | ||
aws_region_name: | ||
description: 'AWS region name input for drivers-github-tools/gpg-sign@v2' | ||
required: true | ||
aws_secret_id: | ||
description: 'AWS secret id input for drivers-github-tools/gpg-sign@v2' | ||
required: true | ||
npm_package_name: | ||
description: 'The name for the npm package this repository represents' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
- name: Display structure of downloaded files | ||
shell: bash | ||
run: ls -R | ||
|
||
- name: Make signatures directory | ||
shell: bash | ||
run: mkdir artifacts | ||
|
||
- name: Set up drivers-github-tools | ||
uses: mongodb-labs/drivers-github-tools/setup@v2 | ||
with: | ||
aws_region_name: ${{ inputs.aws_region_name }} | ||
aws_role_arn: ${{ inputs.aws_role_arn }} | ||
aws_secret_id: ${{ inputs.aws_secret_id }} | ||
|
||
- name: Untar all the existing builds. | ||
shell: bash | ||
run: for filename in build-*/*.tar.gz; do tar -xvzf ${filename} --strip-components=2 -C $(dirname "$filename"); done | ||
|
||
- name: Display structure of downloaded files | ||
shell: bash | ||
run: ls -R | ||
|
||
- name: Rename the mongocrypt.node files to match the tar file name | ||
shell: bash | ||
run: for filename in build-*/*.node; do dir=$(dirname "$filename"); pattern=$(ls ${dir}/*.tar.gz | sed -r 's/mongodb-client-encryption(.*).tar.gz/\1/'); mv ${dir}/${filename} ${dir}/mongocrypt-${pattern}.node; done | ||
|
||
- name: Display structure of downloaded files | ||
shell: bash | ||
run: ls -R | ||
|
||
- name: Create detached signature | ||
uses: mongodb-labs/drivers-github-tools/gpg-sign@v2 | ||
with: | ||
filenames: 'build-*/*.node' | ||
env: | ||
RELEASE_ASSETS: artifacts/ | ||
|
||
# - name: Archive the native extensions again | ||
# shell: bash | ||
# run: | ||
|
||
- name: Display structure of downloaded files | ||
shell: bash | ||
run: ls -R | ||
|
||
# - name: Name release asset correctly | ||
# run: mv ${{ steps.get_vars.outputs.package_file }}.temp.sig ${{ steps.get_vars.outputs.package_file }}.sig | ||
# shell: bash | ||
|
||
# - name: "Upload release artifacts" | ||
# run: gh release upload v${{ steps.get_vars.outputs.package_version }} ${{ steps.get_vars.outputs.package_file }}.sig --clobber | ||
# shell: bash | ||
# env: | ||
# GH_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters