couple ci fixes

- upload stubs as `.tar.gz` instead of `.zip`
- append recursive flag only when the source ends with a backslash
This commit is contained in:
MicroDev 2023-02-16 08:53:18 +05:30
parent ca24cff0d3
commit 3036348f72
No known key found for this signature in database
GPG Key ID: 2C0867BE60967730
2 changed files with 3 additions and 7 deletions

View File

@ -24,7 +24,8 @@ runs:
(github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
run: >- run: >-
[ -z "$AWS_ACCESS_KEY_ID" ] || [ -z "$AWS_ACCESS_KEY_ID" ] ||
aws s3 cp ${{ inputs.source }} s3://adafruit-circuit-python/bin/${{ inputs.destination }} --recursive --no-progress --region us-east-1 aws s3 cp ${{ inputs.source }} s3://adafruit-circuit-python/bin/${{ inputs.destination }}
${{ endsWith(inputs.source, '/') && '--recursive' || '' }} --no-progress --region us-east-1
env: env:
AWS_PAGER: '' AWS_PAGER: ''
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }} AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}

View File

@ -200,16 +200,11 @@ jobs:
with: with:
name: docs name: docs
path: _build/latex path: _build/latex
- name: Zip stubs
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'))
run: zip -9r circuitpython-stubs.zip circuitpython-stubs
- name: Upload to S3 - name: Upload to S3
uses: ./.github/actions/upload_aws uses: ./.github/actions/upload_aws
with: with:
source: circuitpython-stubs/dist/*.tar.gz source: circuitpython-stubs/dist/*.tar.gz
destination: stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip destination: stubs/circuitpython-stubs-${{ env.CP_VERSION }}.tar.gz
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Upload stubs to PyPi - name: Upload stubs to PyPi