Skip to content

Commit 9f447e9

Browse files
chore(NODE-6243): move Node release tooling to drivers-github-tools (#4159)
1 parent e3d70c3 commit 9f447e9

File tree

10 files changed

+113
-129
lines changed

10 files changed

+113
-129
lines changed

.github/actions/compress_sign_and_upload/action.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/actions/setup/action.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
on:
2+
workflow_call: {}
3+
4+
name: Build
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
id-token: write
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- run: echo "nothing to do."
16+
shell: bash

.github/workflows/build_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v4
22-
- name: actions/setup
23-
uses: ./.github/actions/setup
22+
- name: Install Node and dependencies
23+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
2424
- run: sudo apt-get install hugo
2525
- name: Build Docs
2626
run: npm run build:docs -- --yes

.github/workflows/dependencies.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17-
- name: actions/setup
18-
uses: ./.github/actions/setup
17+
- name: Install Node and dependencies
18+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
1919
- run: npm run check:dependencies

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

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ jobs:
2121
with:
2222
target-branch: 5.x
2323

24-
ssdlc:
24+
build:
2525
needs: [release_please]
26+
name: "Perform any build or bundling steps, as necessary."
27+
uses: ./.github/workflows/build.yml
28+
29+
ssdlc:
30+
needs: [release_please, build]
2631
permissions:
2732
# required for all workflows
2833
security-events: write
@@ -32,51 +37,69 @@ jobs:
3237
runs-on: ubuntu-latest
3338
steps:
3439
- uses: actions/checkout@v4
35-
- name: actions/setup
36-
uses: ./.github/actions/setup
37-
- name: Get release version and release package file name
38-
id: get_vars
39-
shell: bash
40-
run: |
41-
package_version=$(jq --raw-output '.version' package.json)
42-
echo "package_version=${package_version}" >> "$GITHUB_OUTPUT"
43-
echo "package_file=mongodb-${package_version}.tgz" >> "$GITHUB_OUTPUT"
40+
41+
- name: Install Node and dependencies
42+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
43+
with:
44+
ignore_install_scripts: false
45+
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
4450

4551
- name: actions/compress_sign_and_upload
46-
uses: ./.github/actions/compress_sign_and_upload
52+
uses: mongodb-labs/drivers-github-tools/node/sign_node_package@v2
4753
with:
4854
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
49-
aws_region_name: 'us-east-1'
55+
aws_region_name: us-east-1
5056
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
51-
npm_package_name: 'mongodb'
57+
npm_package_name: mongodb
5258
dry_run: ${{ needs.release_please.outputs.release_created == '' }}
5359

5460
- name: Copy sbom file to release assets
5561
shell: bash
62+
if: ${{ '' == '' }}
5663
run: cp sbom.json ${{ env.S3_ASSETS }}/sbom.json
5764

65+
# only used for mongodb-client-encryption
66+
- name: Augment SBOM and copy to release assets
67+
if: ${{ '' != '' }}
68+
uses: mongodb-labs/drivers-github-tools/sbom@v2
69+
with:
70+
silk_asset_group: ''
71+
sbom_file_name: sbom.json
72+
5873
- name: Generate authorized pub report
5974
uses: mongodb-labs/drivers-github-tools/full-report@v2
6075
with:
61-
release_version: ${{ steps.get_version.outputs.package_version }}
76+
release_version: ${{ env.package_version }}
6277
product_name: mongodb
6378
sarif_report_target_ref: 5.x
6479
third_party_dependency_tool: n/a
65-
# <package> and <package>.sig
66-
dist_filenames: ${{ steps.get_vars.outputs.package_file }}*
67-
token: ${{ github.token }}
80+
dist_filenames: artifacts/*
81+
token: ${{ github.token }}
6882
sbom_file_name: sbom.json
83+
evergreen_project: mongo-node-driver-next
84+
evergreen_commit: ${{ env.commit }}
85+
86+
- uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
87+
with:
88+
version: ${{ env.package_version }}
89+
product_name: mongodb
90+
dry_run: ${{ needs.release_please.outputs.release_created == '' }}
6991

7092
publish:
71-
needs: [release_please, ssdlc]
93+
needs: [release_please, ssdlc, build]
7294
environment: release
7395
runs-on: ubuntu-latest
7496
steps:
7597
- uses: actions/checkout@v4
76-
- name: actions/setup
77-
uses: ./.github/actions/setup
7898

79-
- run: npm publish --provenance --tag=5.x
99+
- name: Install Node and dependencies
100+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
101+
102+
- run: npm publish --provenance --tag=5x
80103
if: ${{ needs.release_please.outputs.release_created }}
81104
env:
82105
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release-alpha.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
exit 1
2727
fi
2828
- uses: actions/checkout@v4
29-
- name: actions/setup
30-
uses: ./.github/actions/setup
29+
- name: Install Node and dependencies
30+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
3131
- run: npm version "${{ inputs.alphaVersion }}" --git-tag-version=false
3232
- run: npm publish --provenance --tag=alpha
3333
env:

.github/workflows/release-nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@v4
23-
- name: actions/setup
24-
uses: ./.github/actions/setup
23+
- name: Install Node and dependencies
24+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
2525
- id: build_nightly
2626
run: npm run build:nightly
2727
- if: ${{ steps.build_nightly.outputs.publish == 'yes' }}

.github/workflows/release.yml

Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ permissions:
88
pull-requests: write
99
id-token: write
1010

11-
name: release
11+
name: release-latest
1212

1313
jobs:
1414
release_please:
@@ -18,9 +18,16 @@ jobs:
1818
steps:
1919
- id: release
2020
uses: googleapis/release-please-action@v4
21+
with:
22+
target-branch: main
2123

22-
ssdlc:
24+
build:
2325
needs: [release_please]
26+
name: "Perform any build or bundling steps, as necessary."
27+
uses: ./.github/workflows/build.yml
28+
29+
ssdlc:
30+
needs: [release_please, build]
2431
permissions:
2532
# required for all workflows
2633
security-events: write
@@ -30,55 +37,67 @@ jobs:
3037
runs-on: ubuntu-latest
3138
steps:
3239
- uses: actions/checkout@v4
33-
- name: actions/setup
34-
uses: ./.github/actions/setup
35-
- name: Get release version and release package file name
36-
id: get_vars
37-
shell: bash
38-
run: |
39-
package_version=$(jq --raw-output '.version' package.json)
40-
echo "package_version=${package_version}" >> "$GITHUB_OUTPUT"
41-
echo "package_file=mongodb-${package_version}.tgz" >> "$GITHUB_OUTPUT"
40+
41+
- name: Install Node and dependencies
42+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
43+
with:
44+
ignore_install_scripts: false
45+
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
4250

4351
- name: actions/compress_sign_and_upload
44-
uses: ./.github/actions/compress_sign_and_upload
52+
uses: mongodb-labs/drivers-github-tools/node/sign_node_package@v2
4553
with:
4654
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
47-
aws_region_name: 'us-east-1'
55+
aws_region_name: us-east-1
4856
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
49-
npm_package_name: 'mongodb'
57+
npm_package_name: mongodb
5058
dry_run: ${{ needs.release_please.outputs.release_created == '' }}
5159

5260
- name: Copy sbom file to release assets
5361
shell: bash
62+
if: ${{ '' == '' }}
5463
run: cp sbom.json ${{ env.S3_ASSETS }}/sbom.json
5564

65+
# only used for mongodb-client-encryption
66+
- name: Augment SBOM and copy to release assets
67+
if: ${{ '' != '' }}
68+
uses: mongodb-labs/drivers-github-tools/sbom@v2
69+
with:
70+
silk_asset_group: ''
71+
sbom_file_name: sbom.json
72+
5673
- name: Generate authorized pub report
5774
uses: mongodb-labs/drivers-github-tools/full-report@v2
5875
with:
59-
release_version: ${{ steps.get_version.outputs.package_version }}
76+
release_version: ${{ env.package_version }}
6077
product_name: mongodb
6178
sarif_report_target_ref: main
6279
third_party_dependency_tool: n/a
63-
# <package> and <package>.sig
64-
dist_filenames: ${{ steps.get_vars.outputs.package_file }}*
65-
token: ${{ github.token }}
80+
dist_filenames: artifacts/*
81+
token: ${{ github.token }}
6682
sbom_file_name: sbom.json
83+
evergreen_project: mongo-node-driver-next
84+
evergreen_commit: ${{ env.commit }}
6785

6886
- uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
6987
with:
70-
version: ${{ inputs.version }}
71-
product_name: ${{ inputs.product_name }}
72-
dry_run: ${{ needs.release_please.outputs.release_created == '' }}
88+
version: ${{ env.package_version }}
89+
product_name: mongodb
90+
dry_run: ${{ needs.release_please.outputs.release_created == '' }}
7391

7492
publish:
75-
needs: [release_please, ssdlc]
93+
needs: [release_please, ssdlc, build]
7694
environment: release
7795
runs-on: ubuntu-latest
7896
steps:
7997
- uses: actions/checkout@v4
80-
- name: actions/setup
81-
uses: ./.github/actions/setup
98+
99+
- name: Install Node and dependencies
100+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
82101

83102
- run: npm publish --provenance --tag=latest
84103
if: ${{ needs.release_please.outputs.release_created }}

.github/workflows/release_notes.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ jobs:
4545

4646

4747
# Setup Node.js and npm install
48-
- name: actions/setup
49-
uses: ./.github/actions/setup
48+
- name: Install Node and dependencies
49+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
5050

5151
# See: https://github.com/googleapis/release-please/issues/1274
5252

0 commit comments

Comments
 (0)