From f6c998e8c9ab7ae2734084dfd571d749734f8117 Mon Sep 17 00:00:00 2001 From: Vadim Vetrov Date: Thu, 28 Nov 2024 19:19:01 +0300 Subject: [PATCH] Workflow update --- .github/builder_containers/README.md | 1 + .../entware-x86-2.6.Dockerfile | 6 ++ .github/builder_containers/entware_docker | 1 + .github/workflows/build-ci.yml | 102 +++++------------- .gitmodules | 3 + 5 files changed, 37 insertions(+), 76 deletions(-) create mode 100644 .github/builder_containers/README.md create mode 100644 .github/builder_containers/entware-x86-2.6.Dockerfile create mode 160000 .github/builder_containers/entware_docker create mode 100644 .gitmodules diff --git a/.github/builder_containers/README.md b/.github/builder_containers/README.md new file mode 100644 index 0000000..a0f0691 --- /dev/null +++ b/.github/builder_containers/README.md @@ -0,0 +1 @@ +This directory contains dockerfiles for large docker containers. This allows not to rebuild binaries every build and not to utilize cache. diff --git a/.github/builder_containers/entware-x86-2.6.Dockerfile b/.github/builder_containers/entware-x86-2.6.Dockerfile new file mode 100644 index 0000000..e269938 --- /dev/null +++ b/.github/builder_containers/entware-x86-2.6.Dockerfile @@ -0,0 +1,6 @@ +FROM waujito/entware_builder +RUN git clone --depth 1 https://github.com/Entware/Entware.git -b k2.6 +WORKDIR /home/me/Entware +RUN make package/symlinks +RUN cp -v configs/x86-2.6.config .config +RUN make -j$(nproc) toolchain/install diff --git a/.github/builder_containers/entware_docker b/.github/builder_containers/entware_docker new file mode 160000 index 0000000..90eb6bc --- /dev/null +++ b/.github/builder_containers/entware_docker @@ -0,0 +1 @@ +Subproject commit 90eb6bc0a48496c98468581c3c820235fa6e6335 diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index ec4e1fb..1377731 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -2,8 +2,8 @@ name: CI on: push: - branches: - - main + # branches: + # - main paths-ignore: - '.editorconfig' - '.gitignore' @@ -38,6 +38,7 @@ jobs: fi build-static: + if: false needs: prepare name: build ${{ matrix.arch }} runs-on: ubuntu-latest @@ -97,6 +98,7 @@ jobs: path: ./**/youtubeUnblock*.tar.gz build-static-cross: + if: false needs: prepare name: build ${{ matrix.arch }} runs-on: ubuntu-latest @@ -160,6 +162,7 @@ jobs: path: ./**/youtubeUnblock*.tar.gz build-openwrt: + if: false needs: prepare runs-on: ubuntu-latest strategy: @@ -245,6 +248,7 @@ jobs: if-no-files-found: error build-openwrt-luci: + if: false needs: prepare runs-on: ubuntu-latest container: @@ -303,64 +307,21 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - arch: - - aarch64-3.10 - - armv7-3.2 - - mips-3.4 - - mipsel-3.4 - - x64-3.2 + # arch: + # - aarch64-3.10 + # - armv7-3.2 + # - mips-3.4 + # - mipsel-3.4 + # - x64-3.2 include: - - arch: armv7-2.6 - k26: true + # - arch: armv7-2.6 + # k26: true - arch: x86-2.6 k26: true + container: + image: waujito/entware_builder:${{ matrix.arch }} + options: --user root steps: - - name: Set up Entware docker container - run: | - git clone --depth 1 https://github.com/Entware/docker.git - docker build docker --pull --tag builder - docker volume create entware-home - - - name: Restore Entware from cache - id: cache-restore - uses: actions/cache/restore@v4 - with: - path: ~/entware - key: entware-${{ matrix.arch }} - - - name: Load Entware from cache - if: steps.cache-restore.outputs.cache-hit == 'true' - run: | - docker run --rm --mount source=entware-home,target=/backup_vol -v ~/entware:/backup ubuntu tar -xf /backup/entware.tar -C /backup_vol - docker run --rm --mount source=entware-home,target=/home/me -w /home/me ubuntu bash -c 'cp -r ./backup_vol/* ./' - docker run --rm --mount source=entware-home,target=/home/me -w /home/me ubuntu bash -c 'chown -R 1000:1000 ./* ./' - - - name: Obtain Entware - if: ${{ steps.cache-restore.outputs.cache-hit != 'true' && ! matrix.k26 }} - run: | - docker run --rm -i --mount source=entware-home,target=/home/me -w /home/me --name builder builder git clone --depth 1 https://github.com/Entware/Entware.git - - - name: Obtain Entware k2.6 - if: ${{ steps.cache-restore.outputs.cache-hit != 'true' && matrix.k26 }} - run: | - docker run --rm -i --mount source=entware-home,target=/home/me -w /home/me --name builder builder git clone --depth 1 https://github.com/Entware/Entware.git -b k2.6 - - - name: Build Entware - if: steps.cache-restore.outputs.cache-hit != 'true' - run: | - docker run --rm -i --mount source=entware-home,target=/home/me -w /home/me/Entware --name builder builder make package/symlinks - docker run --rm -i --mount source=entware-home,target=/home/me -w /home/me/Entware --name builder builder cp -v configs/${{ matrix.arch }}.config .config - docker run --rm -i --mount source=entware-home,target=/home/me -w /home/me/Entware --name builder builder make -j$(nproc) toolchain/install - docker run --rm --mount source=entware-home,target=/backup_vol -v ~/entware:/backup ubuntu tar -cf /backup/entware.tar /backup_vol - - - name: Save Entware to cache - if: steps.cache-restore.outputs.cache-hit != 'true' - id: cache-save - uses: actions/cache/save@v4 - with: - path: ~/entware - key: entware-${{ matrix.arch }} - - name: Checkout uses: actions/checkout@v4 with: @@ -376,34 +337,23 @@ jobs: - name: Build packages id: build + working-directory: /home/me/Entware run: | - echo "src-link youtubeUnblock /youtubeUnblock" | docker run --rm -i --mount source=entware-home,target=/home/me -v $GITHUB_WORKSPACE:/youtubeUnblock -w /home/me/Entware --name builder builder tee -a feeds.conf - docker run --rm -i --mount source=entware-home,target=/home/me -v $GITHUB_WORKSPACE:/youtubeUnblock -w /home/me/Entware --name builder builder ./scripts/feeds update youtubeUnblock - docker run --rm -i --mount source=entware-home,target=/home/me -v $GITHUB_WORKSPACE:/youtubeUnblock -w /home/me/Entware --name builder builder ./scripts/feeds install -a -p youtubeUnblock - echo "CONFIG_PACKAGE_youtubeUnblock=m" | docker run --rm -i --mount source=entware-home,target=/home/me -v $GITHUB_WORKSPACE:/youtubeUnblock -w /home/me/Entware --name builder builder tee -a .config - docker run --rm -i --mount source=entware-home,target=/home/me -v $GITHUB_WORKSPACE:/youtubeUnblock -w /home/me/Entware --name builder builder make package/youtubeUnblock/compile V=s + echo "src-link youtubeUnblock $GITHUB_WORKSPACE" >> feeds.conf + cat feeds.conf + ./scripts/feeds update youtubeUnblock + ./scripts/feeds install -a -p youtubeUnblock + echo "CONFIG_PACKAGE_youtubeUnblock=m" | tee -a .config + make package/youtubeUnblock/compile V=s - - name: Extract packages - if: steps.build.outcome == 'success' - shell: bash - env: - VERSION: ${{ needs.prepare.outputs.version }} - RELEASE: ${{ needs.prepare.outputs.release }} - SHA: ${{ needs.prepare.outputs.sha }} - run: | - mkdir output - docker run --rm --user root -i --mount source=entware-home,target=/home/me -v $(pwd):/target -w /home/me/Entware --name builder builder find ./bin -type f -name 'youtubeUnblock*.ipk' -exec cp -v {} /target/output \; - rm -rf youtubeUnblock || true - mkdir youtubeUnblock - bash -c "cp -r ./output/* youtubeUnblock" - tar -czvf youtubeUnblock-$VERSION-$RELEASE-$SHA-${{ matrix.arch }}-entware.tar.gz youtubeUnblock + mv $(find ./bin -type f -name 'youtubeUnblock*.ipk') ./youtubeUnblock-$VERSION-$RELEASE-$SHA-entware-${{ matrix.arch }}.ipk - name: Upload packages if: steps.build.outcome == 'success' uses: actions/upload-artifact@v4 with: name: youtubeUnblock-entware-${{ matrix.arch }} - path: ./**/youtubeUnblock*-entware.tar.gz + path: /home/me/Entware/youtubeUnblock*.ipk if-no-files-found: error pre-release: diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c700c9c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".github/builder_containers/entware_docker"] + path = .github/builder_containers/entware_docker + url = https://github.com/Entware/docker.git