Skip to content

Commit e0ad018

Browse files
add upload to s3 capability
1 parent 3a962aa commit e0ad018

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
name: Publish Python
3+
description: "Publish Assets and Report"
4+
inputs:
5+
version:
6+
description: "The published version"
7+
required: true
8+
product_name:
9+
description: "The name of the product"
10+
required: true
11+
files:
12+
description: file to upload
13+
required: true
14+
dry_run:
15+
description: "Whether this is a dry run"
16+
required: true
17+
18+
runs:
19+
using: composite
20+
steps:
21+
- name: Run publish script
22+
shell: bash
23+
run: |
24+
set -eux
25+
if [ "$DRY_RUN" == "false" ]; then
26+
echo "Uploading Release Reports"
27+
TARGET=s3://${AWS_BUCKET}/${PRODUCT_NAME}/${VERSION}
28+
aws s3 cp $FILES $TARGET
29+
else
30+
echo "Dry run, not uploading to S3 or creating GitHub Release"
31+
echo "Would upload $FILES"
32+
fi
33+
env:
34+
VERSION: ${{ inputs.version }}
35+
PRODUCT_NAME: ${{ inputs.product_name }}
36+
DRY_RUN: ${{ inputs.dry_run }}
37+
FILES: ${{ inputs.files }}
38+

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,11 @@ jobs:
7373
run: |
7474
ls ${{ env.S3_ASSETS }}
7575
cat ${{ env.S3_ASSETS }}/sarif-report.json
76+
77+
- name: actions/publish_asset_to_s3
78+
uses: ./.github/actions/publish_asset_to_s3
79+
with:
80+
version: v6.5.0
81+
product_name: js-bson-development
82+
files: sarif-report.json
83+
dry_run: false

0 commit comments

Comments
 (0)