From eff7ea1ee0ef7c5bbefbebce6dc5554081f65bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Pe=C4=8Dovnik?= Date: Tue, 9 Aug 2022 10:13:48 +0200 Subject: [PATCH] Update update-cache.yml --- .github/workflows/update-cache.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/update-cache.yml b/.github/workflows/update-cache.yml index ec8aa7df..c0e06853 100644 --- a/.github/workflows/update-cache.yml +++ b/.github/workflows/update-cache.yml @@ -138,6 +138,14 @@ jobs: path: trackerslist clean: false + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPG_KEY1 }} + passphrase: ${{ secrets.GPG_PASSPHRASE1 }} + workdir: build + git_user_signingkey: true + - name: Copy templates run: | @@ -256,6 +264,21 @@ jobs: cd .. ls -l build/cache/rootfs || true + + - name: Signing + run: | + + sudo apt-get -y -qq install parallel buildtorrent + ANNOUNCE=$(cat trackerslist/trackers_best_ip.txt | head -1)ANNOUNCE=$(cat trackerslist/trackers_best_ip.txt | sed '/^$/d' | shuf -n 1) + TRACKERS=$(cat trackerslist/trackers_all.txt | sed '/^\s*$/d' | while read line; do printf ",""${line}"; done | cut -c 2-) + WEBSEEDS="--webseeds="https://github.com/armbian/cache/releases/download/${{ needs.release-start.outputs.rootfscache_version }}/\$FILE,"$(curl -s https://cache.armbian.com/mirrors | jq -r '.'default' | .[] | values' | sed -e 's/$/rootfs\/${{ needs.release-start.outputs.rootfscache_version }}\/$FILE/' | tr '\n' , | sed 's/.$//')" + cd build/cache/rootfs.upload/${{ needs.release-start.outputs.rootfscache_version }} + TARGET=$(ls -1 *.lz4) + echo "Signing" + echo ${{ secrets.GPG_PASSPHRASE1 }} | gpg --quiet --armor --batch --yes --passphrase-fd 0 --detach-sign --pinentry-mode loopback *.lz4 + echo "Torrent" + buildtorrent -q -s -m '$WEBSEEDS' --announce="'$ANNOUNCE'" --announcelist="'$TRACKERS'" $TARGET -c "Armbian rootfs cache" ${TARGET}.torrent >/dev/null + - name: Upload uses: ncipollo/release-action@v1 if: ${{ github.repository_owner == 'Armbian' }}