Skip to content

Commit e189779

Browse files
committed
Add action to upload S3 assets
1 parent 96872d0 commit e189779

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,27 @@ This action will download an Augmented SBOM file in `$RELEASE_ASSETS/sbom.json`.
132132
silk_asset_group: mongodb-python-driver
133133
```
134134

135+
## Upload S3 assets
136+
137+
A number of scripts create files in the `tmp/s3_assets` folder, which then can
138+
be uploaded to the product's S3 bucket:
139+
140+
```yaml
141+
- name: Setup
142+
uses: mongodb-labs/drivers-github-tools/setup@v2
143+
with:
144+
...
145+
146+
- name: Upload S3 assets
147+
uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
148+
with:
149+
version: <release version>
150+
product_name: <product_name>
151+
```
152+
153+
Optionally, you can specify which files to upload using the `filenames` input.
154+
By default, all files in the S3 directory are uploaded.
155+
135156
## Python Helper Scripts
136157

137158
These scripts are opinionated helper scripts for Python releases.
@@ -177,4 +198,4 @@ If `dry_run` is set, nothing will be published or pushed.
177198
product_name: winkerberos
178199
token: ${{ github.token }}
179200
dry_run: ${{ inputs.dry_run }}
180-
```
201+
```

upload-s3-assets/action.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Upload S3 assets
2+
description: Uploads assets from the S3 asset directory
3+
inputs:
4+
version:
5+
description: "The published version"
6+
required: true
7+
product_name:
8+
description: "The name of the product"
9+
required: true
10+
filenames:
11+
description: Files to upload - supports wildcards and glob patterns
12+
default: '*'
13+
required: false
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- shell: bash
19+
working-directory: ${{ env.S3_ASSETS }}
20+
run: |
21+
for filename in ${{ inputs.filenames }}; do aws s3 cp ${filename} s3://${AWS_BUCKET}/${{ inputs.product_name }}/${{ inputs.version }}/${filename}; done

0 commit comments

Comments
 (0)