From fd51fbda045379ff9e3538b458e84bf210ac8def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Pe=C4=8Dovnik?= Date: Fri, 2 Sep 2022 16:47:29 +0200 Subject: [PATCH] Update update-cache.yml --- .github/workflows/update-cache.yml | 59 +++++++++++++++--------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/.github/workflows/update-cache.yml b/.github/workflows/update-cache.yml index 67140847..1e674be4 100644 --- a/.github/workflows/update-cache.yml +++ b/.github/workflows/update-cache.yml @@ -339,8 +339,8 @@ jobs: cat filename.cache cat arch.cache echo ${{ inputs.variant }} - ls -1 build/cache/rootfs.upload/$(cat version.cache)/$(cat arch.cache)*.zst | awk -F/ '{print $(NF-1)"/"$NF}' - MATRIX=$(ls -1 build/cache/rootfs.upload/$(cat version.cache)/$(cat arch.cache)*.zst | awk -F/ '{print $(NF-1)"/"$NF}') + #ls -1 build/cache/rootfs.upload/$(cat version.cache)/$(cat arch.cache)*.zst | awk -F/ '{print $(NF-1)"/"$NF}' + MATRIX=$(ls -1 build/cache/rootfs.upload/$(cat version.cache)/$(cat arch.cache)*.zst | awk -F/ '{print $NF}') echo ::set-output name=files::$(for x in $(echo "${MATRIX}"); do echo $x; done|jq -cnR '[inputs | select(length>0)]' | jq) sign: @@ -380,11 +380,11 @@ jobs: if [[ $(curl -s http://ifconfig.me) == "93.103.15.56" || $(curl -s http://ifconfig.me) == "46.19.33.90" ]]; then echo "Mounting NFS share" - sudo mount nas:/tank/armbian/users.armbian.com/upload/rootfs build/cache/rootfs.upload + sudo mount nas:/tank/armbian/users.armbian.com/upload/rootfs/$(cat version.cache) build/cache/rootfs.upload else echo "Mounting SSH share" - sudo sshfs upload@users.armbian.com:/rootfs build/cache/rootfs.upload -o IdentityFile=~/.ssh/id_rsa -o reconnect -o allow_other || true - sudo sshfs upload@users.armbian.com:/rootfs build/cache/rootfs.upload -o IdentityFile=~/.ssh/id_rsa -o reconnect -o nonempty,allow_other || true + sudo sshfs upload@users.armbian.com:/rootfs/$(cat version.cache) build/cache/rootfs.upload -o IdentityFile=~/.ssh/id_rsa -o reconnect -o allow_other || true + sudo sshfs upload@users.armbian.com:/rootfs/$(cat version.cache) build/cache/rootfs.upload -o IdentityFile=~/.ssh/id_rsa -o reconnect -o nonempty,allow_other || true fi - name: Signining and torrent creation @@ -393,29 +393,28 @@ jobs: sudo apt-get -y -qq install jq parallel buildtorrent - echo ${{ matrix.node }} - ls -l build/cache/rootfs.upload - -# FILE=$(ls -1 build/cache/rootfs/${{ matrix.node }} | awk -F/ '{print $NF}') -# ANNOUNCE=$(cat trackerslist/trackers_best_ip.txt | sed '/^$/d' | shuf -n 1) -# TRACKERS=$(cat trackerslist/trackers_best_ip.txt | sed '/^\s*$/d' | while read line; do printf ",""${line}"; done | cut -c 2-) -# WEBSEEDS="--webseeds="https://github.com/armbian/cache/releases/download/${{ needs.Prepare.outputs.rootfscache_version }}/$FILE,"$(curl -s https://cache.armbian.com/mirrors | jq -r '.'default' | .[] | values' | sed -e 's/$/rootfs\/'${{ needs.Prepare.outputs.rootfscache_version }}'\/'$FILE'/' | tr '\n' , | sed 's/.$//')" -# cd build/cache/rootfs -# rm -f *.current -# #TARGET=$(ls -1 *.zst) -# echo "Sign" -# echo ${{ secrets.GPG_PASSPHRASE1 }} | gpg --quiet --armor --batch --yes --passphrase-fd 0 --detach-sign --pinentry-mode loopback ${FILE} -# echo "Generate torrent" -# buildtorrent $WEBSEEDS --announce=$ANNOUNCE --announcelist=$TRACKERS $FILE -c "Armbian rootfs cache" ${FILE}.torrent + #echo ${{ matrix.node }} + FILE=${{ matrix.node }} + #ls -l build/cache/rootfs.upload/$(cat version.cache)/${{ matrix.node }} - # - name: Upload - # uses: ncipollo/release-action@v1 - # if: ${{ github.repository_owner == 'Armbian' }} - # with: - # artifacts: "build/cache/rootfs/*" - # artifactErrorsFailBuild: true - # tag: "${{ needs.Prepare.outputs.rootfscache_version }}" - # omitBody: true - # omitName: true - # allowUpdates: true - # token: ${{ secrets.PAT1 }} +# FILE=$(ls -1 build/cache/rootfs/${{ matrix.node }} | awk -F/ '{print $NF}') + ANNOUNCE=$(cat trackerslist/trackers_best_ip.txt | sed '/^$/d' | shuf -n 1) + TRACKERS=$(cat trackerslist/trackers_best_ip.txt | sed '/^\s*$/d' | while read line; do printf ",""${line}"; done | cut -c 2-) + WEBSEEDS="--webseeds="https://github.com/armbian/cache/releases/download/${{ needs.Prepare.outputs.rootfscache_version }}/$FILE,"$(curl -s https://cache.armbian.com/mirrors | jq -r '.'default' | .[] | values' | sed -e 's/$/rootfs\/'${{ needs.Prepare.outputs.rootfscache_version }}'\/'$FILE'/' | tr '\n' , | sed 's/.$//')" + cd build/cache/rootfs.upload + echo "Sign" + echo ${{ secrets.GPG_PASSPHRASE1 }} | gpg --quiet --armor --batch --yes --passphrase-fd 0 --detach-sign --pinentry-mode loopback ${FILE} + echo "Generate torrent" + buildtorrent $WEBSEEDS --announce=$ANNOUNCE --announcelist=$TRACKERS $FILE -c "Armbian rootfs cache" ${FILE}.torrent + + - name: Upload + uses: ncipollo/release-action@v1 + if: ${{ github.repository_owner == 'Armbian' }} + with: + artifacts: "build/cache/rootfs/*.asc" + artifactErrorsFailBuild: true + tag: "${{ needs.Prepare.outputs.rootfscache_version }}" + omitBody: true + omitName: true + allowUpdates: true + token: ${{ secrets.PAT1 }}