diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml new file mode 100644 index 0000000..171995d --- /dev/null +++ b/.github/workflows/generate.yml @@ -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 diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 7bcfab5..921f33c 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -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 '


\n" >> README.md - echo -en "\n[](https://github.com/armbian/mirror/actions/workflows/mirror-sync.yml) [](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: | diff --git a/README.md b/README.md index c88ff27..52232f0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,2 @@ -


- -[](https://github.com/armbian/mirror/actions/workflows/mirror-sync.yml) [](https://github.com/armbian/mirror/actions/workflows/rootfs-sync.yml) \ No newline at end of file diff --git a/images/omv/RELEASE b/images/omv/RELEASE new file mode 100644 index 0000000..2e8dcb1 --- /dev/null +++ b/images/omv/RELEASE @@ -0,0 +1 @@ +bullseye diff --git a/images/omv/SKIP b/images/omv/SKIP new file mode 100644 index 0000000..7cfab5b --- /dev/null +++ b/images/omv/SKIP @@ -0,0 +1 @@ +yes diff --git a/images/omv/customize-image.sh b/images/omv/customize-image.sh new file mode 100644 index 0000000..e8e7591 --- /dev/null +++ b/images/omv/customize-image.sh @@ -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 <