From 7f556dc1b99a100a9e652de9e9b9b21bcab64c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Pe=C4=8Dovnik?= Date: Sat, 25 Dec 2021 23:05:04 +0100 Subject: [PATCH] Assemble needed runs into a GH Actions build train (#3366) --- .github/workflows/build-beta-desktop.yml | 3 - .github/workflows/build-beta-images.yml | 17 +- .github/workflows/build-beta-kernel.yml | 487 ------------------ .github/workflows/build-cache.yml | 1 + .github/workflows/build-docker.yml | 120 +---- .../build-kernel-on-merge-request.yml | 192 ++----- .github/workflows/build-test-image-docker.yml | 88 +--- .github/workflows/build-train.yml | 377 ++++++++++++++ .github/workflows/build-u-boot.yml | 3 - .github/workflows/maintain.yml | 102 +--- .github/workflows/update-repository.yml | 59 +-- 11 files changed, 482 insertions(+), 967 deletions(-) delete mode 100644 .github/workflows/build-beta-kernel.yml create mode 100644 .github/workflows/build-train.yml diff --git a/.github/workflows/build-beta-desktop.yml b/.github/workflows/build-beta-desktop.yml index edb053a55c3f..d2431af0ee4a 100644 --- a/.github/workflows/build-beta-desktop.yml +++ b/.github/workflows/build-beta-desktop.yml @@ -2,9 +2,6 @@ name: Beta Desktop on: workflow_dispatch: - workflow_run: - workflows: ["Beta Kernel"] - types: [completed] jobs: diff --git a/.github/workflows/build-beta-images.yml b/.github/workflows/build-beta-images.yml index b50859536b17..61cbc97e6e68 100644 --- a/.github/workflows/build-beta-images.yml +++ b/.github/workflows/build-beta-images.yml @@ -5,11 +5,26 @@ on: jobs: + fake: + runs-on: ubuntu-latest + name: Source changes + if: ${{ github.repository_owner == 'Armbian' }} + steps: + - run: | + echo "not empty" > changes + - uses: actions/upload-artifact@v2 + with: + path: changes + name: changes + if-no-files-found: ignore + merge: - uses: armbian/scripts/.github/workflows/merge-from-branch.yml@master + needs: [ fake ] + uses: armbian/scripts/.github/workflows/merge-from-branch.yml@master with: branch: 'nightly' + runner: small secrets: GPG_KEY2: ${{ secrets.GPG_KEY2 }} diff --git a/.github/workflows/build-beta-kernel.yml b/.github/workflows/build-beta-kernel.yml deleted file mode 100644 index d421fe65b9f2..000000000000 --- a/.github/workflows/build-beta-kernel.yml +++ /dev/null @@ -1,487 +0,0 @@ -name: Beta Kernel - -on: - schedule: - - cron: '0 4 * * *' - - workflow_dispatch: - inputs: - - release_type: - description: 'Release type: nightly | stable | edge' - required: false - default: 'nightly' - -jobs: - - Merge: - uses: armbian/scripts/.github/workflows/merge-from-branch.yml@master - - with: - branch: 'nightly' - - secrets: - GPG_KEY2: ${{ secrets.GPG_KEY2 }} - GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} - - Prepare: - - name: "Finding changed kernels" - needs: [ Merge ] - runs-on: [self-hosted, Linux, small] - if: ${{ github.repository_owner == 'Armbian' }} - outputs: - matrix: ${{steps.list_dirs.outputs.matrix}} - steps: - - - name: Cache build parameters - uses: actions/cache@v2 - env: - cache-name: build-kernel - with: - path: build-kernel - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.run_id }} - - - name: Store matrix values - run: | - mkdir -p build-kernel - echo "${{ github.event.inputs.release_type }}" > build-kernel/build_type - - - name: Store environment variables values - run: | - - echo "FILE_EXT=-beta" >> $GITHUB_ENV - echo "REPO_DEST=nightly" >> $GITHUB_ENV - echo "BETA=yes" >> $GITHUB_ENV - if [[ "$(cat build-kernel/build_type 2> /dev/null || true)" =~ "stable|edge" ]]; then - echo "FILE_EXT=" >> $GITHUB_ENV - echo "REPO_DEST=master" >> $GITHUB_ENV - echo "BETA=no" >> $GITHUB_ENV - fi - - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/build - path: build - ref: ${{ env.REPO_DEST }} - clean: false - - - name: Checkout support scripts - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/scripts - path: scripts - clean: true - - - name: Fix permissions - if: ${{ success() }} - 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 - sudo mountpoint -q build/output/images && sudo fusermount -u build/output/images || true - [[ "$(df | grep "/.tmp" | wc -l)" -eq 0 && $(sudo mountpoint -q build/output/images; echo $?) -eq 1 ]] && 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 - [[ -d build/.git ]] && sudo chown -R $USER:$USER build/.git || true - [[ -d build/output/images ]] && sudo rm -rf build/output/images/* || true - - - name: Determine changed kernels - run: | - - cd build - BETA="${{ env.BETA }}" - FILE_EXT="${{ env.FILE_EXT }}" - # we enforce family skip only for kernel building - sudo rm -f userpatches/family.skip - #sudo rm -rf cache/sources - #./compile.sh KERNEL_ONLY="yes" BOARD="bananapi" BRANCH="current" KERNEL_CONFIGURE="no" BETA="$BETA" REPOSITORY_INSTALL="u-boot,kernel" 'prepare_host' - [[ ! -f .ignore_changes ]] && sudo touch .ignore_changes - if [[ $(curl -s http://ifconfig.me) == "93.103.15.56" ]]; then - sudo mkdir -p cache/toolchain cache/rootfs || true - # umount - sudo umount cache/toolchain || true - # erase below - sudo mountpoint -q cache/toolchain && sudo rm -rf cache/toolchain/* - ! sudo mountpoint -q cache/toolchain && sudo rm -rf cache/toolchain/* && sudo mount nas:/tank/armbian/toolchain.armbian.com cache/toolchain -o rsize=32768,wsize=32768,timeo=5,retrans=2,actimeo=60,retry=15 || true - ! sudo mountpoint -q cache/rootfs && sudo rm -rf cache/rootfs/* && sudo mount nas:/tank/armbian/dl.armbian.com/_rootfs cache/rootfs -o rsize=32768,wsize=32768,timeo=5,retrans=2,actimeo=60,retry=15 || true - fi - sudo mkdir -p cache/hash${FILE_EXT} userpatches/ - sudo rsync -ar --delete ../scripts/hash${FILE_EXT}/. cache/hash${FILE_EXT}/ 2> /dev/null - sudo cp ../scripts/configs/* userpatches/ - sudo rm -f userpatches/targets.conf - if [[ "$(cat ../build-kernel/build_type 2> /dev/null || true)" =~ stable|edge ]]; then - cat config/targets.conf | grep edge | grep cli | grep hirsute | sudo tee userpatches/targets.conf 1>/dev/null - echo "FILE_EXT=" >> $GITHUB_ENV - echo "REPO_DEST=master" >> $GITHUB_ENV - echo "BETA=no" >> $GITHUB_ENV - fi - - - name: Prepare build matrix - id: list_dirs - run: | - - BETA="${{ env.BETA }}" - MATRIX=$(cd build;./compile.sh all-new-beta-kernels BETA="$BETA" BUILD_ALL="demo" | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" | egrep "^[0-9]" | awk '{ print $2 ":" $4 ":" $3 }' | tr -d '(),' | sort | uniq) - mkdir -p build-kernel - echo "no" > build-kernel/skip - if [[ -z "$MATRIX" ]]; then - MATRIX="none:none:none" - echo "yes" > build-kernel/skip - fi - echo ::set-output name=matrix::$(for x in $(echo "${MATRIX}"); do echo $x; done|jq -cnR '[inputs | select(length>0)]' | jq) - - Linux: - - name: "Build Linux" - needs: [ Prepare ] - runs-on: [self-hosted, Linux, fast] # lets run this on runners labelled with 'fast' - if: ${{ github.repository_owner == 'armbian' }} - timeout-minutes: 480 - strategy: - fail-fast: false - matrix: - node: ${{fromJson(needs.Prepare.outputs.matrix)}} - - steps: - - - name: Install SSH key for storage - uses: shimataro/ssh-key-action@v2 - with: - key: ${{ secrets.KEY_TORRENTS }} - known_hosts: ${{ secrets.KNOWN_HOSTS_UPLOAD }} - if_key_exists: replace - - - name: Checkout Armbian support scripts - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/scripts - path: scripts - clean: true - - - name: Cache Gradle packages - uses: actions/cache@v2 - env: - cache-name: build-kernel - with: - path: build-kernel - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.run_id }}-linux - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.run_id }}-linux - ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.run_id }} - - - name: Read value - run: | - - echo "FILE_EXT=-beta" >> $GITHUB_ENV - echo "REPO_DEST=nightly" >> $GITHUB_ENV - echo "BETA=yes" >> $GITHUB_ENV - if [[ "$(cat build-kernel/build_type 2> /dev/null || true)" =~ stable|edge ]]; then - echo "FILE_EXT=" >> $GITHUB_ENV - echo "REPO_DEST=master" >> $GITHUB_ENV - echo "BETA=no" >> $GITHUB_ENV - fi - - - name: Fix permissions - if: ${{ success() }} - 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 - sudo mountpoint -q build/output/images && sudo fusermount -u build/output/images || true - [[ "$(df | grep "/.tmp" | wc -l)" -eq 0 && $(sudo mountpoint -q build/output/images; echo $?) -eq 1 ]] && 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 - [[ -d build/.git ]] && sudo chown -R $USER:$USER build/.git || true - [[ -d build/output/images ]] && sudo rm -rf build/output/images/* || true - - - name: Checkout Armbian build script - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/build - path: build - ref: ${{ env.REPO_DEST }} - clean: false - - - name: Build - run: | - - if [[ "$(cat build-kernel/skip 2> /dev/null || true)" == "no" ]]; then - - CHUNK="${{ matrix.node }}" - BETA="${{ env.BETA }}" - FILE_EXT="${{ env.FILE_EXT }}" - BOARD=$(echo $CHUNK | cut -d":" -f1) - BRANCH=$(echo $CHUNK | cut -d":" -f2) - FAMILY=$(echo $CHUNK | cut -d":" -f3) - - echo "FILE_NAME=${FAMILY}-${BRANCH}" >> $GITHUB_ENV - cd build - sudo rm -f cache/hash${FILE_EXT}/* - [[ ! -f .ignore_changes ]] && sudo touch .ignore_changes - #./compile.sh KERNEL_ONLY="yes" BOARD="bananapi" BRANCH="current" KERNEL_CONFIGURE="no" REPOSITORY_INSTALL="u-boot,kernel" 'prepare_host_basic' - if [[ $(curl -s http://ifconfig.me) == "93.103.15.56" ]]; then - sudo mkdir -p cache/toolchain cache/rootfs || true - ! sudo mountpoint -q cache/toolchain && sudo mount nas:/tank/armbian/toolchain.armbian.com cache/toolchain -o rsize=32768,wsize=32768,timeo=5,retrans=2,actimeo=60,retry=15 || true - ! sudo mountpoint -q cache/rootfs && sudo mount nas:/tank/armbian/dl.armbian.com/_rootfs cache/rootfs -o rsize=32768,wsize=32768,timeo=5,retrans=2,actimeo=60,retry=15 || true - fi - sudo rm -rf output/debs* - ./compile.sh ARMBIAN_MIRROR="https://github.com/armbian/mirror/releases/download/" BOARD="$BOARD" CLEAN_LEVEL="alldebs" \ - PRIVATE_CCACHE="yes" BETA="$BETA" KERNEL_ONLY="yes" BRANCH="$BRANCH" KERNEL_CONFIGURE="no" OFFLINE="no" - if [[ $? -eq 0 ]]; then - echo "UPLOAD=true" >> $GITHUB_ENV - sudo mkdir -p ../build-kernel - cp cache/hash${FILE_EXT}/*.git* ../build-kernel/ - echo "FILE_HASH=$(ls -1 cache/hash${FILE_EXT}/*.githash | head -1)" >> $GITHUB_ENV - fi - fi - - - name: Upload hash - if: ${{ matrix.node != 'none:none:none' }} - uses: actions/upload-artifact@v2 - with: - name: hash - path: build/${{ env.FILE_HASH }} - - - name: Upload build artifacts - if: ${{ matrix.node != 'none:none:none' }} - uses: actions/upload-artifact@v2 - with: - name: ${{ env.FILE_NAME }} - path: build/output/debs${{ env.FILE_EXT }}/linux-* - retention-days: 14 - - - name: Deploy to server - if: ${{ matrix.node != 'none:none:none' && github.event.label.name != '7.needs testing' }} - run: | - - echo ${{ env.UPLOAD }} - # edge kernels if any, simply copy to stable - rsync -arv build/output/debs-beta/*edge* --exclude='*u-boot*' build/output/debs/ 2> /dev/null || true - sudo apt-get -y -qq install lftp - sudo chown -R $USER:$USER build/output/debs${{ env.FILE_EXT }}/ - lftp -u upload, -e "set net:timeout 10;set net:max-retries 16;mirror --Remove-source-files -R --no-empty-dirs --parallel=8 --no-perms $(pwd)/build/output/debs/ debs/ ;bye" sftp://users.armbian.com - lftp -u upload, -e "set net:timeout 10;set net:max-retries 16;mirror --Remove-source-files -R --no-empty-dirs --parallel=8 --no-perms $(pwd)/build/output/debs-beta/ debs-beta/ ;bye" sftp://users.armbian.com - - Deploy: - - name: Update kernel status - needs: [Linux] - runs-on: [self-hosted, Linux, small] - if: ${{ github.repository_owner == 'Armbian' }} - steps: - - - name: Cache Gradle packages - uses: actions/cache@v2 - env: - cache-name: build-kernel - with: - path: build-kernel - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.run_id }}-linux - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.run_id }}-linux - - - name: Read value - run: | - - echo "SKIP=$(cat build-kernel/skip 2> /dev/null || true)" >> $GITHUB_ENV - echo "FILE_EXT=-beta" >> $GITHUB_ENV - echo "REPO_DEST=nightly" >> $GITHUB_ENV - echo "BETA=yes" >> $GITHUB_ENV - if [[ "$(cat build-kernel/build_type 2> /dev/null || true)" =~ stable|edge ]]; then - echo "FILE_EXT=" >> $GITHUB_ENV - echo "REPO_DEST=master" >> $GITHUB_ENV - echo "BETA=no" >> $GITHUB_ENV - fi - - - name: Checkout Armbian support scripts - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/scripts - token: ${{ secrets.SCRIPTS_ACCESS_TOKEN }} - path: scripts - clean: true - - - 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: Download artefacts - if: ${{ env.SKIP != 'yes' }} - uses: actions/download-artifact@v2 - with: - name: hash - - - name: Update scripts - if: ${{ env.SKIP != 'yes' }} - run: | - ls -l build-kernel - if [[ "$(cat build-kernel/skip 2> /dev/null || true)" == "no" ]]; then - sudo rsync -ar --remove-source-files *.git* scripts/hash${{ env.FILE_EXT }}/ || true - cd scripts - sudo chown -R $USER:$USER .git - if git status --porcelain | grep .; then - git config --global user.email "info@armbian.com" - git config --global user.name "Armbianworker" - git config pull.rebase false - git pull - echo "update" - git add . - git commit -m "Update hashes for ${{ env.FILE_DEST }} repository" - git push - fi - fi - - Closing: - - name: Build board support packages - needs: [Deploy] - runs-on: [self-hosted, Linux, fast] - if: ${{ github.repository_owner == 'Armbian' }} - steps: - - - name: Cache Gradle packages - uses: actions/cache@v2 - env: - cache-name: build-kernel - with: - path: build-kernel - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.run_id }}-linux - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.run_id }}-linux - - - name: Read value - run: | - - echo "SKIP=$(cat build-kernel/skip 2> /dev/null || true)" >> $GITHUB_ENV - echo "FILE_EXT=-beta" >> $GITHUB_ENV - echo "REPO_DEST=nightly" >> $GITHUB_ENV - echo "BETA=yes" >> $GITHUB_ENV - if [[ "$(cat build-kernel/build_type 2> /dev/null || true)" =~ stable|edge ]]; then - echo "FILE_EXT=" >> $GITHUB_ENV - echo "REPO_DEST=master" >> $GITHUB_ENV - echo "BETA=no" >> $GITHUB_ENV - fi - - - name: Checkout Armbian build script - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/build - path: build - ref: ${{ env.REPO_DEST }} - clean: false - - - name: Checkout support scripts - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/scripts - token: ${{ secrets.SCRIPTS_ACCESS_TOKEN }} - path: scripts - clean: true - - - name: Make board support packages - run: | - - if [[ "$(cat build-kernel/skip 2> /dev/null || true)" == "no" ]]; then - - cd build - if [[ $(curl -s http://ifconfig.me) == "93.103.15.56" ]]; then - sudo mkdir -p cache/toolchain cache/rootfs || true - # umount - sudo umount cache/toolchain || true - # erase below - sudo mountpoint -q cache/toolchain && sudo rm -rf cache/toolchain/* - ! sudo mountpoint -q cache/toolchain && sudo rm -rf cache/toolchain/* && sudo mount nas:/tank/armbian/toolchain.armbian.com cache/toolchain -o rsize=32768,wsize=32768,timeo=5,retrans=2,actimeo=60,retry=15 || true - ! sudo mountpoint -q cache/rootfs && sudo rm -rf cache/rootfs/* && sudo mount nas:/tank/armbian/dl.armbian.com/_rootfs cache/rootfs -o rsize=32768,wsize=32768,timeo=5,retrans=2,actimeo=60,retry=15 || true - fi - - # use prepared configs - sudo cp ../scripts/configs/* userpatches/ - - [[ ! -f .ignore_changes ]] && sudo touch .ignore_changes - #./compile.sh KERNEL_ONLY="yes" BOARD="bananapi" BRANCH="current" KERNEL_CONFIGURE="no" REPOSITORY_INSTALL="u-boot,kernel" 'prepare_host_basic' - rm -rf output/debs* - - ./compile.sh all-new-beta-bsp - # wait until it finishes - while : - do - [[ $(sudo ps -uax | grep compile.sh | wc -l) -le 1 ]] && exit - echo "Waiting for background processes to finish." - sleep 10 - done - fi - - - name: Deploy to server - run: | - - if [[ "$(cat build-kernel/skip 2> /dev/null || true)" == "no" ]]; then - sudo apt-get -y -qq install lftp - sudo chown -R $USER:$USER build/output/debs* - lftp -u upload, -e "set net:timeout 10;set net:max-retries 16;mirror --Remove-source-files -R --no-empty-dirs --parallel=8 --no-perms $(pwd)/build/output/debs/ debs/ ;bye" sftp://users.armbian.com - lftp -u upload, -e "set net:timeout 10;set net:max-retries 16;mirror --Remove-source-files -R --no-empty-dirs --parallel=8 --no-perms $(pwd)/build/output/debs-beta/ debs-beta/ ;bye" sftp://users.armbian.com - fi - - - name: Import GPG key - uses: crazy-max/ghaction-import-gpg@v3 - with: - gpg-private-key: ${{ secrets.GPG_KEY2 }} - passphrase: ${{ secrets.GPG_PASSPHRASE2 }} - workdir: build - git-user-signingkey: true - git-commit-gpgsign: true - - - name: Bump version - run: | - - if [[ "$(cat build-kernel/skip 2> /dev/null || true)" == "no" ]]; then - cd build - git symbolic-ref --short -q HEAD - if [[ "$(git symbolic-ref --short -q HEAD)" == nightly ]]; then - CURRENT_VERSION=$(cat VERSION) - NEW_VERSION="${CURRENT_VERSION%%-trunk}" - if [[ $CURRENT_VERSION == *trunk* ]]; then - NEW_VERSION=$(echo "${CURRENT_VERSION}" | cut -d. -f1-3)"."$((${NEW_VERSION##*.} + 1)) - else - NEW_VERSION=$(echo "${CURRENT_VERSION}" | cut -d. -f1-2)"."$((${NEW_VERSION##*.} + 1)) - fi - sudo git checkout -f - sudo chown -R $USER:$USER .git - git pull - echo "${NEW_VERSION}" > VERSION - git config --global user.email "info@armbian.com" - git config --global user.name "Armbianworker" - git add VERSION - git commit -m "Bumping to new version" -m "" -m "Adding following kernels:" -m "$(find output/debs-beta/ -type f -name "linux-image*${CURRENT_VERSION}*.deb" -printf "%f\n" | sort)" - git push - fi - fi diff --git a/.github/workflows/build-cache.yml b/.github/workflows/build-cache.yml index eb1c8625f6c3..9f743549056a 100644 --- a/.github/workflows/build-cache.yml +++ b/.github/workflows/build-cache.yml @@ -19,6 +19,7 @@ jobs: with: branch: 'nightly' + runner: small secrets: GPG_KEY2: ${{ secrets.GPG_KEY2 }} diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 4c7c0c6191cc..2f0dcca369a7 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -1,112 +1,20 @@ -name: Docker Image +name: Update Docker + on: - # Trigger the workflow on push but only for the main branch - push: - branches: - - master - # Trigger manually workflow_dispatch: + schedule: + - cron: '0 0 * * 0' jobs: - build-arm64: - - name: Build for ARM - runs-on: aarch64 + Docker: if: ${{ github.repository_owner == 'Armbian' }} - steps: - - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/build - path: build - ref: master - clean: false - - - name: Checkout support scripts - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/scripts - path: scripts - clean: false - - - name: Sync - run: | - mkdir -p build/userpatches - sudo cp scripts/configs/* build/userpatches/ - - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.CR_PAT }} - - - name: Build Docker image - - run: | - - docker stop $(docker ps -a -q) 2>/dev/null || true - docker rm $(docker ps -a -q) 2>/dev/null || true - docker images -a | awk '{print $3}' | xargs docker rmi --force 2>/dev/null || true - cd build - sed -i "s/-it --rm/-i --rm/" config/templates/config-docker.conf - touch .ignore_changes - ./compile.sh docker BOARD=virtual-qemu BRANCH=current RELEASE=focal BUILD_MINIMAL=yes BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=no COMPRESS_OUTPUTIMAGE=no REPOSITORY_INSTALL="u-boot,kernel,armbian-config,armbian-firmware" JUST_INIT=yes - - - name: Push Docker image - - run: docker push ghcr.io/armbian/build:$(cat build/VERSION | sed 's/trunk.*/trunk/')"-$(dpkg --print-architecture)" - - - build-amd64: - - name: Build for X86 - runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'Armbian' }} - steps: - - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/build - path: build - ref: master - clean: false - - - name: Checkout support scripts - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/scripts - path: scripts - clean: false - - - name: Sync - run: | - mkdir -p build/userpatches - sudo cp scripts/configs/* build/userpatches/ - - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.CR_PAT }} - - - name: Build Docker image - - run: | - - cd build - sed -i "s/-it --rm/-i --rm/" config/templates/config-docker.conf - touch .ignore_changes - ./compile.sh docker BOARD=virtual-qemu BRANCH=current RELEASE=focal BUILD_MINIMAL=yes BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=no COMPRESS_OUTPUTIMAGE=no REPOSITORY_INSTALL="u-boot,kernel,armbian-config,armbian-firmware" JUST_INIT=yes - - - name: Push Docker image - - run: docker push ghcr.io/armbian/build:$(cat build/VERSION | sed 's/trunk.*/trunk/')"-$(dpkg --print-architecture)" + uses: armbian/scripts/.github/workflows/update-docker-image.yml@master + + secrets: + CR_PAT: ${{ secrets.CR_PAT }} + + Docker-test: + needs: Docker + if: ${{ github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/build-test-image-docker.yml@master diff --git a/.github/workflows/build-kernel-on-merge-request.yml b/.github/workflows/build-kernel-on-merge-request.yml index de4eec0df3a6..3883d4ef81af 100644 --- a/.github/workflows/build-kernel-on-merge-request.yml +++ b/.github/workflows/build-kernel-on-merge-request.yml @@ -7,158 +7,40 @@ on: jobs: - Prepare: - - name: "Find changed kernels" - runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'Armbian' }} - outputs: - matrix: ${{steps.list_dirs.outputs.matrix}} - steps: - - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/build - path: build - ref: ${{ github.event.pull_request.head.sha }} - clean: false - - - name: Checkout support scripts - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/scripts - path: scripts - clean: true - - - name: Sync - run: | - - mkdir -p build/userpatches - sudo cp scripts/configs/* build/userpatches/ - echo "SHA: ${{ github.event.pull_request.head.sha }}" - - - name: Pull Docker image - run: | - - # make sure to cut what is after trunk in case we start from nightly - sudo docker pull ghcr.io/armbian/build:$(cat build/VERSION | sed 's/trunk.*/trunk/')"-$(dpkg --print-architecture)" - - - name: Determine changed kernels - run: | - - cd build - - # we need to fix this once but fake toolchain will prevent downloading it each time - mkdir -p cache/toolchain/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu - touch cache/toolchain/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/.download-complete - mkdir -p cache/toolchain/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi - touch cache/toolchain/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi/.download-complete - mkdir -p cache/toolchain/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux - touch cache/toolchain/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/.download-complete - mkdir -p cache/toolchain/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux - touch cache/toolchain/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux/.download-complete - mkdir -p cache/toolchain/gcc-linaro-arm-none-eabi-4.8-2014.04_linux - touch cache/toolchain/gcc-linaro-arm-none-eabi-4.8-2014.04_linux/.download-complete - mkdir -p cache/toolchain/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu - touch cache/toolchain/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/.download-complete - mkdir -p cache/toolchain/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf - touch cache/toolchain/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/.download-complete - mkdir -p cache/toolchain/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu - touch cache/toolchain/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/.download-complete - mkdir -p cache/toolchain/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf - touch cache/toolchain/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf/.download-complete - [[ ! -f .ignore_changes ]] && sudo touch .ignore_changes - mkdir -p cache/hash-beta - sudo rsync -ar --delete ../scripts/hash-beta/. cache/hash-beta/ 2> /dev/null - sudo cp ../scripts/configs/* userpatches/ - sudo rm -f userpatches/targets.conf - sed -i "s/-it --rm/-i --rm/" userpatches/config-docker.conf - sed -i "s/COMPRESS_OUTPUTIMAGE=.*/COMPRESS_OUTPUTIMAGE=\"no\"/" userpatches/lib.config - - - name: Prepare build matrix - id: list_dirs - run: | - - MATRIX=$(cd build;./compile.sh docker all-new-beta-kernels BUILD_ALL="demo" | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" | egrep "^[0-9]" | awk '{ print $2 ":" $4 ":" $3 }' | tr -d '(),' | sort | uniq) - mkdir -p build-kernel - echo "no" > build-kernel/skip - if [[ -z "$MATRIX" ]]; then - MATRIX="none:none:none" - echo "yes" > build-kernel/skip - fi - echo ::set-output name=matrix::$(for x in $(echo "${MATRIX}"); do echo $x; done|jq -cnR '[inputs | select(length>0)]' | jq) - - Linux: - - name: "Build Linux" - needs: [ Prepare ] - runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'armbian' }} - timeout-minutes: 480 - strategy: - fail-fast: false - matrix: - node: ${{fromJson(needs.Prepare.outputs.matrix)}} - - steps: - - - name: Checkout Armbian support scripts - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/scripts - path: scripts - clean: true - - - name: Checkout Armbian build script - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/build - path: build - ref: ${{ github.event.pull_request.head.sha }} - clean: false - - - name: Sync - run: | - - mkdir -p build/userpatches - sudo cp scripts/configs/* build/userpatches/ - - - name: Pull Docker image - if: ${{ matrix.node != 'none:none:none' }} - run: | - - sudo docker pull ghcr.io/armbian/build:$(cat build/VERSION | sed 's/trunk.*/trunk/')"-$(dpkg --print-architecture)" - - - name: Build - if: ${{ matrix.node != 'none:none:none' }} - run: | - - CHUNK="${{ matrix.node }}" - - BOARD=$(echo $CHUNK | cut -d":" -f1) - BRANCH=$(echo $CHUNK | cut -d":" -f2) - FAMILY=$(echo $CHUNK | cut -d":" -f2) - echo "FILE_NAME=${FAMILY}-${BRANCH}" >> $GITHUB_ENV - - cd build - [[ ! -f .ignore_changes ]] && sudo touch .ignore_changes - sed -i "s/-it --rm/-i --rm/" userpatches/config-docker.conf - sed -i "s/COMPRESS_OUTPUTIMAGE=.*/COMPRESS_OUTPUTIMAGE=\"no\"/" userpatches/lib.config - - ./compile.sh docker ARMBIAN_MIRROR="https://github.com/armbian/mirror/releases/download/" BOARD="$BOARD" \ - BETA="yes" KERNEL_ONLY="yes" BRANCH="$BRANCH" KERNEL_CONFIGURE="no" OFFLINE="no" - - - name: Upload build artifacts - if: ${{ matrix.node != 'none:none:none' }} - uses: actions/upload-artifact@v2 - with: - name: ${{ env.FILE_NAME }} - path: build/output/debs-beta/linux-* - if-no-files-found: ignore - retention-days: 30 + Merge: + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/merge-from-branch.yml@master + + with: + runner: "ubuntu-latest" + branch: 'nightly' + + secrets: + GPG_KEY2: ${{ secrets.GPG_KEY2 }} + GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} + + Check: + name: Checking + needs: Merge + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/check-for-changes.yml@master + + Build: + needs: Check + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/build-kernel.yml@master + + with: + + uploading: "true" + runner: "ubuntu-latest" + reference: ${{ github.event.pull_request.head.sha }} + + secrets: + GPG_KEY1: ${{ secrets.GPG_KEY1 }} + GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }} + GPG_KEY2: ${{ secrets.GPG_KEY2 }} + GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} + SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }} + KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }} diff --git a/.github/workflows/build-test-image-docker.yml b/.github/workflows/build-test-image-docker.yml index 1506b5dbfebb..790deeeb2801 100644 --- a/.github/workflows/build-test-image-docker.yml +++ b/.github/workflows/build-test-image-docker.yml @@ -1,90 +1,10 @@ name: Build with Docker + on: - - # Trigger after Docker image was built - workflow_run: - workflows: ["Docker Image"] - types: - - completed - - # Trigger on pull reqests - pull_request: - types: [review_requested, ready_for_review] - - # Trigger manually workflow_dispatch: jobs: - gradle: - strategy: - fail-fast: false - matrix: - board: [uefi-arm64,uefi-x86,virtual-qemu] - release: [focal,buster,bullseye,hirsute,jammy] - desktop: [xfce] - - if: ${{ github.repository_owner == 'Armbian' && github.event.workflow_run.conclusion == 'success' }} || github.event_name == 'workflow_dispatch' - name: Variant - runs-on: ubuntu-latest - steps: - - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/build - path: build - clean: true - - - name: Checkout support scripts - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/scripts - path: scripts - clean: true - - - name: Sync - run: | - - mkdir -p build/userpatches - sudo cp scripts/configs/* build/userpatches/ - - - name: Pull Docker image - run: | - - sudo docker pull ghcr.io/armbian/build:$(cat build/VERSION | sed 's/trunk.*/trunk/')"-$(dpkg --print-architecture)" - - - name: Build test image - run: | - - cd build - - export TERM=dumb - sed -i "s/-it --rm/-i --rm/" userpatches/config-docker.conf - sed -i "s/COMPRESS_OUTPUTIMAGE=.*/COMPRESS_OUTPUTIMAGE=\"no\"/" userpatches/lib.config - - ./compile.sh docker \ - BETA=yes \ - EXPERT=yes \ - BOARD=${{ matrix.board }} \ - BRANCH=current \ - RELEASE=${{ matrix.release }} \ - BUILD_MINIMAL=no \ - BUILD_DESKTOP=yes \ - KERNEL_ONLY=no \ - KERNEL_CONFIGURE=prebuilt \ - COMPRESS_OUTPUTIMAGE=no \ - IGNORE_UPDATES=yes \ - DESKTOP_ENVIRONMENT_CONFIG_NAME="config_base" \ - DESKTOP_ENVIRONMENT=${{ matrix.desktop }} \ - SKIP_EXTERNAL_TOOLCHAINS=yes \ - DESKTOP_APPGROUPS_SELECTED="" - - name: Upload artefacts - uses: actions/upload-artifact@v2 - with: - name: virtual-qemu - path: build/output/images/* - if-no-files-found: ignore - retention-days: 10 + Maintain: + if: github.repository_owner == 'Armbian' + uses: armbian/scripts/.github/workflows/build-test-image-docker.yml@master diff --git a/.github/workflows/build-train.yml b/.github/workflows/build-train.yml new file mode 100644 index 000000000000..7d447df1dd58 --- /dev/null +++ b/.github/workflows/build-train.yml @@ -0,0 +1,377 @@ +name: Build train + +on: + workflow_dispatch: + push: + branches: + - master + +jobs: + + ########################################################################################## + # # + # Merge master into nighly image from which we build packages # + # # + ########################################################################################## + + Merge: + name: Merging + if: ${{ github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/merge-from-branch.yml@master + + with: + branch: 'nightly' + runner: small + + secrets: + GPG_KEY2: ${{ secrets.GPG_KEY2 }} + GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} + + ########################################################################################## + # # + # Check for changes in patches, kernel config and upstream # + # # + ########################################################################################## + + Check: + name: Checking + needs: Merge + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/check-for-changes.yml@master + + ########################################################################################## + # # + # Build changed kernel packages # + # # + ########################################################################################## + + Kernel: + needs: Check + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/build-kernel.yml@master + + with: + uploading: true + runner: fast + reference: nightly + + secrets: + GPG_KEY1: ${{ secrets.GPG_KEY1 }} + GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }} + GPG_KEY2: ${{ secrets.GPG_KEY2 }} + GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} + SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }} + KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }} + + ########################################################################################## + # # + # Build changed desktop packages # + # # + ########################################################################################## + + Desktop: + needs: Check + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/build-desktop.yml@master + + with: + uploading: true + + secrets: + GPG_KEY1: ${{ secrets.GPG_KEY1 }} + GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }} + GPG_KEY2: ${{ secrets.GPG_KEY2 }} + GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} + SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }} + KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }} + + ########################################################################################## + # # + # Build board support packages # + # # + ########################################################################################## + + BSP: + needs: Kernel + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/build-bsp.yml@master + + with: + uploading: true + + secrets: + GPG_KEY1: ${{ secrets.GPG_KEY1 }} + GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }} + GPG_KEY2: ${{ secrets.GPG_KEY2 }} + GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} + SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }} + KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }} + + legacy: + needs: Check + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/build-u-boot-with-docker.yml@master + + with: + + runner: "ubuntu-latest" + include: 'grep legacy | ' + exclude: '' + uploading: false + + secrets: + GPG_KEY1: ${{ secrets.GPG_KEY1 }} + GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }} + GPG_KEY2: ${{ secrets.GPG_KEY2 }} + GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} + SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }} + SSH_KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }} + + current: + needs: Check + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/build-u-boot-with-docker.yml@master + + with: + + runner: "small" + include: 'grep current | ' + exclude: '' + uploading: false + + secrets: + GPG_KEY1: ${{ secrets.GPG_KEY1 }} + GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }} + GPG_KEY2: ${{ secrets.GPG_KEY2 }} + GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} + SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }} + SSH_KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }} + + + edge: + needs: Check + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/build-u-boot-with-docker.yml@master + + with: + + runner: "small" + include: 'grep edge | ' + exclude: '' + uploading: false + + secrets: + GPG_KEY1: ${{ secrets.GPG_KEY1 }} + GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }} + GPG_KEY2: ${{ secrets.GPG_KEY2 }} + GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} + SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }} + SSH_KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }} + + ########################################################################################## + # # + # Store build hashes for future comparission # + # # + ########################################################################################## + + Deploy: + needs: [Kernel,Desktop,BSP,legacy,current,edge] + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/deploy.yml@master + + with: + + uploading: true + + secrets: + GPG_KEY1: ${{ secrets.GPG_KEY1 }} + GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }} + GPG_KEY2: ${{ secrets.GPG_KEY2 }} + GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} + SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }} + KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }} + + apt-armbian-com: + name: "Stable repository" + needs: [Deploy] + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/update-repository.yml@master + + with: + KEY_ID: 'repository' + + secrets: + KEY_REPOSITORY: ${{ secrets.KEY_REPOSITORY }} + USER_REPOSITORY: ${{ secrets.USER_REPOSITORY }} + HOST_REPOSITORY: ${{ secrets.HOST_REPOSITORY }} + KNOWN_HOSTS_REPOSITORY: ${{ secrets.KNOWN_HOSTS_REPOSITORY }} + + beta-armbian-com: + name: "Nighly repository" + needs: [Deploy] + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/update-repository.yml@master + + with: + KEY_ID: 'repository-beta' + + secrets: + KEY_REPOSITORY: ${{ secrets.KEY_REPOSITORY_BETA }} + USER_REPOSITORY: ${{ secrets.USER_REPOSITORY }} + HOST_REPOSITORY: ${{ secrets.HOST_REPOSITORY }} + KNOWN_HOSTS_REPOSITORY: ${{ secrets.KNOWN_HOSTS_REPOSITORY }} + + ########################################################################################## + # # + # Build x86 images # + # # + ########################################################################################## + + x86-images: + needs: [apt-armbian-com,beta-armbian-com] + uses: armbian/scripts/.github/workflows/build-with-docker.yml@master + + with: + + variant: 'cli:beta' + runner: "ubuntu-latest" + part: 1 + of: 1 + include: 'grep uefi-x86 | ' + exclude: '' + uploading: false + + secrets: + GPG_KEY1: ${{ secrets.GPG_KEY1 }} + GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }} + GPG_KEY2: ${{ secrets.GPG_KEY2 }} + GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} + SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }} + SSH_KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }} + + ########################################################################################## + # # + # Build CLI images # + # # + ########################################################################################## + + cli-images: + needs: [apt-armbian-com,beta-armbian-com] + uses: armbian/scripts/.github/workflows/build-with-docker.yml@master + + with: + + variant: 'cli:beta' + runner: "ubuntu-latest" + part: 1 + of: 1 + include: '' + exclude: 'grep -v uefi-x86 | ' + uploading: false + + secrets: + GPG_KEY1: ${{ secrets.GPG_KEY1 }} + GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }} + GPG_KEY2: ${{ secrets.GPG_KEY2 }} + GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} + SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }} + SSH_KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }} + + ########################################################################################## + # # + # Build desktop images # + # # + ########################################################################################## + + desktop-images: + needs: [apt-armbian-com,beta-armbian-com] + uses: armbian/scripts/.github/workflows/build-with-docker.yml@master + + with: + variant: 'desktop:beta' + runner: "big" + part: 1 + of: 1 + include: '' + exclude: 'grep -v uefi-x86 | ' + uploading: false + + secrets: + GPG_KEY1: ${{ secrets.GPG_KEY1 }} + GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }} + GPG_KEY2: ${{ secrets.GPG_KEY2 }} + GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} + SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }} + SSH_KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }} + + ########################################################################################## + # # + # Bump with version if compilation succeeded # + # # + ########################################################################################## + + Bump: + needs: [x86-images,cli-images,desktop-images] + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/update-version.yml@master + + with: + + uploading: true + + secrets: + GPG_KEY1: ${{ secrets.GPG_KEY1 }} + GPG_PASSPHRASE1: ${{ secrets.GPG_PASSPHRASE1 }} + GPG_KEY2: ${{ secrets.GPG_KEY2 }} + GPG_PASSPHRASE2: ${{ secrets.GPG_PASSPHRASE2 }} + SCRIPTS_ACCESS_TOKEN: ${{ secrets.SCRIPTS_ACCESS_TOKEN }} + KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }} + + ########################################################################################## + # # + # Update download links and create torrents # + # # + ########################################################################################## + + Torrents: + name: Torrents + needs: [x86-images,cli-images,desktop-images] + if: ${{ github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/update-download.yml@master + + secrets: + KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + USER_TORRENTS: ${{ secrets.USER_TORRENTS }} + HOST_TORRENTS: ${{ secrets.HOST_TORRENTS }} + KNOWN_HOSTS_TORRENTS: ${{ secrets.KNOWN_HOSTS_TORRENTS }} + + ########################################################################################## + # # + # Clean runners # + # # + ########################################################################################## + + Maintaining: + + needs: [Bump,Torrents] + if: ${{ success() && github.repository_owner == 'Armbian' }} + uses: armbian/scripts/.github/workflows/maintain-runners.yml@master + + with: + + checking: true + + secrets: + KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }} diff --git a/.github/workflows/build-u-boot.yml b/.github/workflows/build-u-boot.yml index 43ed178ad52d..6a048216fbff 100644 --- a/.github/workflows/build-u-boot.yml +++ b/.github/workflows/build-u-boot.yml @@ -2,9 +2,6 @@ name: Beta Bootloader on: workflow_dispatch: -# workflow_run: -# workflows: ["Beta Kernel"] -# types: [completed] jobs: diff --git a/.github/workflows/maintain.yml b/.github/workflows/maintain.yml index eb84154f2a48..46d5ab379565 100644 --- a/.github/workflows/maintain.yml +++ b/.github/workflows/maintain.yml @@ -5,95 +5,13 @@ on: jobs: - Prepare: - - name: Prepare runners - runs-on: [self-hosted, Linux, small] - if: ${{ github.repository_owner == 'armbian' }} - outputs: - matrix: ${{steps.list_dirs.outputs.matrix}} - steps: - - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/build - path: build - ref: nightly - clean: false - - - name: Prepare matrix - id: list_dirs - run: - echo ::set-output name=matrix::$(for x in $(seq -w 01 50); do echo $x; done|jq -cnR '[inputs | select(length>0)]' | jq) - - Maint: - - needs: [ Prepare ] - runs-on: [self-hosted, Linux, small] - if: ${{ github.repository_owner == 'armbian' }} - timeout-minutes: 480 - strategy: - fail-fast: false - matrix: - node: ${{fromJson(needs.Prepare.outputs.matrix)}} - steps: - - name: Checkout Armbian build script - uses: actions/checkout@v2 - with: - fetch-depth: 0 - repository: armbian/build - path: build - ref: nightly - clean: false - - - name: Make a test build and cleanup - 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 - sudo mountpoint -q build/output/images && sudo fusermount -u build/output/images || true - if [[ $(curl -s http://ifconfig.me) == "93.103.15.56" ]]; then - sudo mountpoint -q build/cache/rootfs && sudo fusermount -u build/cache/rootfs || true - sudo mountpoint -q build/cache/toolchain && sudo fusermount -u build/cache/toolchain || true - fi - [[ "$(df | grep "/.tmp" | wc -l)" -eq 0 && $(sudo mountpoint -q build/output/images; echo $?) -eq 1 ]] && 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 echo '* libraries/restart-without-asking boolean true' | sudo debconf-set-selections - sudo DEBIAN_FRONTEND=noninteractive apt-get -y purge needrestart unattended-upgrades - sudo DEBIAN_FRONTEND=noninteractive apt-get -y update - sudo DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y -y -qq --with-new-pkgs upgrade - sudo DEBIAN_FRONTEND=noninteractive apt-get -y autoremove - [[ -d build/.git ]] && sudo chown -R $USER:$USER build/.git || true - [[ -d build/output/images ]] && sudo rm -rf build/output/images/* || true - [[ -d cache ]] && sudo rm -rf cache || true - sudo rm -rf build-* || true - sudo rm -rf temp || true - sudo rm *.conf || true - sudo rm *.txt || true - - cd build - [[ ! -f .ignore_changes ]] && sudo touch .ignore_changes - sudo rm -rf cache/sources - sudo rm -rf output/debs - sudo rm -rf output/debs-beta - sudo shutdown -r 1 - - Finish: - name: Finish - needs: [Maint] - runs-on: [self-hosted, Linux, small] - if: ${{ github.repository_owner == 'Armbian' }} - steps: - - name: Run script - run: | - echo "Finish" + Bump: + if: github.repository_owner == 'Armbian' + uses: armbian/scripts/.github/workflows/maintain-runners.yml@master + + with: + checking: false + + secrets: + KEY_TORRENTS: ${{ secrets.KEY_TORRENTS }} + KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }} diff --git a/.github/workflows/update-repository.yml b/.github/workflows/update-repository.yml index 1277d8729043..aeb02fb6c638 100644 --- a/.github/workflows/update-repository.yml +++ b/.github/workflows/update-repository.yml @@ -2,42 +2,29 @@ name: Update Repository on: workflow_dispatch: - workflow_run: - workflows: ["Beta Kernel" , "Beta Desktop" , "Beta Bootloader"] - types: [completed] jobs: - repository: - name: Update stable package repository - runs-on: [self-hosted, Linux, local] - if: ${{ github.repository_owner == 'Armbian' && github.event.workflow_run.conclusion == 'success' }} || github.event_name == 'workflow_dispatch' - steps: - - - name: Install SSH key for repository - uses: shimataro/ssh-key-action@v2 - with: - key: ${{ secrets.KEY_REPOSITORY }} - name: id_repository - known_hosts: ${{ secrets.KNOWN_HOSTS_REPOSITORY }} - if_key_exists: replace - - - name: Update stable repository - run: ssh -T -i ~/.ssh/id_repository ${{ secrets.USER_REPOSITORY }}@${{ secrets.HOST_REPOSITORY }} - - repository-beta: - name: Update beta package repository - runs-on: [self-hosted, Linux, local] - if: ${{ github.repository_owner == 'Armbian' && github.event.workflow_run.conclusion == 'success' }} || github.event_name == 'workflow_dispatch' - steps: - - - name: Install SSH key for repository - uses: shimataro/ssh-key-action@v2 - with: - key: ${{ secrets.KEY_REPOSITORY_BETA }} - name: id_repository_beta - known_hosts: ${{ secrets.KNOWN_HOSTS_REPOSITORY }} - if_key_exists: replace - - - name: Update beta repository - run: ssh -T -i ~/.ssh/id_repository_beta ${{ secrets.USER_REPOSITORY }}@${{ secrets.HOST_REPOSITORY }} + apt-armbian-com: + uses: armbian/scripts/.github/workflows/update-repository.yml@master + + with: + KEY_ID: 'repository' + + secrets: + KEY_REPOSITORY: ${{ secrets.KEY_REPOSITORY }} + USER_REPOSITORY: ${{ secrets.USER_REPOSITORY }} + HOST_REPOSITORY: ${{ secrets.HOST_REPOSITORY }} + KNOWN_HOSTS_REPOSITORY: ${{ secrets.KNOWN_HOSTS_REPOSITORY }} + + beta-armbian-com: + uses: armbian/scripts/.github/workflows/update-repository.yml@master + + with: + KEY_ID: 'repository-beta' + + secrets: + KEY_REPOSITORY: ${{ secrets.KEY_REPOSITORY_BETA }} + USER_REPOSITORY: ${{ secrets.USER_REPOSITORY }} + HOST_REPOSITORY: ${{ secrets.HOST_REPOSITORY }} + KNOWN_HOSTS_REPOSITORY: ${{ secrets.KNOWN_HOSTS_REPOSITORY }}