Skip to content

Commit

Permalink
chore: ssdlc compliance flow (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson authored Jun 28, 2024
1 parent f27e8e1 commit 2c0b2f5
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 90 deletions.
15 changes: 0 additions & 15 deletions .github/actions/setup/action.yml

This file was deleted.

71 changes: 0 additions & 71 deletions .github/actions/sign_and_upload_package/action.yml

This file was deleted.

9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch: {}
workflow_call: {}

name: Build and Test

Expand Down Expand Up @@ -86,8 +85,10 @@ jobs:
environment: release
steps:
- uses: actions/checkout@v4
- name: actions/setup
uses: ./.github/actions/setup
- name: Install Node and dependencies
uses: mongodb-labs/drivers-github-tools/node/setup@v2
with:
ignore_install_scripts: true
- name: actions/sign_and_upload_package
uses: ./.github/actions/sign_and_upload_package
with:
Expand Down
106 changes: 106 additions & 0 deletions .github/workflows/release_6.1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
on:
push:
branches: ["6.1"]
workflow_dispatch: {}

permissions:
contents: write
pull-requests: write
id-token: write

name: release-6.1

jobs:
release_please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- id: release
uses: googleapis/release-please-action@v4
with:
target-branch: 6.1

build:
needs: [release_please]
name: "Perform any build or bundling steps, as necessary."
uses: ./.github/workflows/build.yml

ssdlc:
needs: [release_please, build]
permissions:
# required for all workflows
security-events: write
id-token: write
contents: write
environment: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Node and dependencies
uses: mongodb-labs/drivers-github-tools/node/setup@v2
with:
ignore_install_scripts: true

- name: Load version and package info
uses: mongodb-labs/drivers-github-tools/node/get_version_info@v2
with:
npm_package_name: mongodb-client-encryption

- name: actions/compress_sign_and_upload
uses: mongodb-labs/drivers-github-tools/node/sign_node_package@v2
with:
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
aws_region_name: us-east-1
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
npm_package_name: mongodb-client-encryption
dry_run: ${{ needs.release_please.outputs.release_created == '' }}
sign_native: true

- name: Copy sbom file to release assets
shell: bash
if: ${{ 'mongodb-client-encryption-6.1' == '' }}
run: cp sbom.json ${{ env.S3_ASSETS }}/sbom.json

# only used for mongodb-client-encryption
- name: Augment SBOM and copy to release assets
if: ${{ 'mongodb-client-encryption-6.1' != '' }}
uses: mongodb-labs/drivers-github-tools/sbom@v2
with:
silk_asset_group: 'mongodb-client-encryption-6.1'
sbom_file_name: sbom.json

- name: Generate authorized pub report
uses: mongodb-labs/drivers-github-tools/full-report@v2
with:
release_version: ${{ env.package_version }}
product_name: mongodb-client-encryption
sarif_report_target_ref: 6.1
third_party_dependency_tool: n/a
dist_filenames: artifacts/*
token: ${{ github.token }}
sbom_file_name: sbom.json

- uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
with:
version: ${{ env.package_version }}
product_name: mongodb-client-encryption
dry_run: ${{ needs.release_please.outputs.release_created == '' }}

publish:
needs: [release_please, ssdlc, build]
environment: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Node and dependencies
uses: mongodb-labs/drivers-github-tools/node/setup@v2
with:
ignore_install_scripts: true

- run: npm publish --provenance --tag=alpha
if: ${{ needs.release_please.outputs.release_created }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 2c0b2f5

Please sign in to comment.