Skip to content

Commit

Permalink
Upload: Simplify setting upload limits
Browse files Browse the repository at this point in the history
  • Loading branch information
sounddrill31 authored Apr 26, 2024
1 parent e1f46a6 commit e339ad8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 27 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 2 additions & 18 deletions .github/workflows/selfhosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e339ad8

Please sign in to comment.