Skip to content

Commit 6514a85

Browse files
authored
DRIVERS-3232 Use ECR instead of artifactory and update to v3 (#84)
1 parent 0eb77c2 commit 6514a85

File tree

23 files changed

+170
-168
lines changed

23 files changed

+170
-168
lines changed

.github/workflows/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2
1+
3

README.md

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This action will perform a checkout with the GitHub App credentials.
5151
5252
```yaml
5353
- name: secure-checkout
54-
uses: mongodb-labs/drivers-github-tools/secure-checkout@v2
54+
uses: mongodb-labs/drivers-github-tools/secure-checkout@v3
5555
with:
5656
app_id: ${{ vars.APP_ID }}
5757
private_key: ${{ secrets.APP_PRIVATE_KEY }}
@@ -65,13 +65,13 @@ used with the `gh` cli.
6565

6666
There is a common setup action that is meant to be run before all
6767
other actions. It handles fetching secrets from AWS Secrets Manager,
68-
signing into Artifactory, setting up Garasign credentials, and
68+
signing into ECR, setting up Garasign credentials, and
6969
setting up environment variables used in other actions.
7070
The action requires `id-token: write` permissions.
7171

7272
```yaml
7373
- name: setup
74-
uses: mongodb-labs/drivers-github-tools/setup@v2
74+
uses: mongodb-labs/drivers-github-tools/setup@v3
7575
with:
7676
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
7777
aws_region_name: ${{ vars.AWS_REGION_NAME }}
@@ -84,9 +84,8 @@ The action requires `id-token: write` permissions.
8484
> `actions/checkout action`
8585
>
8686
> The following keys MUST be defined in the ``AWS_SECRET_ID`` vault:
87-
> `artifactory-username`, `artifactory-password`, `garasign-username`
88-
> `garasign-password`, `gpg-key-id`. If uploading to an S3 bucket, also define
89-
> `release-assets-bucket`.
87+
> `garasign-username`, `garasign-password`, `gpg-key-id`.
88+
> If uploading to an S3 bucket, also define `release-assets-bucket`.
9089

9190
## Signing tools
9291

@@ -98,17 +97,17 @@ Use this action to create signed git artifacts:
9897

9998
```yaml
10099
- name: Setup
101-
uses: mongodb-labs/drivers-github-tools/setup@v2
100+
uses: mongodb-labs/drivers-github-tools/setup@v3
102101
with:
103102
...
104103
105104
- name: Create signed commit
106-
uses: mongodb-labs/drivers-github-tools/git-sign@v2
105+
uses: mongodb-labs/drivers-github-tools/git-sign@v3
107106
with:
108107
command: "git commit -m 'Commit' -s --gpg-sign=${{ env.GPG_KEY_ID }}"
109108
110109
- name: Create signed tag
111-
uses: mongodb-labs/drivers-github-tools/git-sign@v2
110+
uses: mongodb-labs/drivers-github-tools/git-sign@v3
112111
with:
113112
command: "git tag -m 'Tag' -s --local-user=${{ env.GPG_KEY_ID }} -a <tag>"
114113
```
@@ -122,7 +121,7 @@ an argument and update the version accordingly.
122121

123122
```yaml
124123
- name: Bump version
125-
uses: mongodb-labs/drivers-github-tools/bump-version@v2
124+
uses: mongodb-labs/drivers-github-tools/bump-version@v3
126125
with:
127126
version: ${{ inputs.version }}
128127
version_bump_script: "bash ./my-bump-version-script.sh"
@@ -136,7 +135,7 @@ tag message format if desired.
136135

137136
```yaml
138137
- name: Tag version
139-
uses: mongodb-labs/drivers-github-tools/tag-version@v2
138+
uses: mongodb-labs/drivers-github-tools/tag-version@v3
140139
with:
141140
version: ${{ inputs.version }}
142141
```
@@ -147,12 +146,12 @@ This action is used to create detached signatures for files:
147146

148147
```yaml
149148
- name: Setup
150-
uses: mongodb-labs/drivers-github-tools/setup@v2
149+
uses: mongodb-labs/drivers-github-tools/setup@v3
151150
with:
152151
...
153152
154153
- name: Create detached signature
155-
uses: mongodb-labs/drivers-github-tools/gpg-sign@v2
154+
uses: mongodb-labs/drivers-github-tools/gpg-sign@v3
156155
with:
157156
filenames: somefile.ext
158157
```
@@ -164,7 +163,7 @@ You can also supply a glob pattern to sign a group of files:
164163

165164
```yaml
166165
- name: Setup
167-
uses: mongodb-labs/drivers-github-tools/setup@v2
166+
uses: mongodb-labs/drivers-github-tools/setup@v3
168167
with:
169168
...
170169
@@ -186,12 +185,12 @@ It will create the file `$S3_ASSETS/authorized_publication.txt`
186185

187186
```yaml
188187
- name: Setup
189-
uses: mongodb-labs/drivers-github-tools/setup@v2
188+
uses: mongodb-labs/drivers-github-tools/setup@v3
190189
with:
191190
...
192191
193192
- name: Create Authorized Publication Report
194-
uses: mongodb-labs/drivers-github-tools/authorized-pub@v2
193+
uses: mongodb-labs/drivers-github-tools/authorized-pub@v3
195194
with:
196195
product_name: Mongo Python Driver
197196
release_version: ${{ github.ref_name }}
@@ -205,12 +204,12 @@ This action will download an Augmented SBOM file in `$RELEASE_ASSETS/sbom.json`.
205204

206205
```yaml
207206
- name: Setup
208-
uses: mongodb-labs/drivers-github-tools/setup@v2
207+
uses: mongodb-labs/drivers-github-tools/setup@v3
209208
with:
210209
...
211210
212211
- name: Create SBOM
213-
uses: mongodb-labs/drivers-github-tools/sbom@v2
212+
uses: mongodb-labs/drivers-github-tools/sbom@v3
214213
with:
215214
sbom_in_path: sbom.json
216215
```
@@ -223,12 +222,12 @@ working directory.
223222

224223
```yaml
225224
- name: Setup
226-
uses: mongodb-labs/drivers-github-tools/setup@v2
225+
uses: mongodb-labs/drivers-github-tools/setup@v3
227226
with:
228227
...
229228
230229
- name: Export Code Scanning Alerts
231-
uses: mongodb-labs/drivers-github-tools/code-scanning-export@v2
230+
uses: mongodb-labs/drivers-github-tools/code-scanning-export@v3
232231
```
233232

234233
### Compliance Report
@@ -238,12 +237,12 @@ called `ssdlc_compliance_report.md`.
238237

239238
```yaml
240239
- name: Setup
241-
uses: mongodb-labs/drivers-github-tools/setup@v2
240+
uses: mongodb-labs/drivers-github-tools/setup@v3
242241
with:
243242
...
244243
245244
- name: Generate compliance report
246-
uses: mongodb-labs/drivers-github-tools/compliance-report@v2
245+
uses: mongodb-labs/drivers-github-tools/compliance-report@v3
247246
```
248247

249248
There are several ways to specify the security report:
@@ -260,12 +259,12 @@ in the `S3_ASSETS` folder. This composite action runs the `authorized-pub`, `sbo
260259

261260
```yaml
262261
- name: Setup
263-
uses: mongodb-labs/drivers-github-tools/setup@v2
262+
uses: mongodb-labs/drivers-github-tools/setup@v3
264263
with:
265264
...
266265
267266
- name: Generate SSDLC Reports
268-
uses: mongodb-labs/drivers-github-tools/full-report@v2
267+
uses: mongodb-labs/drivers-github-tools/full-report@v3
269268
with:
270269
product_name: winkerberos
271270
release_version: ${{ inputs.version }}
@@ -280,12 +279,12 @@ be uploaded to the product's S3 bucket:
280279

281280
```yaml
282281
- name: Setup
283-
uses: mongodb-labs/drivers-github-tools/setup@v2
282+
uses: mongodb-labs/drivers-github-tools/setup@v3
284283
with:
285284
...
286285
287286
- name: Upload S3 assets
288-
uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
287+
uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v3
289288
with:
290289
version: <release version>
291290
product_name: <product_name>
@@ -305,12 +304,12 @@ prerelease version, and push the changes.
305304

306305
```yaml
307306
- name: Setup
308-
uses: mongodb-labs/drivers-github-tools/setup@v2
307+
uses: mongodb-labs/drivers-github-tools/setup@v3
309308
with:
310309
...
311310
312311
- name: Create Release Branch
313-
uses: mongodb-labs/drivers-github-tools/create-branch@v2
312+
uses: mongodb-labs/drivers-github-tools/create-branch@v3
314313
with:
315314
# user inputs
316315
branch: ...
@@ -333,7 +332,7 @@ Push the commit and tag to the source branch unless `dry_run` is set.
333332

334333
```yaml
335334
- name: Setup
336-
uses: mongodb-labs/drivers-github-tools/setup@v2
335+
uses: mongodb-labs/drivers-github-tools/setup@v3
337336
with:
338337
...
339338
@@ -384,11 +383,11 @@ post-publish:
384383
security-events: write
385384
steps:
386385
- name: Setup
387-
uses: mongodb-labs/drivers-github-tools/setup@v2
386+
uses: mongodb-labs/drivers-github-tools/setup@v3
388387
with:
389388
...
390389
391-
- uses: mongodb-labs/drivers-github-tools/python/post-publish@v2
390+
- uses: mongodb-labs/drivers-github-tools/python/post-publish@v3
392391
with:
393392
version: ${{ inputs.version }}
394393
following_version: ${{ inputs.following_version }}
@@ -411,7 +410,7 @@ Push the commit and tag to the source branch unless `dry_run` is set.
411410

412411
```yaml
413412
- name: Setup
414-
uses: mongodb-labs/drivers-github-tools/setup@v2
413+
uses: mongodb-labs/drivers-github-tools/setup@v3
415414
with:
416415
...
417416
@@ -460,11 +459,11 @@ post-publish:
460459
security-events: write
461460
steps:
462461
- name: Setup
463-
uses: mongodb-labs/drivers-github-tools/setup@v2
462+
uses: mongodb-labs/drivers-github-tools/setup@v3
464463
with:
465464
...
466465
467-
- uses: mongodb-labs/drivers-github-tools/python-labs/post-publish@v2
466+
- uses: mongodb-labs/drivers-github-tools/python-labs/post-publish@v3
468467
with:
469468
following_version: ${{ inputs.following_version }}
470469
version_bump_script: ./.github/scripts/bump-version.sh

bump-version/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ inputs:
1616
working_directory:
1717
description: The working directory for the version bump
1818
default: "."
19-
artifactory_image:
20-
description: "Image to use for artifactory"
21-
default: release-tools-container-registry-local/garasign-git
19+
ecr_repository:
20+
description: "The ECR repository to use"
21+
default: release-infrastructure/garasign-git
2222

2323
runs:
2424
using: composite
@@ -36,10 +36,10 @@ runs:
3636
export COMMIT_MESSAGE=$(echo "${{ inputs.commit_template }}" | envsubst)
3737
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV
3838
- name: Commit the version bump
39-
uses: mongodb-labs/drivers-github-tools/git-sign@v2
39+
uses: mongodb-labs/drivers-github-tools/git-sign@v3
4040
with:
4141
command: git commit -a -m \"${{ env.COMMIT_MESSAGE }}\" -s --gpg-sign=${{ env.GPG_KEY_ID }}
42-
artifactory_image: ${{ inputs.artifactory_image }}
42+
ecr_repository: ${{ inputs.ecr_repository }}
4343
- name: Push the commit to the source branch
4444
shell: bash -eux {0}
4545
run: |

create-branch/action.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,10 @@ inputs:
2323
release_workflow_path:
2424
description: The path to the release workflow file
2525
default: .github/workflows/release.yml
26-
artifactory_image:
27-
description: Image to use for artifactory
28-
default: artifactory.corp.mongodb.com/release-tools-container-registry-public-local
29-
# Unused inputs, to be removed in V3.
30-
sbom_file_path:
31-
description: The path of the sbom-lite file
32-
default: sbom.json
33-
silk_group_prefix:
34-
description: The prefix to use for the silk asset group, defaults to the repo name
26+
ecr_repository:
27+
description: "The ECR repository to use"
28+
default: release-infrastructure/garasign-git
29+
3530
runs:
3631
using: composite
3732
steps:
@@ -43,11 +38,11 @@ runs:
4338
SBOM_FILE_PATH: ${{ inputs.sbom_file_path }}
4439
RELEASE_WORKFLOW_PATH: ${{ inputs.release_workflow_path }}
4540
EVERGREEN_PROJECT: ${{ inputs.evergreen_project }}
46-
ARTIFACTORY_IMAGE: ${{ inputs.artifactory_image }}
4741
run: ${{ github.action_path }}/create-branch.sh
48-
- uses: mongodb-labs/drivers-github-tools/bump-version@v2
42+
- uses: mongodb-labs/drivers-github-tools/bump-version@v3
4943
with:
5044
version: ${{ inputs.version }}
5145
version_bump_script: ${{ inputs.version_bump_script }}
5246
commit_template: "Prep branch ${{ inputs.branch_name }}"
53-
push_commit: ${{ inputs.push_changes }}
47+
push_commit: ${{ inputs.push_changes }}
48+
ecr_repository: ${{ inputs.ecr_repository }}

full-report/action.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,36 +31,32 @@ inputs:
3131
description: The distribution filename or glob pattern
3232
token:
3333
description: The GitHub access token
34-
# No longer used, to be removed in V3.
35-
silk_asset_group:
36-
description: The Silk Asset Group for the Project
3734

3835
runs:
3936
using: composite
4037
steps:
4138
- name: Generate Authorized Publication Report
42-
uses: mongodb-labs/drivers-github-tools/authorized-pub@v2
39+
uses: mongodb-labs/drivers-github-tools/authorized-pub@v3
4340
with:
4441
product_name: ${{ inputs.product_name }}
4542
release_version: ${{ inputs.release_version }}
4643
filenames: ${{ inputs.dist_filenames }}
4744
token: ${{ inputs.token }}
4845
- name: Generate SBOM File
49-
# not all packages have third party dependencies, and so not all packages integrate with silk.
50-
if: ${{ inputs.silk_asset_group }} || ${{ inputs.sbom_in_path }}
51-
uses: mongodb-labs/drivers-github-tools/sbom@v2
46+
# not all packages have third party dependencies, and so not all packages produce sboms.
47+
if: ${{ inputs.sbom_in_path }}
48+
uses: mongodb-labs/drivers-github-tools/sbom@v3
5249
with:
53-
silk_asset_group: ${{ inputs.silk_asset_group }}
5450
sbom_file_name: ${{ inputs.sbom_file_name }}
5551
kondukto_sub_project: ${{ inputs.kondukto_sub_project }}
5652
sbom_in_path: ${{ inputs.sbom_in_path }}
5753
- name: Generate Sarif File
58-
uses: mongodb-labs/drivers-github-tools/code-scanning-export@v2
54+
uses: mongodb-labs/drivers-github-tools/code-scanning-export@v3
5955
with:
6056
ref: ${{ inputs.sarif_report_target_ref || inputs.release_version }}
6157
output-file: ${{ env.S3_ASSETS }}/code-scanning-alerts.json
6258
- name: Generate Compliance Report
63-
uses: mongodb-labs/drivers-github-tools/compliance-report@v2
59+
uses: mongodb-labs/drivers-github-tools/compliance-report@v3
6460
with:
6561
release_version: ${{ inputs.release_version }}
6662
security_report_location: ${{ inputs.security_report_location }}

git-sign/action.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,28 @@ inputs:
44
command:
55
description: "Command to run inside the container"
66
required: true
7-
artifactory_image:
8-
description: "Image to use for artifactory"
9-
default: release-tools-container-registry-local/garasign-git
7+
ecr_registry:
8+
description: "The ECR registry to use"
9+
default: "901841024863.dkr.ecr.us-east-1.amazonaws.com"
10+
ecr_repository:
11+
description: "The ECR repository to use"
12+
default: release-infrastructure/garasign-git
1013

1114
runs:
1215
using: composite
1316
steps:
1417
- name: "Run git command"
18+
env:
19+
ECR_REGISTRY: ${{ inputs.ecr_registry }}
20+
ECR_REPOSITORY: ${{ inputs.ecr_repository }}
21+
COMMAND: ${{ inputs.command }}
1522
run: |
16-
podman run \
23+
WORKING_DIR=/home/git-checkout
24+
docker run \
1725
--env-file=$GARASIGN_ENVFILE \
1826
--rm \
19-
-v $(pwd):$(pwd) \
20-
-w $(pwd) \
21-
${ARTIFACTORY_REGISTRY}/${{ inputs.artifactory_image }} \
22-
/bin/bash -c "gpgloader && ${{ inputs.command }}"
27+
-v $(pwd):$WORKING_DIR \
28+
-w $WORKING_DIR \
29+
${ECR_REGISTRY}/${ECR_REPOSITORY} \
30+
/bin/bash -c "git config --global --add safe.directory $WORKING_DIR && gpgloader && ${COMMAND}"
2331
shell: bash

0 commit comments

Comments
 (0)