File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,29 @@ working directory.
148
148
uses: mongodb-labs/drivers-github-tools/code-scanning-export@v2
149
149
` ` `
150
150
151
+ # # Upload S3 assets
152
+
153
+ A number of scripts create files in the `tmp/s3_assets` folder, which then can
154
+ be uploaded to the product's S3 bucket :
155
+
156
+ ` ` ` yaml
157
+ - name: Setup
158
+ uses: mongodb-labs/drivers-github-tools/setup@v2
159
+ with:
160
+ ...
161
+
162
+ - name: Upload S3 assets
163
+ uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
164
+ with:
165
+ version: <release version>
166
+ product_name: <product_name>
167
+ ` ` `
168
+
169
+ Optionally, you can specify which files to upload using the `filenames` input.
170
+ By default, all files in the S3 directory are uploaded. When the `dry_run` input
171
+ is set to anything other than `false`, no files are uploaded, but instead the
172
+ filename along with the resulting location in the bucket is printed.
173
+
151
174
# # Python Helper Scripts
152
175
153
176
These scripts are opinionated helper scripts for Python releases.
Original file line number Diff line number Diff line change
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
+ dry_run :
15
+ description : " Only print files that would be uploaded, but don't upload any files"
16
+ required : false
17
+ default : ' false'
18
+
19
+ runs :
20
+ using : composite
21
+ steps :
22
+ - shell : bash
23
+ working-directory : ${{ env.S3_ASSETS }}
24
+ run : |
25
+ if [ "${{ inputs.dry_run }}" == "false" ]; then
26
+ for filename in ${{ inputs.filenames }}; do aws s3 cp ${filename} s3://${AWS_BUCKET}/${{ inputs.product_name }}/${{ inputs.version }}/${filename}; done
27
+ else
28
+ for filename in ${{ inputs.filenames }}; do echo "Would upload ${filename} to ${{ inputs.product_name }}/${{ inputs.version }}/${filename}"; done
29
+ fi
You can’t perform that action at this time.
0 commit comments