Skip to content

Commit ad12442

Browse files
GODRIVER-3192 Add SSDLC workflow (#1680)
Signed-off-by: mongodb-dbx-release-bot[bot] <167856002+mongodb-dbx-release-bot[bot]@users.noreply.github.com> Co-authored-by: mongodb-dbx-release-bot[bot] <167856002+mongodb-dbx-release-bot[bot]@users.noreply.github.com>
1 parent 90146e7 commit ad12442

File tree

2 files changed

+88
-7
lines changed

2 files changed

+88
-7
lines changed

.github/workflows/codeql.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ jobs:
2222
# required for all workflows
2323
security-events: write
2424

25-
# required to fetch internal or private CodeQL packs
26-
packages: read
27-
28-
# only required for workflows in private repositories
29-
actions: read
30-
contents: read
31-
3225
strategy:
3326
fail-fast: false
3427
matrix:

.github/workflows/release.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "The new version to set"
8+
required: true
9+
prev_version:
10+
description: "The previous tagged version"
11+
required: true
12+
push_changes:
13+
description: "Push changes?"
14+
default: true
15+
type: boolean
16+
17+
defaults:
18+
run:
19+
shell: bash -eux {0}
20+
21+
env:
22+
# Changes per branch
23+
SILK_ASSET_GROUP: mongodb-go-driver-v1
24+
EVERGREEN_PROJECT: mongo-go-driver-v1
25+
26+
jobs:
27+
pre-publish:
28+
environment: release
29+
runs-on: ubuntu-latest
30+
permissions:
31+
id-token: write
32+
contents: write
33+
outputs:
34+
prev_version: ${{ steps.pre-publish.outputs.prev_version }}
35+
steps:
36+
- uses: mongodb-labs/drivers-github-tools/secure-checkout@v2
37+
with:
38+
app_id: ${{ vars.APP_ID }}
39+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
40+
- uses: mongodb-labs/drivers-github-tools/setup@v2
41+
with:
42+
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
43+
aws_region_name: ${{ vars.AWS_REGION_NAME }}
44+
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
45+
artifactory_username: ${{ vars.ARTIFACTORY_USERNAME }}
46+
- name: Pre Publish
47+
id: pre-publish
48+
uses: mongodb-labs/drivers-github-tools/golang/pre-publish@v2
49+
with:
50+
version: ${{ inputs.version }}
51+
push_changes: ${{ inputs.push_changes }}
52+
53+
static-scan:
54+
needs: [pre-publish]
55+
permissions:
56+
security-events: write
57+
uses: ./.github/workflows/codeql.yml
58+
with:
59+
ref: ${{ github.ref }}
60+
61+
publish:
62+
needs: [pre-publish, static-scan]
63+
runs-on: ubuntu-latest
64+
environment: release
65+
permissions:
66+
id-token: write
67+
contents: write
68+
security-events: read
69+
steps:
70+
- uses: mongodb-labs/drivers-github-tools/secure-checkout@v2
71+
with:
72+
app_id: ${{ vars.APP_ID }}
73+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
74+
- uses: mongodb-labs/drivers-github-tools/setup@v2
75+
with:
76+
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
77+
aws_region_name: ${{ vars.AWS_REGION_NAME }}
78+
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
79+
artifactory_username: ${{ vars.ARTIFACTORY_USERNAME }}
80+
- name: Publish
81+
uses: mongodb-labs/drivers-github-tools/golang/publish@v2
82+
with:
83+
version: ${{ inputs.version }}
84+
silk_asset_group: ${{ env.SILK_ASSET_GROUP }}
85+
evergreen_project: ${{ env.EVERGREEN_PROJECT }}
86+
prev_version: ${{ inputs.prev_version }}
87+
push_changes: ${{ inputs.push_changes }}
88+
token: ${{ env.GH_TOKEN }}

0 commit comments

Comments
 (0)