diff --git a/.github/workflows/R2C-OpenWrt.yml b/.github/workflows/R2C-OpenWrt.yml index 71fee8260..78e61dd6f 100644 --- a/.github/workflows/R2C-OpenWrt.yml +++ b/.github/workflows/R2C-OpenWrt.yml @@ -115,6 +115,30 @@ jobs: cd openwrt && make -j1 V=s - name: Print Disk Space After run: df -h + - name: Prepare ImageBuilder Docker image files + run: | + /bin/bash 08_prepare_ib.sh + image_base="${{ github.repository }}-imagebuilder:R2C-${{ env.latest_release }}" + image_base=$(echo $image_base | awk '{print tolower($0)}') + versioned_image="${image_base}-$(date +%Y-%m-%d)" + latest_image="${image_base}-latest" + echo "versioned_image=${versioned_image}" >>$GITHUB_ENV + echo "latest_image=${latest_image}" >>$GITHUB_ENV + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and release ImageBuilder Docker images + uses: docker/build-push-action@v4 + with: + platforms: linux/amd64 + context: ./IMAGEBUILDER + tags: | + ghcr.io/${{ env.versioned_image }} + ghcr.io/${{ env.latest_image }} + push: true - name: Organize files id: organize run: | diff --git a/.github/workflows/R2S-OpenWrt.yml b/.github/workflows/R2S-OpenWrt.yml index ce66ea638..1bc6f93fd 100644 --- a/.github/workflows/R2S-OpenWrt.yml +++ b/.github/workflows/R2S-OpenWrt.yml @@ -115,6 +115,30 @@ jobs: cd openwrt && make -j1 V=s - name: Print Disk Space After run: df -h + - name: Prepare ImageBuilder Docker image files + run: | + /bin/bash 08_prepare_ib.sh + image_base="${{ github.repository }}-imagebuilder:R2S-${{ env.latest_release }}" + image_base=$(echo $image_base | awk '{print tolower($0)}') + versioned_image="${image_base}-$(date +%Y-%m-%d)" + latest_image="${image_base}-latest" + echo "versioned_image=${versioned_image}" >>$GITHUB_ENV + echo "latest_image=${latest_image}" >>$GITHUB_ENV + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and release ImageBuilder Docker images + uses: docker/build-push-action@v4 + with: + platforms: linux/amd64 + context: ./IMAGEBUILDER + tags: | + ghcr.io/${{ env.versioned_image }} + ghcr.io/${{ env.latest_image }} + push: true - name: Organize files id: organize run: | diff --git a/.github/workflows/R4S-OpenWrt.yml b/.github/workflows/R4S-OpenWrt.yml index bd840af92..03cac845e 100644 --- a/.github/workflows/R4S-OpenWrt.yml +++ b/.github/workflows/R4S-OpenWrt.yml @@ -115,6 +115,30 @@ jobs: cd openwrt && make -j1 V=s - name: Print Disk Space After run: df -h + - name: Prepare ImageBuilder Docker image files + run: | + /bin/bash 08_prepare_ib.sh + image_base="${{ github.repository }}-imagebuilder:R4S-${{ env.latest_release }}" + image_base=$(echo $image_base | awk '{print tolower($0)}') + versioned_image="${image_base}-$(date +%Y-%m-%d)" + latest_image="${image_base}-latest" + echo "versioned_image=${versioned_image}" >>$GITHUB_ENV + echo "latest_image=${latest_image}" >>$GITHUB_ENV + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and release ImageBuilder Docker images + uses: docker/build-push-action@v4 + with: + platforms: linux/amd64 + context: ./IMAGEBUILDER + tags: | + ghcr.io/${{ env.versioned_image }} + ghcr.io/${{ env.latest_image }} + push: true - name: Organize files id: organize run: | diff --git a/.github/workflows/X86-OpenWrt.yml b/.github/workflows/X86-OpenWrt.yml index 8f16b7af8..90b9aeede 100644 --- a/.github/workflows/X86-OpenWrt.yml +++ b/.github/workflows/X86-OpenWrt.yml @@ -115,6 +115,31 @@ jobs: cd openwrt && make -j1 V=s - name: Print Disk Space After run: df -h + - name: Prepare ImageBuilder Docker image files + run: | + /bin/bash 08_prepare_ib.sh + image_base="${{ github.repository }}-imagebuilder:X86-${{ env.latest_release }}" + image_base=$(echo $image_base | awk '{print tolower($0)}') + versioned_image="${image_base}-$(date +%Y-%m-%d)" + latest_image="${image_base}-latest" + echo "versioned_image=${versioned_image}" >>$GITHUB_ENV + echo "latest_image=${latest_image}" >>$GITHUB_ENV + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and release ImageBuilder Docker images + uses: docker/build-push-action@v4 + with: + platforms: linux/amd64 + context: ./IMAGEBUILDER + tags: | + ghcr.io/${{ env.versioned_image }} + ghcr.io/${{ env.latest_image }} + push: true + - name: Organize files id: organize run: | diff --git a/IMAGEBUILDER/Dockerfile b/IMAGEBUILDER/Dockerfile new file mode 100644 index 000000000..036b2e683 --- /dev/null +++ b/IMAGEBUILDER/Dockerfile @@ -0,0 +1,15 @@ +FROM ghcr.io/openwrt/buildbot/buildworker-v3.8.0:latest + +ARG USER=buildbot +ARG WORKDIR=/builder/ +ARG CMD="/bin/bash" + +USER $USER +WORKDIR $WORKDIR + +COPY --chown=$USER:$USER ./imagebuilder/ ./ + +ENTRYPOINT [ ] + +# required to have CMD as ENV to be executed +ENV CMD_ENV=${CMD} \ No newline at end of file diff --git a/SCRIPTS/08_prepare_ib.sh b/SCRIPTS/08_prepare_ib.sh new file mode 100644 index 000000000..aece41a34 --- /dev/null +++ b/SCRIPTS/08_prepare_ib.sh @@ -0,0 +1,7 @@ +#!/bin/bash +file=$(find . | grep "imagebuilder-.*x86_64.tar.xz" | head -n 1) +cp $file ./IMAGEBUILDER/imagebuilder.tar.xz +cd IMAGEBUILDER +tar -xvf imagebuilder.tar.xz +mv $(basename $file .tar.xz) imagebuilder +rm -rf imagebuilder.tar.xz \ No newline at end of file diff --git a/SEED/R2C/config.seed b/SEED/R2C/config.seed index 8136faabb..0fe04e453 100644 --- a/SEED/R2C/config.seed +++ b/SEED/R2C/config.seed @@ -1,4 +1,5 @@ ### INITIALIZATION ### +CONFIG_IB=y CONFIG_TARGET_rockchip=y CONFIG_TARGET_rockchip_armv8=y CONFIG_TARGET_rockchip_armv8_DEVICE_friendlyarm_nanopi-r2c=y diff --git a/SEED/R2S/config.seed b/SEED/R2S/config.seed index e1635e2e0..785a1da5e 100644 --- a/SEED/R2S/config.seed +++ b/SEED/R2S/config.seed @@ -1,4 +1,5 @@ ### INITIALIZATION ### +CONFIG_IB=y CONFIG_TARGET_rockchip=y CONFIG_TARGET_rockchip_armv8=y CONFIG_TARGET_rockchip_armv8_DEVICE_friendlyarm_nanopi-r2s=y diff --git a/SEED/R4S/config.seed b/SEED/R4S/config.seed index a404c3029..f20768a45 100644 --- a/SEED/R4S/config.seed +++ b/SEED/R4S/config.seed @@ -1,4 +1,5 @@ ### INITIALIZATION ### +CONFIG_IB=y CONFIG_TARGET_rockchip=y CONFIG_TARGET_rockchip_armv8=y CONFIG_TARGET_rockchip_armv8_DEVICE_friendlyarm_nanopi-r4s=y diff --git a/SEED/X86/config.seed b/SEED/X86/config.seed index b8a5034e3..44aa72906 100644 --- a/SEED/X86/config.seed +++ b/SEED/X86/config.seed @@ -1,4 +1,5 @@ ### INITIALIZATION ### +CONFIG_IB=y CONFIG_TARGET_x86=y CONFIG_TARGET_x86_64=y CONFIG_TARGET_x86_64_DEVICE_generic=y