Skip to content

Commit af09ea9

Browse files
committed
Publish SSDLC assets after release
1 parent d5021c1 commit af09ea9

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/release.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,77 @@ jobs:
182182
secrets: inherit
183183
permissions:
184184
id-token: write
185+
186+
publish-ssdlc-assets:
187+
needs:
188+
- static-analysis
189+
- package-release
190+
environment: release
191+
name: "Publish SSDLC Assets"
192+
runs-on: ubuntu-latest
193+
permissions:
194+
security-events: read
195+
id-token: write
196+
contents: write
197+
198+
steps:
199+
- name: "Create temporary app token"
200+
uses: actions/create-github-app-token@v1
201+
id: app-token
202+
with:
203+
app-id: ${{ vars.APP_ID }}
204+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
205+
206+
- name: "Store GitHub token in environment"
207+
run: echo "GH_TOKEN=${{ steps.app-token.outputs.token }}" >> "$GITHUB_ENV"
208+
shell: bash
209+
210+
- uses: actions/checkout@v4
211+
with:
212+
ref: refs/tags/${{ inputs.version }}
213+
token: ${{ env.GH_TOKEN }}
214+
215+
# Sets the S3_ASSETS environment variable used later
216+
- name: "Set up drivers-github-tools"
217+
uses: mongodb-labs/drivers-github-tools/setup@v2
218+
with:
219+
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
220+
aws_region_name: ${{ vars.AWS_REGION_NAME }}
221+
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
222+
223+
- name: Download all release artifacts
224+
run: gh release download ${{ inputs.version }} --dir ${{ env.RELEASE_ASSETS }}
225+
226+
- name: "Generate authorized publication document"
227+
uses: mongodb-labs/drivers-github-tools/authorized-pub@v2
228+
with:
229+
product_name: "MongoDB PHP Driver (extension)"
230+
release_version: ${{ inputs.version }}
231+
filenames: "${{ env.RELEASE_ASSETS }}/*"
232+
token: ${{ env.GH_TOKEN }}
233+
234+
- name: "Download SBOM file from Silk"
235+
uses: mongodb-labs/drivers-github-tools/sbom@v2
236+
with:
237+
silk_asset_group: mongodb-php-driver-extension
238+
239+
- name: "Upload SBOM as release artifact"
240+
run: gh release upload ${{ inputs.version }} ${{ env.S3_ASSETS }}/cyclonedx.sbom.json
241+
continue-on-error: true
242+
243+
- name: "Generate SARIF report from code scanning alerts"
244+
uses: mongodb-labs/drivers-github-tools/code-scanning-export@v2
245+
with:
246+
ref: ${{ inputs.version }}
247+
output-file: ${{ env.S3_ASSETS }}/code-scanning-alerts.json
248+
249+
- name: "Generate compliance report"
250+
uses: mongodb-labs/drivers-github-tools/compliance-report@v2
251+
with:
252+
token: ${{ env.GH_TOKEN }}
253+
254+
- name: Upload S3 assets
255+
uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
256+
with:
257+
version: ${{ inputs.version }}
258+
product_name: mongo-php-driver

0 commit comments

Comments
 (0)