@@ -79,22 +79,130 @@ jobs:
79
79
- id : release
80
80
uses : googleapis/release-please-action@v4
81
81
82
+ generate_sarif_report :
83
+ environment : release
84
+ runs-on : ubuntu-latest
85
+ needs : [release_please]
86
+ permissions :
87
+ # required for all workflows
88
+ security-events : write
89
+ id-token : write
90
+ contents : write
91
+
92
+ steps :
93
+ - uses : actions/checkout@v4
94
+ - name : Set up drivers-github-tools
95
+ uses : mongodb-labs/drivers-github-tools/setup@v2
96
+ with :
97
+ aws_region_name : us-east-1
98
+ aws_role_arn : ${{ secrets.aws_role_arn }}
99
+ aws_secret_id : ${{ secrets.aws_secret_id }}
100
+
101
+ - name : " Generate Sarif Report"
102
+ uses : mongodb-labs/drivers-github-tools/code-scanning-export@v2
103
+ with :
104
+ ref : main
105
+ output-file : sarif-report.json
106
+
107
+ - name : Get release version and release package file name
108
+ id : get_version
109
+ shell : bash
110
+ run : |
111
+ package_version=$(jq --raw-output '.version' package.json)
112
+ echo "package_version=${package_version}" >> "$GITHUB_OUTPUT"
113
+ - name : actions/publish_asset_to_s3
114
+ uses : mongodb-labs/drivers-github-tools/node/publish_asset_to_s3@v2
115
+ with :
116
+ version : ${{ steps.get_version.outputs.package_version }}
117
+ product_name : mongodb-client-encryption
118
+ file : sarif-report.json
119
+ dry_run : ${{ needs.release_please.outputs.release_created == '' }}
120
+
121
+ generate_compliance_report :
122
+ environment : release
123
+ runs-on : ubuntu-latest
124
+ needs : [release_please]
125
+ permissions :
126
+ # required for all workflows
127
+ security-events : write
128
+ id-token : write
129
+ contents : write
130
+
131
+ steps :
132
+ - uses : actions/checkout@v4
133
+ - name : Set up drivers-github-tools
134
+ uses : mongodb-labs/drivers-github-tools/setup@v2
135
+ with :
136
+ aws_region_name : us-east-1
137
+ aws_role_arn : ${{ secrets.aws_role_arn }}
138
+ aws_secret_id : ${{ secrets.aws_secret_id }}
139
+
140
+ - name : Get release version and release package file name
141
+ id : get_version
142
+ shell : bash
143
+ run : |
144
+ package_version=$(jq --raw-output '.version' package.json)
145
+ echo "package_version=${package_version}" >> "$GITHUB_OUTPUT"
146
+
147
+ - name : Generate compliance report
148
+ uses : mongodb-labs/drivers-github-tools/compliance-report@v2
149
+ with :
150
+ sbom_name : sbom.json # TODO - confirm sbom file name
151
+ sarif_name : sarif-report.json
152
+ security_report_location : tbd
153
+ release_version : ${{ steps.get_version.outputs.package_version }}
154
+ token : ${{ github.token }}
155
+
156
+ - name : actions/publish_asset_to_s3
157
+ uses : mongodb-labs/drivers-github-tools/node/publish_asset_to_s3@v2
158
+ with :
159
+ version : ${{ steps.get_version.outputs.package_version }}
160
+ product_name : mongodb-client-encryption
161
+ file : ${{env.S3_ASSETS}}/ssdlc_compliance_report.txt
162
+ dry_run : ${{ needs.release_please.outputs.release_created == '' }}
163
+
82
164
sign_and_upload :
83
165
needs : [release_please]
84
- if : ${{ needs.release_please.outputs.release_created }}
85
166
runs-on : ubuntu-latest
86
167
environment : release
87
168
steps :
88
169
- uses : actions/checkout@v4
89
170
- name : actions/setup
90
171
uses : ./.github/actions/setup
172
+ - name : Get release version and release package file name
173
+ id : get_vars
174
+ shell : bash
175
+ run : |
176
+ package_version=$(jq --raw-output '.version' package.json)
177
+ echo "package_version=${package_version}" >> "$GITHUB_OUTPUT"
178
+ echo "package_file=mongodb-${package_version}.tgz" >> "$GITHUB_OUTPUT"
91
179
- name : actions/sign_and_upload_package
92
180
uses : ./.github/actions/sign_and_upload_package
93
181
with :
94
182
aws_role_arn : ${{ secrets.AWS_ROLE_ARN }}
95
183
aws_region_name : ' us-east-1'
96
184
aws_secret_id : ${{ secrets.AWS_SECRET_ID }}
97
185
npm_package_name : ' mongodb-client-encryption'
98
- - run : npm publish --provenance --tag=alpha
99
- env :
100
- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
186
+ dry_run : ${{ needs.release_please.outputs.release_created == '' }}
187
+
188
+ - name : Generate authorized pub report
189
+ uses : mongodb-labs/drivers-github-tools/authorized-pub@v2
190
+ with :
191
+ release_version : ${{ steps.get_version.outputs.package_version }}
192
+ product_name : mongodb-client-encryption
193
+ # <package> and <package>.sig
194
+ filenames : artifacts/*
195
+ token : ${{ github.token }}
196
+
197
+ - name : actions/publish_asset_to_s3
198
+ uses : mongodb-labs/drivers-github-tools/node/publish_asset_to_s3@v2
199
+ with :
200
+ version : ${{ steps.get_version.outputs.package_version }}
201
+ product_name : mongodb-client-encryption
202
+ file : ${{env.S3_ASSETS}}/authorized-publication.txt
203
+ dry_run : ${{ needs.release_please.outputs.release_created == '' }}
204
+
205
+ # - run: npm publish --provenance --tag=alpha
206
+ # if: ${{ needs.release_please.outputs.release_created }}
207
+ # env:
208
+ # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
0 commit comments