2023-02-10 06:40:56 -05:00
|
|
|
name: Upload to AWS S3
|
|
|
|
|
|
|
|
inputs:
|
|
|
|
source:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
|
|
|
|
destination:
|
2023-02-10 12:33:13 -05:00
|
|
|
required: false
|
2023-02-10 06:40:56 -05:00
|
|
|
type: string
|
|
|
|
|
2023-02-10 12:33:13 -05:00
|
|
|
AWS_ACCESS_KEY_ID:
|
|
|
|
required: true
|
|
|
|
|
|
|
|
AWS_SECRET_ACCESS_KEY:
|
|
|
|
required: true
|
2023-02-10 06:40:56 -05:00
|
|
|
|
|
|
|
runs:
|
|
|
|
using: composite
|
|
|
|
steps:
|
|
|
|
- name: Upload to S3
|
|
|
|
if: >-
|
|
|
|
(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'adafruit') ||
|
|
|
|
(github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
|
2023-02-10 12:33:13 -05:00
|
|
|
run: >-
|
|
|
|
[ -z "$AWS_ACCESS_KEY_ID" ] ||
|
2023-02-15 22:23:18 -05:00
|
|
|
aws s3 cp ${{ inputs.source }} s3://adafruit-circuit-python/bin/${{ inputs.destination }}
|
|
|
|
${{ endsWith(inputs.source, '/') && '--recursive' || '' }} --no-progress --region us-east-1
|
2023-02-10 06:40:56 -05:00
|
|
|
env:
|
|
|
|
AWS_PAGER: ''
|
2023-02-10 12:33:13 -05:00
|
|
|
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
|
|
|
|
shell: bash
|