From d166d163777f0241650aea015a73ffa28d6ebc2a Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Mon, 14 Jun 2021 19:21:01 +0200 Subject: [PATCH] Githug Actions bugfix and optimisations --- .github/workflows/build-single.yml | 30 +++++++++++----------- .github/workflows/build.yml | 40 ++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-single.yml b/.github/workflows/build-single.yml index c6c4b2568c..8b91315bd1 100644 --- a/.github/workflows/build-single.yml +++ b/.github/workflows/build-single.yml @@ -69,7 +69,7 @@ jobs: with: gpg-private-key: ${{ secrets.GPG_KEY1 }} passphrase: ${{ secrets.GPG_PASSPHRASE1 }} - workdir: scripts + workdir: build git-user-signingkey: true git-commit-gpgsign: true @@ -103,6 +103,16 @@ jobs: [[ "${REPOSITORY}" != "yes" ]] && ./compile.sh single IGNORE_HASH="yes" REPOSITORY_INSTALL="${REPOSITORY_INSTALL}" REBUILD_IMAGES="${REBUILD_IMAGES}" KERNEL_ONLY="yes" BETA="no" BUILD_ALL="yes" BSP_BUILD="yes" MAKE_ALL_BETA="yes" ./compile.sh single MULTITHREAD="${PARALLEL_BUILDS}" REPOSITORY_INSTALL="${REPOSITORY_INSTALL}" IGNORE_HASH="yes" IGNORE_UPDATES="yes" REBUILD_IMAGES="${REBUILD_IMAGES}" KERNEL_ONLY="no" BETA="no" BUILD_ALL="yes" GPG_PASS="${GPG_PASS}" + - name: Import GPG key + + uses: crazy-max/ghaction-import-gpg@v3 + with: + gpg-private-key: ${{ secrets.GPG_KEY2 }} + passphrase: ${{ secrets.GPG_PASSPHRASE2 }} + workdir: scripts + git-user-signingkey: true + git-commit-gpgsign: true + - name: Make BSP packages if we build from sources if: ${{ success() && github.event.inputs.repository != 'yes' }} @@ -132,15 +142,15 @@ jobs: git config --global user.name "Armbianworker" git pull git add VERSION - git commit -m "Bump stable version" -m "" -m "Adding following kernels:" -m "$(find output/debs-beta/ -type f -name "linux-image*.deb" -printf "%f\n" | sort)" + git commit -m "Bump stable version" -m "" -m "Adding following kernels:" -m "$(find output/debs/ -type f -name "linux-image*.deb" -printf "%f\n" | sort)" git push - name: Install SSH key for storage uses: shimataro/ssh-key-action@v2 with: - key: ${{ secrets.KEY_FOR_TORRENT }} - known_hosts: ${{ secrets.KNOWN_HOSTS_TORRENT }} + key: ${{ secrets.KEY_TORRENTS }} + known_hosts: ${{ secrets.KNOWN_HOSTS_UPLOAD }} if_key_exists: replace - name: Deploy images to server @@ -208,15 +218,3 @@ jobs: - name: Create torrents run: ssh -T -i ~/.ssh/id_torrent ${{ secrets.USER_TORRENTS }}@${{ secrets.HOST_TORRENTS }} - - - finish: - - name: Cleaning - needs: [torrents, repository] - runs-on: [self-hosted, Linux] - steps: - - name: Run script - shell: bash {0} - run: | - echo "Stop" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3542aafbd7..90dffcf763 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,6 +62,19 @@ jobs: - name: Fix permissions run: | + # make sure no temporally dirs are mounted from previous runs + while : + do + sudo pkill compile.sh || true + sudo pkill arm-binfmt-P || true + sudo pkill aarch64-binfmt-P || true + sudo pkill pixz || true + [[ "$(df | grep "/.tmp" | wc -l)" -eq 0 ]] && sudo rm -rf build/.tmp && break + echo "Mounted temp directories. Trying to unmount." + df | grep ".tmp" | awk '{print $6}' | xargs sudo umount 2>/dev/null || true + sleep 10 + done + sudo chown -R $USER:$USER . - name: Checkout Armbian build script @@ -149,6 +162,7 @@ jobs: steps: - name: Fix permissions + run: | sudo chown -R $USER:$USER . @@ -225,6 +239,19 @@ jobs: run: | + # make sure no temporally dirs are mounted from previous runs + while : + do + sudo pkill compile.sh || true + sudo pkill arm-binfmt-P || true + sudo pkill aarch64-binfmt-P || true + sudo pkill pixz || true + [[ "$(df | grep "/.tmp" | wc -l)" -eq 0 ]] && sudo rm -rf build/.tmp && break + echo "Mounted temp directories. Trying to unmount." + df | grep ".tmp" | awk '{print $6}' | xargs sudo umount 2>/dev/null || true + sleep 10 + done + sudo chown -R $USER:$USER . - name: Checkout Armbian build script @@ -369,6 +396,19 @@ jobs: run: | + # make sure no temporally dirs are mounted from previous runs + while : + do + sudo pkill compile.sh || true + sudo pkill arm-binfmt-P || true + sudo pkill aarch64-binfmt-P || true + sudo pkill pixz || true + [[ "$(df | grep "/.tmp" | wc -l)" -eq 0 ]] && sudo rm -rf build/.tmp && break + echo "Mounted temp directories. Trying to unmount." + df | grep ".tmp" | awk '{print $6}' | xargs sudo umount 2>/dev/null || true + sleep 10 + done + sudo chown -R $USER:$USER . - name: Checkout Armbian build script