From 21be10caedd7d58d7c4b11a99061acdb0dba6475 Mon Sep 17 00:00:00 2001 From: Vadim Vetrov Date: Sat, 10 Aug 2024 11:57:08 +0300 Subject: [PATCH] Entware Workflow --- .github/workflows/build-entware.yml | 97 +++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-entware.yml diff --git a/.github/workflows/build-entware.yml b/.github/workflows/build-entware.yml new file mode 100644 index 0000000..994779d --- /dev/null +++ b/.github/workflows/build-entware.yml @@ -0,0 +1,97 @@ +name: Entware Workflow + +on: + - push + +jobs: + build: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.build.outputs.version }} + strategy: + matrix: + branch: [entware] + arch: + - aarch64-3.10 + - armv7-3.2 + - mips-3.4 + - mipsel-3.4 + - x64-3.2 + steps: + - name: Entware docker container + run: | + git clone https://github.com/Entware/docker.git + docker build docker --pull --tag builder + docker volume create entware-home + + - name: Get cache dir + id: cache_dir + run: | + mkdir gh_act_cache + echo "cache_dir=$(pwd)/gh_act_cache" >> ${GITHUB_OUTPUT} + + - name: Restore cached build + id: cache-build-restore + uses: actions/cache/restore@v4 + with: + path: ${{ steps.cache_dir.outputs.cache_dir }} + key: ${{ matrix.arch }}-cache + + - name: Load entware from cache + if: steps.cache-build-restore.outputs.cache-hit == 'true' + run: | + docker run --rm --mount source=entware-home,target=/backup_vol -v ${{ steps.cache_dir.outputs.cache_dir }}:/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: Build entware + if: steps.cache-build-restore.outputs.cache-hit != 'true' + run: | + docker run --rm -i --mount source=entware-home,target=/home/me -w /home/me --name builder builder git clone https://github.com/Entware/Entware.git + 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 ${{ steps.cache_dir.outputs.cache_dir }}:/backup ubuntu tar -cf /backup/entware.tar /backup_vol/ + + - name: Save cache build + if: steps.cache-build-restore.outputs.cache-hit != 'true' + id: cache-build-save + uses: actions/cache/save@v4 + with: + path: ${{ steps.cache_dir.outputs.cache_dir }} + key: ${{ matrix.arch }}-cache + + - name: Checkout + uses: actions/checkout@v4 + with: + ref: 'openwrt' + + - name: Prepare workflow + shell: bash + run: | + sed -i 's/PKG_REV:=.*$/PKG_REV:=${{ github.sha }}/;s/PKG_VERSION:=.*$/PKG_VERSION:=$(date %Y%m%d)/' youtubeUnblock/Makefile + + - name: Build packages + id: build + shell: bash + 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 + + - name: Extract packages + if: steps.build.outcome == 'success' + 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 cp -r bin /target/output/ + + - name: Upload packages + if: steps.build.outcome == 'success' + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.arch }}-${{ matrix.branch }} + path: ./output/**/* + if-no-files-found: error + diff --git a/README.md b/README.md index 34aec4e..f7181f3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # youtubeUnblock -Bypasses Googlevideo detection systems that relies on SNI. The package is for Linux only. The package is fully compatible with routers running OpenWRT. The binaries are available under [Github Actions](https://github.com/Waujito/youtubeUnblock/actions). To learn how to build and configure the package on OpenWRT, consult [this chapter](https://github.com/Waujito/youtubeUnblock?tab=readme-ov-file#openwrt-case). +Bypasses Googlevideo detection systems that relies on SNI. The package is for Linux only. The package is fully compatible with routers running OpenWRT. The binaries are available under [Github Actions OpenWRT Workflow](https://github.com/Waujito/youtubeUnblock/actions/workflows/build-openwrt.yml). To learn how to build and configure the package on OpenWRT, consult [this chapter](https://github.com/Waujito/youtubeUnblock?tab=readme-ov-file#openwrt-case). For Windows use [GoodbyeDPI from ValdikSS](https://github.com/ValdikSS/GoodbyeDPI) (you can find how to use it for YouTube [here](https://github.com/ValdikSS/GoodbyeDPI/issues/378)) The same behavior is also implemented in [zapret package for linux](https://github.com/bol-van/zapret).