workflows: do not error on upload step if there are no debs

As is the case when using ci:no-build for example.
This commit is contained in:
Henrik Grimler 2021-05-15 22:21:45 +02:00
parent 6d0883d177
commit 9f44c4f496
1 changed files with 9 additions and 4 deletions

View File

@ -164,7 +164,12 @@ jobs:
# This makes it easier to parse it, we can run one update job
# instead of one for each arch on the server.
archive="termux-packages-${{ github.sha }}.zip"
zip $archive debs-*-${{ github.sha }}.tar
sftp -P ${{ secrets.PORT }} ${{ secrets.USER }}@grimler.se <<EOF
put $archive /debs/
EOF
deb_archives=$(find -maxdepth -name "debs-*-${{ github.sha }}.tar")
if [ -n "$deb_archives" ]; then
zip $archive ${deb_archives}
sftp -P ${{ secrets.PORT }} ${{ secrets.USER }}@grimler.se <<EOF
put $archive /debs/
EOF
else
echo "No archives to upload found"
fi