diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index c37384b2c..2dba45188 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -175,3 +175,29 @@ jobs: curl --fail -X PUT -u "${{ secrets.APTLY_API_AUTH }}" \ https://packages.termux.org/aptly-api/publish/${REPOSITORY_NAME}/${REPOSITORY_DISTRIBUTION} fi + - name: Setup ssh key and known_hosts + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + run: | + mkdir -p ~/.ssh + echo "${{ secrets.KNOWN_HOST_ENTRY }}" >> ~/.ssh/known_hosts + ssh-agent -a $SSH_AUTH_SOCK + ssh-add - <<< "${{ secrets.SSHKEY }}" + - name: Upload to grimler.se + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + run: | + # Zip the deb archives to only do one transfer to the repo. + # 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" + deb_archives=$(find -maxdepth 1 -name "debs-*-${{ github.sha }}.tar") + + if [ -z "$deb_archives" ]; then + echo "No archives to upload found" + exit 0 + fi + zip $archive ${deb_archives} + sftp -P ${{ secrets.PORT }} ${{ secrets.USER }}@grimler.se <