diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 3503210b2..8c794cfa3 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -99,19 +99,7 @@ jobs: - name: Upload Artifacts to AWS S3 run: | - aws s3 cp ./dist/ s3://${{ secrets.AWS_S3_BUCKET }} \ - --recursive \ - --exclude "*" \ - --include "*.gz" \ - --include "*.txt" \ - - - name: Set Artifacts Retention - if: ${{ !startsWith(github.ref, 'refs/tags/v') }} - run: | - ls -1 ./dist | grep '\.gz\|\.txt$' | while read -r file; do - echo "Tagging uploaded file $file for auto delete" - aws s3api put-object-tagging \ - --bucket ${{ secrets.AWS_S3_BUCKET }} \ - --key "$file" \ - --tagging 'TagSet=[{Key=AutoDelete,Value=true}]' - done + find /tmp/dist \ + -type f \( -name "*.gz" -o -name "*.txt" \) \ + -exec aws s3 cp {} s3://${{ secrets.AWS_S3_BUCKET }}/ \; \ + -exec aws s3api put-object-tagging --bucket ${{ secrets.AWS_S3_BUCKET }} --key $(basename {}) --tagging 'TagSet=[{Key=AutoDelete,Value=true}]' \;