Enable image creation for a few examples (#2)

This commit is contained in:
Igor Pečovnik
2022-05-25 15:23:29 +02:00
committed by GitHub
parent 48da2921e6
commit 8d9113e161
15 changed files with 234 additions and 7 deletions

164
.github/workflows/generate.yml vendored Normal file
View File

@@ -0,0 +1,164 @@
name: Software packs
on:
push:
paths:
- images/**
workflow_dispatch:
jobs:
Prepare:
name: Prepare
runs-on: ubuntu-latest
#if: ${{ github.repository_owner == 'armbian' }}
outputs:
matrix: ${{steps.list_dirs.outputs.matrix}}
board: ${{steps.list_dirs.outputs.board}}
steps:
- name: Checkout build framework
uses: actions/checkout@v3
with:
repository: armbian/build
path: build
- name: Checkout repository
uses: actions/checkout@v2
with:
path: distribution
- name: Run changed-files with defaults on the dir1
id: changed-files-for-dir1
uses: tj-actions/changed-files@v19
with:
path: distribution/images
- name: Prepare matrix
id: list_dirs
run: |
FILENAME="targets.conf"
MATRIX="cat build/config/"${FILENAME}" | grep -v \"^$\" | grep -v \"^#\" | cut -f1 -d ' ' | sort | uniq"
MATRIX="echo -en \"odroidn2\\nuefi-x86\""
echo ::set-output name=board::$(for x in $(eval $MATRIX); do echo $x; done|jq -cnR '[inputs | select(length>0)]' | jq)
echo ::set-output name=matrix::$(for x in $(find distribution/images -name SKIP -exec grep -l 'no' {} \; | cut -d"/" -f3); do echo $x; done|jq -cnR '[inputs | select(length>0)]' | jq)
Build:
needs: [ Prepare ]
runs-on: [ubuntu-latest]
if: ${{ needs.Prepare.outputs.matrix != '[]' && needs.Prepare.outputs.matrix != '' }}
timeout-minutes: 480
strategy:
fail-fast: false
matrix:
node: ${{fromJson(needs.Prepare.outputs.matrix)}}
board: ${{fromJson(needs.Prepare.outputs.board)}}
steps:
- name: Checkout build framework
uses: actions/checkout@v3
with:
repository: armbian/build
path: build
- name: Checkout support scripts
uses: actions/checkout@v3
with:
repository: armbian/scripts
path: scripts
- name: Checkout software distribution
uses: actions/checkout@v3
with:
path: distribution
- name: Pull Docker image
run: |
sudo docker pull ghcr.io/armbian/build:$(cat build/VERSION | cut -d"." -f1-2)"-$(dpkg --print-architecture)"
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_KEY1 }}
passphrase: ${{ secrets.GPG_PASSPHRASE1 }}
workdir: scripts
git-user-signingkey: true
git-commit-gpgsign: true
- name: Preparing
run: |
mkdir -p build/userpatches
sudo cp build/config/templates/* build/userpatches/
sudo cp -R distribution/images/${{ matrix.node }}/overlay build/userpatches/
sudo cp distribution/images/${{ matrix.node }}/customize-image.sh build/userpatches/
sudo sed -i "s/^#DOCKER_FLAGS+=(--privileged)/DOCKER_FLAGS+=(--privileged)/" build/userpatches/config-docker.conf
sudo sed -i "s/^VERSION=.*/VERSION=\$(cat \$SRC\/VERSION | cut -d\".\" -f1-2)\"-\$(dpkg --print-architecture)\"/" build/userpatches/config-docker.conf
sudo sed -i "s/^BASE_IMAGE=.*/BASE_IMAGE=\"ubuntu:jammy\"/" build/userpatches/config-docker.conf
sudo sed -i 's/armbian:/ghcr.io\/armbian\/build:/g' build/userpatches/config-docker.conf
sudo sed -i "s/ -it/ -i/" build/userpatches/config-docker.conf
OLD="ghcr.io/armbian/build:$(cat build/VERSION | cut -d"." -f1-2)"-$(dpkg --print-architecture)
sudo cp scripts/VERSION build/VERSION
sudo docker tag $OLD ghcr.io/armbian/build:$(cat build/VERSION | cut -d"." -f1-2)-$(dpkg --print-architecture)
- name: Build
run: |
BOARD=${{ matrix.board }}
APP=${{ matrix.node }}
VERSION=$(cat build/VERSION)
RELEASE=$(cat distribution/images/${APP}/RELEASE)
SKIP=$(cat distribution/images/${APP}/SKIP)
if [[ "$SKIP" != "yes" ]]; then
cd build
sudo touch .ignore_changes
./compile.sh docker \
BETA="no" \
RELEASE="${RELEASE}" \
BUILD_DESKTOP="no" \
BUILD_MINIMAL="yes" \
KERNEL_ONLY="no" \
VENDOR="Armbian_${APP^}" \
KERNEL_CONFIGURE="no" \
COMPRESS_OUTPUTIMAGE="xz" \
FORCE_USE_RAMDISK="yes" \
FAST_CREATE_IMAGE="yes" \
BOARD="${BOARD}" \
USE_TORRENT="yes" \
USE_MAINLINE_GOOGLE_MIRROR="yes" \
BRANCH="current" \
SKIP_EXTERNAL_TOOLCHAINS="yes" \
OFFLINE_WORK="yes" \
BSPFREEZE="yes" \
REPOSITORY_INSTALL="u-boot,kernel,armbian-config,armbian-bsp,armbian-firmware" \
EXPERT="yes"
cd output/images
mv *.xz "${APP^}"_"${BOARD^}"_Armbian_"${VERSION}".img.xz
sha256sum "${APP^}"_"${BOARD^}"_Armbian_"${VERSION}".img.xz > "${APP^}"_"${BOARD^}"_Armbian_"${VERSION}".img.xz.sha
echo ${{ secrets.GPG_PASSPHRASE1 }} | gpg --passphrase-fd 0 --armor --detach-sign --pinentry-mode loopback --batch --yes *.img.xz
fi
- name: Declare vars
id: vars
shell: bash
run: |
cd build
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
echo "::set-output name=timenow::$(date +'%Y-%m-%d')"
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: distribution/README.md
tag_name: ${{ matrix.board }}/apps
files: build/output/images/*_Armbian_*
draft: false
prerelease: false
name: "Armbian turnkey applications for ${{ matrix.board }}"
repository: igorpecovnik/distribution

View File

@@ -1,7 +1,7 @@
name: Sync
on:
schedule:
- cron: '0 1 * * *'
# schedule:
# - cron: '0 1 * * *'
workflow_dispatch:
@@ -15,9 +15,9 @@ jobs:
- name: Add
run: |
echo '<h3 align=center><a href="#build-tools"><img src="https://raw.githubusercontent.com/armbian/build/master/.github/armbian-logo.png" alt="Armbian logo" width="144"></a><br>mirror sync</h3>' > README.md
echo '<h3 align=center><a href="#build-tools"><img src="https://raw.githubusercontent.com/armbian/build/master/.github/armbian-logo.png" alt="Armbian logo" width="144"></a><br>applications distribution</h3>' > README.md
echo -en "<p align=right>&nbsp;</p>\n" >> README.md
echo -en "\n[![Sync mirror](https://github.com/armbian/mirror/actions/workflows/mirror-sync.yml/badge.svg)](https://github.com/armbian/mirror/actions/workflows/mirror-sync.yml) [![Rootfs sync](https://github.com/armbian/mirror/actions/workflows/rootfs-sync.yml/badge.svg)](https://github.com/armbian/mirror/actions/workflows/rootfs-sync.yml)" >> README.md
echo -en "WIP with hardcoded values for targets\n" >> README.md
- name: Add
run: |

View File

@@ -1,4 +1,2 @@
<h3 align=center><a href="#build-tools"><img src="https://raw.githubusercontent.com/armbian/build/master/.github/armbian-logo.png" alt="Armbian logo" width="144"></a><br>mirror sync</h3>
<h3 align=center><a href="#build-tools"><img src="https://raw.githubusercontent.com/armbian/build/master/.github/armbian-logo.png" alt="Armbian logo" width="144"></a><br>applications distribution</h3>
<p align=right>&nbsp;</p>
[![Sync mirror](https://github.com/armbian/mirror/actions/workflows/mirror-sync.yml/badge.svg)](https://github.com/armbian/mirror/actions/workflows/mirror-sync.yml) [![Rootfs sync](https://github.com/armbian/mirror/actions/workflows/rootfs-sync.yml/badge.svg)](https://github.com/armbian/mirror/actions/workflows/rootfs-sync.yml)

1
images/omv/RELEASE Normal file
View File

@@ -0,0 +1 @@
bullseye

1
images/omv/SKIP Normal file
View File

@@ -0,0 +1 @@
yes

View File

@@ -0,0 +1,26 @@
apt-get install --yes gnupg
wget -O "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" https://packages.openmediavault.org/public/archive.key
apt-key add "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc"
cat <<EOF >> /etc/apt/sources.list.d/openmediavault.list
deb https://packages.openmediavault.org/public shaitan main
# deb https://downloads.sourceforge.net/project/openmediavault/packages shaitan main
## Uncomment the following line to add software from the proposed repository.
# deb https://packages.openmediavault.org/public shaitan-proposed main
# deb https://downloads.sourceforge.net/project/openmediavault/packages shaitan-proposed main
## This software is not part of OpenMediaVault, but is offered by third-party
## developers as a service to OpenMediaVault users.
# deb https://packages.openmediavault.org/public shaitan partner
# deb https://downloads.sourceforge.net/project/openmediavault/packages shaitan partner
EOF
export LANG=C.UTF-8
export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none
apt-get update
apt-get --yes --auto-remove --show-upgraded \
--allow-downgrades --allow-change-held-packages \
--no-install-recommends \
--option DPkg::Options::="--force-confdef" \
--option DPkg::Options::="--force-confold" \
install openmediavault-keyring openmediavault
omv-confdbadm populate

1
images/omv/overlay/foe Normal file
View File

@@ -0,0 +1 @@

1
images/openhab/RELEASE Normal file
View File

@@ -0,0 +1 @@
jammy

1
images/openhab/SKIP Normal file
View File

@@ -0,0 +1 @@
no

View File

@@ -0,0 +1,23 @@
#!/bin/bash
echo "Read / only rootfs"
apt-get -y install overlayroot docker.io cgroup-lite
sed -i "s/^overlayroot=.*/overlayroot=\"tmpfs\"/" /etc/overlayroot.conf
sed -i "s/^overlayroot_cfgdisk=.*/overlayroot_cfgdisk=\"enabled\"/" /etc/overlayroot.conf
echo "Openhab"
groupadd -g 9001 openhab
useradd -g 9001 openhab
usermod -aG docker openhab
su openhab
docker run \
--privileged \
--name openhab \
--net=host \
-v /etc/localtime:/etc/localtime:ro \
-v /etc/timezone:/etc/timezone:ro \
-v openhab_addons:/openhab/addons \
-v openhab_conf:/openhab/conf \
-v openhab_userdata:/openhab/userdata \
-d \
--restart=always \
openhab/openhab:3.2.0

View File

@@ -0,0 +1 @@

1
images/plex/RELEASE Normal file
View File

@@ -0,0 +1 @@
jammy

1
images/plex/SKIP Normal file
View File

@@ -0,0 +1 @@
no

View File

@@ -0,0 +1,7 @@
#!/bin/bash
echo "Read / only rootfs"
apt-get -y
echo -e "deb https://downloads.plex.tv/repo/deb public main" > /etc/apt/sources.list.d/plex.list
wget -q -O - https://downloads.plex.tv/plex-keys/PlexSign.key | apt-key add - >/dev/null 2>&1
apt-get update
apt-get -y install plexmediaserver

1
images/plex/overlay/foe Normal file
View File

@@ -0,0 +1 @@