From e339ad8a1e457bf9023ad5eab22c618b9dd5090b Mon Sep 17 00:00:00 2001 From: SoundDrill31 <84176052+sounddrill31@users.noreply.github.com> Date: Fri, 26 Apr 2024 11:22:15 +0530 Subject: [PATCH] Upload: Simplify setting upload limits --- .github/workflows/main.yml | 10 +--------- .github/workflows/selfhosted.yml | 20 ++------------------ 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index acd55f83..53fe1459 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -390,17 +390,9 @@ jobs: - name: Upload build artifact(s) run: | cd $PROJECTFOLDER - - if [[ -n "${{ secrets.GH_UPLOAD_LIMIT }}" ]]; then - export GH_UPLOAD_LIMIT="${{ secrets.GH_UPLOAD_LIMIT }}" - echo "Custom Upload unit found, using $GH_UPLOAD_LIMIT!" - else - echo "Custom Upload unit not found, using default!" - fi - echo "${{ secrets.GITHUB_TOKEN }}" > token.txt crave push token.txt -d $(crave ssh -- pwd | grep -v Select | sed -s 's/\r//g')/ - crave ssh -- "bash /opt/crave/github-actions/upload.sh '${{ github.run_id }}' '${{ github.event.inputs.DEVICE_NAME }}' '${{ github.repository }}' '${{ github.event.inputs.PRODUCT_NAME }}-${{ github.run_id }}' '${{ secrets.EXTRA_FILES }}'" + crave ssh -- "export GH_UPLOAD_LIMIT="${{ secrets.GH_UPLOAD_LIMIT }}"; bash /opt/crave/github-actions/upload.sh '${{ github.run_id }}' '${{ github.event.inputs.DEVICE_NAME }}' '${{ github.repository }}' '${{ github.event.inputs.PRODUCT_NAME }}-${{ github.run_id }}' '${{ secrets.EXTRA_FILES }}'" # Pull Errors and Display them - name: Display error.log diff --git a/.github/workflows/selfhosted.yml b/.github/workflows/selfhosted.yml index 452ab952..c12aee0e 100644 --- a/.github/workflows/selfhosted.yml +++ b/.github/workflows/selfhosted.yml @@ -419,17 +419,9 @@ jobs: continue-on-error: true run: | cd $PROJECTFOLDER - - if [[ -n "${{ secrets.GH_UPLOAD_LIMIT }}" ]]; then - export GH_UPLOAD_LIMIT="${{ secrets.GH_UPLOAD_LIMIT }}" - echo "Custom Upload unit found, using $GH_UPLOAD_LIMIT!" - else - echo "Custom Upload unit not found, using default!" - fi - echo "${{ secrets.GITHUB_TOKEN }}" > token.txt crave push token.txt -d $(crave ssh -- pwd | grep -v Select | sed -s 's/\r//g')/ - crave ssh -- "bash /opt/crave/github-actions/upload.sh '${{ github.run_id }}' '${{ github.event.inputs.DEVICE_NAME }}' '${{ github.repository }}' '${{ github.event.inputs.PRODUCT_NAME }}-${{ github.run_id }}' '${{ secrets.EXTRA_FILES }}'" + crave ssh -- "export GH_UPLOAD_LIMIT="${{ secrets.GH_UPLOAD_LIMIT }}"; bash /opt/crave/github-actions/upload.sh '${{ github.run_id }}' '${{ github.event.inputs.DEVICE_NAME }}' '${{ github.repository }}' '${{ github.event.inputs.PRODUCT_NAME }}-${{ github.run_id }}' '${{ secrets.EXTRA_FILES }}'" # Pull Errors and Display them - name: Display error.log @@ -446,15 +438,7 @@ jobs: - name: Upload Using telegram-upload run: | cd $PROJECTFOLDER - - if [[ -n "${{ secrets.TG_UPLOAD_LIMIT }}" ]]; then - export TG_UPLOAD_LIMIT="${{ secrets.TG_UPLOAD_LIMIT }}" - echo "Custom Upload unit found, using $TG_UPLOAD_LIMIT!" - else - echo "Custom Upload unit not found, using default!" - fi - - crave ssh -- "bash /opt/crave/telegram/upload.sh '${{ github.event.inputs.DEVICE_NAME }}' '${{ secrets.EXTRA_FILES }}'" + crave ssh -- "export TG_UPLOAD_LIMIT="${{ secrets.TG_UPLOAD_LIMIT }}"; bash /opt/crave/telegram/upload.sh '${{ github.event.inputs.DEVICE_NAME }}' '${{ secrets.EXTRA_FILES }}'" continue-on-error: true # Remove 'crave' clone