From 3ede21be70c0df504cbaf00057b9be2d4ebfcc7e Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Sun, 14 Feb 2021 16:34:26 +0100 Subject: [PATCH] CI: upload debs to grimler.se as well Will turn off the bintray mirroring for grimler.se once I confirm (as well as I can) that this works as intended. Will upload a wiki page with some information about how this is set up on the server in case someone wants to make a similar setup. Also use v2 for upload- and download-artifact. --- .github/workflows/packages.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 51d68ec4fd..89169de400 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -98,7 +98,7 @@ jobs: run: | find debs -type f -name "*.deb" -exec sha256sum "{}" \; | sort -k2 - name: Store *.deb files - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v2 with: name: termux-packages path: ./artifacts @@ -110,7 +110,7 @@ jobs: - name: Clone repository uses: actions/checkout@v2 - name: Get *.deb files - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v2 with: name: termux-packages path: ./ @@ -134,3 +134,26 @@ jobs: if [ -n "$TO_UPLOAD" ]; then ./scripts/package_uploader.sh -p ./debs $TO_UPLOAD 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: Get *.deb files + uses: actions/download-artifact@v2 + with: + name: termux-packages + - 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. + zip termux-packages.zip debs-aarch64.tar debs-arm.tar debs-i686.tar debs-x86_64.tar + sftp -P ${{ secrets.PORT }} ${{ secrets.USER }}@grimler.se <