mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Github actions tweaks (#3383)
This commit is contained in:
133
.github/workflows/build-beta-desktop.yml
vendored
133
.github/workflows/build-beta-desktop.yml
vendored
@@ -1,133 +0,0 @@
|
||||
name: Beta Desktop
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
Prepare:
|
||||
|
||||
name: Find desktop variants
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.repository_owner == 'Armbian' && github.event.workflow_run.conclusion == 'success' }} || github.event_name == 'workflow_dispatch'
|
||||
outputs:
|
||||
matrix: ${{steps.list_dirs.outputs.matrix}}
|
||||
steps:
|
||||
|
||||
- uses: ahmadnassri/action-workflow-run-wait@v1
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
repository: armbian/build
|
||||
ref: nightly
|
||||
|
||||
- name: Build desktops
|
||||
id: list_dirs
|
||||
run: |
|
||||
|
||||
MATRIX=$(
|
||||
set +e
|
||||
releases=($(find config/distributions -mindepth 1 -maxdepth 1 -type d | sed 's/.*\///' ))
|
||||
for i in ${releases[@]}
|
||||
do
|
||||
environments=($([[ -d config/desktop/$i/environments ]] && ls -1 config/desktop/$i/environments))
|
||||
for j in ${environments[@]}
|
||||
do
|
||||
echo "$i:$j"
|
||||
done
|
||||
done)
|
||||
echo ::set-output name=matrix::$(for x in $(echo "${MATRIX}"); do echo $x; done|jq -cnR '[inputs | select(length>0)]' | jq)
|
||||
|
||||
Desktop:
|
||||
|
||||
name: "Build package"
|
||||
needs: [ Prepare ]
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 480
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node: ${{fromJson(needs.Prepare.outputs.matrix)}}
|
||||
|
||||
steps:
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
repository: armbian/build
|
||||
path: build
|
||||
ref: nightly
|
||||
clean: true
|
||||
|
||||
- name: Checkout support scripts
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
repository: armbian/scripts
|
||||
path: scripts
|
||||
clean: true
|
||||
|
||||
- name: Pull Docker image
|
||||
run: |
|
||||
|
||||
sudo docker pull ghcr.io/armbian/build:$(cat build/VERSION | sed 's/trunk.*/trunk/')"-$(dpkg --print-architecture)"
|
||||
|
||||
- name: Build package
|
||||
run: |
|
||||
|
||||
mkdir -p build/userpatches
|
||||
cp scripts/configs/* build/userpatches/
|
||||
cd build
|
||||
CHUNK="${{ matrix.node }}"
|
||||
RELEASE=$(echo $CHUNK | cut -d":" -f1)
|
||||
DE=$(echo $CHUNK | cut -d":" -f2)
|
||||
echo "RELEASE=${RELEASE}" >> $GITHUB_ENV
|
||||
echo "DE=${DE}" >> $GITHUB_ENV
|
||||
sed -i "s/-it --rm/-i --rm/" userpatches/config-docker.conf
|
||||
|
||||
./compile.sh docker \
|
||||
BSP_BUILD="yes" \
|
||||
BETA="yes" \
|
||||
RELEASE="${RELEASE}" \
|
||||
DESKTOP_ENVIRONMENT_CONFIG_NAME="config_base" \
|
||||
BUILD_DESKTOP="yes" \
|
||||
DESKTOP_ENVIRONMENT="${DE}" \
|
||||
KERNEL_ONLY="yes" \
|
||||
KERNEL_CONFIGURE="no" \
|
||||
BOARD="uefi-x86" \
|
||||
BRANCH="current" \
|
||||
SKIP_EXTERNAL_TOOLCHAINS="yes" \
|
||||
OFFLINE_WORK="yes" \
|
||||
REPOSITORY_INSTALL="u-boot,kernel,armbian-config,armbian-firmware" \
|
||||
DESKTOP_APPGROUPS_SELECTED="" \
|
||||
EXPERT="yes"
|
||||
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo "UPLOAD=true" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Upload build artifacts
|
||||
if: ${{ matrix.node != 'none:none' }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: armbian-${{ env.RELEASE }}-desktop-${{ env.DE }}
|
||||
path: build/output/debs-beta/${{ env.RELEASE }}/armbian-${{ env.RELEASE }}-desktop-${{ env.DE }}_*.deb
|
||||
if-no-files-found: ignore
|
||||
retention-days: 10
|
||||
|
||||
- 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: Deploy to server
|
||||
if: ${{ matrix.node != 'none:none' }} && {{ env.UPLOAD == true }}
|
||||
run: |
|
||||
|
||||
sudo apt-get -y -qq install lftp
|
||||
lftp -u upload, -e "set net:timeout 10;set net:max-retries 16;mirror --Remove-source-files -R --no-empty-dirs --parallel=8 --include-glob=armbian-${{ env.RELEASE }}-desktop-${{ env.DE }}_*.deb --no-perms $(pwd)/build/output/debs-beta/ debs-beta/ ;bye" sftp://users.armbian.com
|
||||
3
.github/workflows/build-cache.yml
vendored
3
.github/workflows/build-cache.yml
vendored
@@ -1,6 +1,3 @@
|
||||
# This composite actions calls build rootfs action from git@github.com:armbian/scripts.git three times so we
|
||||
# can run all rootfs combinations at once - depending of available runners
|
||||
|
||||
name: Rootfs Caches
|
||||
|
||||
on:
|
||||
|
||||
@@ -4,24 +4,13 @@ on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
types: [review_requested, ready_for_review]
|
||||
paths-ignore:
|
||||
- .github/workflows
|
||||
|
||||
jobs:
|
||||
|
||||
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
|
||||
|
||||
|
||||
228
.github/workflows/build-single.yml
vendored
228
.github/workflows/build-single.yml
vendored
@@ -1,228 +0,0 @@
|
||||
name: Build Selected Image
|
||||
|
||||
on:
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
inputs:
|
||||
|
||||
boards:
|
||||
description: 'Comma delimited list'
|
||||
required: true
|
||||
default: 'bananapi'
|
||||
|
||||
repository:
|
||||
description: 'Packages from repository'
|
||||
required: true
|
||||
default: 'yes'
|
||||
|
||||
jobs:
|
||||
|
||||
prepare:
|
||||
|
||||
name: Build image(s) for download section
|
||||
runs-on: [self-hosted, Linux, X64, cache, big]
|
||||
if: ${{ github.repository_owner == 'Armbian' }}
|
||||
steps:
|
||||
- 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
|
||||
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
|
||||
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/output/debug ]] && rm -rf build/output/debug/* || true
|
||||
[[ -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: master
|
||||
clean: false
|
||||
|
||||
- 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_KEY1 }}
|
||||
passphrase: ${{ secrets.GPG_PASSPHRASE1 }}
|
||||
workdir: build
|
||||
git-user-signingkey: true
|
||||
git-commit-gpgsign: true
|
||||
|
||||
- name: Prepare
|
||||
env:
|
||||
|
||||
GPG_PASS: ${{ secrets.GPG_PASSPHRASE1 }}
|
||||
REBUILD_IMAGES: ${{ github.event.inputs.boards }}
|
||||
REPOSITORY: ${{ github.event.inputs.repository }}
|
||||
|
||||
run: |
|
||||
|
||||
cd build
|
||||
|
||||
[[ "${REPOSITORY}" == "yes" ]] && REPOSITORY_INSTALL="u-boot,kernel,armbian-config,armbian-zsh,armbian-firmware"
|
||||
[[ ! -f .ignore_changes ]] && sudo touch .ignore_changes
|
||||
|
||||
PARALLEL_BUILDS=$(awk '{printf("%d",$1/8000)}' <<<$(($(LC_ALL=C free -w 2>/dev/null | grep "^Mem" | awk '{print $2}' || LC_ALL=C free | grep "^Mem"| awk '{print $2}')/1024)))
|
||||
|
||||
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
|
||||
else
|
||||
sudo rsync --size-only --delete -avr rsync://rsync.armbian.com/dl/_rootfs/. cache/rootfs/ || true
|
||||
fi
|
||||
|
||||
# mount deploy target
|
||||
sudo apt-get -y -qq install sshfs
|
||||
sudo mkdir -p /root/.ssh/
|
||||
sudo cp ~/.ssh/known_hosts /root/.ssh/
|
||||
sudo mkdir -p output/images || true
|
||||
sudo sshfs upload@users.armbian.com:/images output/images -o IdentityFile=~/.ssh/id_rsa
|
||||
|
||||
# use prepared configs
|
||||
sudo cp ../scripts/configs/* userpatches/
|
||||
|
||||
# use version from scripts
|
||||
sudo cp ../scripts/VERSION .
|
||||
|
||||
# cleaning leftovers if any
|
||||
sudo rm -rf output/debs/*
|
||||
sudo rm -f userpatches/targets.conf
|
||||
|
||||
[[ "${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" GPG_PASS="${GPG_PASS}"
|
||||
./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}"
|
||||
|
||||
# umount
|
||||
while mountpoint output/images -q
|
||||
do
|
||||
sudo umount output/images || true
|
||||
echo "Trying to unmount ..."
|
||||
sleep 10
|
||||
done
|
||||
|
||||
- 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' }}
|
||||
|
||||
env:
|
||||
|
||||
GPG_PASS: ${{ secrets.GPG_PASSPHRASE1 }}
|
||||
|
||||
run: |
|
||||
|
||||
cd build
|
||||
sudo rm -f .tmp/bump
|
||||
if [[ $(cat .tmp/n 2> /dev/null) -ne 0 ]]; then
|
||||
./compile.sh all-new-stable-bsp GPG_PASS="${GPG_PASS}"
|
||||
sudo touch .tmp/bump
|
||||
# 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: Bump stable version if we build from sources
|
||||
|
||||
if: ${{ success() && github.event.inputs.repository != 'yes' }}
|
||||
|
||||
run: |
|
||||
|
||||
cd scripts
|
||||
sudo git clean -ffdx && git reset --hard HEAD
|
||||
git config pull.rebase false
|
||||
VERSION=$(cat VERSION | cut -d. -f1,2)
|
||||
PATCH=$(cat VERSION | cut -d. -f3,3)
|
||||
echo $VERSION"."$(($PATCH + 1)) | tee VERSION
|
||||
git config --global user.email "info@armbian.com"
|
||||
git config --global user.name "Armbianworker"
|
||||
git pull --allow-unrelated-histories
|
||||
git add VERSION
|
||||
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_TORRENTS }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS_UPLOAD }}
|
||||
if_key_exists: replace
|
||||
|
||||
- name: Deploy packages to server
|
||||
if: ${{ success() && github.event.inputs.repository != 'yes' }}
|
||||
|
||||
run: |
|
||||
|
||||
lftp -u upload, -e "set net:timeout 4;set net:max-retries 6;mirror --Remove-source-files -R --no-empty-dirs --parallel=8 --no-perms $(pwd)/build/output/debs/ debs/ ;bye" sftp://users.armbian.com
|
||||
|
||||
repository:
|
||||
|
||||
#
|
||||
# Rebuilds package repository
|
||||
#
|
||||
|
||||
name: Update package repository
|
||||
needs: [prepare]
|
||||
if: ${{ github.event.inputs.repository != 'yes' && github.repository_owner == 'Armbian' }}
|
||||
runs-on: [self-hosted, Linux, local]
|
||||
steps:
|
||||
|
||||
- name: Install SSH key for repository
|
||||
|
||||
uses: shimataro/ssh-key-action@v2
|
||||
with:
|
||||
key: ${{ secrets.KEY_REPOSITORY }}
|
||||
name: id_repository # optional
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS_REPOSITORY }}
|
||||
if_key_exists: replace
|
||||
|
||||
- name: Update repository
|
||||
|
||||
run: ssh -T -i ~/.ssh/id_repository ${{ secrets.USER_REPOSITORY }}@${{ secrets.HOST_REPOSITORY }}
|
||||
4443
.github/workflows/build-stable-images.yml
vendored
4443
.github/workflows/build-stable-images.yml
vendored
File diff suppressed because it is too large
Load Diff
3
.github/workflows/build-train.yml
vendored
3
.github/workflows/build-train.yml
vendored
@@ -104,6 +104,7 @@ jobs:
|
||||
include: 'grep legacy | '
|
||||
exclude: ''
|
||||
uploading: false
|
||||
destref: 'nightly'
|
||||
|
||||
secrets:
|
||||
GPG_KEY1: ${{ secrets.GPG_KEY1 }}
|
||||
@@ -125,6 +126,7 @@ jobs:
|
||||
include: 'grep current | '
|
||||
exclude: ''
|
||||
uploading: false
|
||||
destref: 'nightly'
|
||||
|
||||
secrets:
|
||||
GPG_KEY1: ${{ secrets.GPG_KEY1 }}
|
||||
@@ -147,6 +149,7 @@ jobs:
|
||||
include: 'grep edge | '
|
||||
exclude: ''
|
||||
uploading: false
|
||||
destref: 'nightly'
|
||||
|
||||
secrets:
|
||||
GPG_KEY1: ${{ secrets.GPG_KEY1 }}
|
||||
|
||||
29
.github/workflows/build-u-boot.yml
vendored
29
.github/workflows/build-u-boot.yml
vendored
@@ -1,11 +1,31 @@
|
||||
name: Beta Bootloader
|
||||
name: Build u-boot & BSP
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
inputs:
|
||||
destref:
|
||||
type: choice
|
||||
description: Beta builds
|
||||
options:
|
||||
- nightly
|
||||
- master
|
||||
jobs:
|
||||
|
||||
fake:
|
||||
runs-on: small
|
||||
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
|
||||
|
||||
legacy:
|
||||
needs: [ fake ]
|
||||
uses: armbian/scripts/.github/workflows/build-u-boot-with-docker.yml@master
|
||||
|
||||
with:
|
||||
@@ -14,6 +34,7 @@ jobs:
|
||||
include: 'grep legacy | '
|
||||
exclude: ''
|
||||
uploading: false
|
||||
destref: ${{ github.event.inputs.destref }}
|
||||
|
||||
secrets:
|
||||
GPG_KEY1: ${{ secrets.GPG_KEY1 }}
|
||||
@@ -25,6 +46,7 @@ jobs:
|
||||
KNOWN_HOSTS_UPLOAD: ${{ secrets.KNOWN_HOSTS_UPLOAD }}
|
||||
|
||||
current:
|
||||
needs: [ fake ]
|
||||
uses: armbian/scripts/.github/workflows/build-u-boot-with-docker.yml@master
|
||||
|
||||
with:
|
||||
@@ -33,6 +55,7 @@ jobs:
|
||||
include: 'grep current | '
|
||||
exclude: ''
|
||||
uploading: false
|
||||
destref: ${{ github.event.inputs.destref }}
|
||||
|
||||
secrets:
|
||||
GPG_KEY1: ${{ secrets.GPG_KEY1 }}
|
||||
@@ -45,6 +68,7 @@ jobs:
|
||||
|
||||
|
||||
edge:
|
||||
needs: [ fake ]
|
||||
uses: armbian/scripts/.github/workflows/build-u-boot-with-docker.yml@master
|
||||
|
||||
with:
|
||||
@@ -53,6 +77,7 @@ jobs:
|
||||
include: 'grep edge | '
|
||||
exclude: ''
|
||||
uploading: false
|
||||
destref: ${{ github.event.inputs.destref }}
|
||||
|
||||
secrets:
|
||||
GPG_KEY1: ${{ secrets.GPG_KEY1 }}
|
||||
|
||||
Reference in New Issue
Block a user