Skip to content

Commit 2c0b2f5

Browse files
chore: ssdlc compliance flow (#29)
1 parent f27e8e1 commit 2c0b2f5

File tree

4 files changed

+111
-90
lines changed

4 files changed

+111
-90
lines changed

Diff for: .github/actions/setup/action.yml

-15
This file was deleted.

Diff for: .github/actions/sign_and_upload_package/action.yml

-71
This file was deleted.

Diff for: .github/workflows/build.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
on:
2-
push:
3-
branches: [main]
42
pull_request:
53
branches: [main]
64
workflow_dispatch: {}
5+
workflow_call: {}
76

87
name: Build and Test
98

@@ -86,8 +85,10 @@ jobs:
8685
environment: release
8786
steps:
8887
- uses: actions/checkout@v4
89-
- name: actions/setup
90-
uses: ./.github/actions/setup
88+
- name: Install Node and dependencies
89+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
90+
with:
91+
ignore_install_scripts: true
9192
- name: actions/sign_and_upload_package
9293
uses: ./.github/actions/sign_and_upload_package
9394
with:

Diff for: .github/workflows/release_6.1.yml

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
on:
2+
push:
3+
branches: ["6.1"]
4+
workflow_dispatch: {}
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
id-token: write
10+
11+
name: release-6.1
12+
13+
jobs:
14+
release_please:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
release_created: ${{ steps.release.outputs.release_created }}
18+
steps:
19+
- id: release
20+
uses: googleapis/release-please-action@v4
21+
with:
22+
target-branch: 6.1
23+
24+
build:
25+
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]
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
40+
41+
- name: Install Node and dependencies
42+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
43+
with:
44+
ignore_install_scripts: true
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-client-encryption
50+
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
60+
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
65+
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
73+
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: 6.1
80+
third_party_dependency_tool: n/a
81+
dist_filenames: artifacts/*
82+
token: ${{ github.token }}
83+
sbom_file_name: sbom.json
84+
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 == '' }}
90+
91+
publish:
92+
needs: [release_please, ssdlc, build]
93+
environment: release
94+
runs-on: ubuntu-latest
95+
steps:
96+
- uses: actions/checkout@v4
97+
98+
- name: Install Node and dependencies
99+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
100+
with:
101+
ignore_install_scripts: true
102+
103+
- run: npm publish --provenance --tag=alpha
104+
if: ${{ needs.release_please.outputs.release_created }}
105+
env:
106+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)