From ab7c49864c2292facef1e85021fca5d82513c144 Mon Sep 17 00:00:00 2001 From: egor-white <68005462+egor-white@users.noreply.github.com> Date: Sun, 2 Nov 2025 22:03:03 +0300 Subject: [PATCH] Update workflow.yml --- .github/workflows/workflow.yml | 144 ++++++++++++++++++++++++++++++--- 1 file changed, 134 insertions(+), 10 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index a2a4317..c347bc5 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -132,12 +132,142 @@ jobs: name: ${{ inputs.release_name }} body: ${{ inputs.release_changes }} files: out/* +name: Build module + +on: + workflow_dispatch: + inputs: + create_release: + description: 'Create GitHub release?' + required: false + default: 'false' + tag: + description: "Tag for the release (x.x.x)" + required: true + type: string + zapret-version: + description: "Zapret version (x.x)" + required: true + type: string + version: + description: "Module version (x.x)" + required: true + type: string + version_code: + description: "Module version code (xx)" + required: true + type: string + release_name: + description: "Release Name" + required: true + type: string + release_changes: + description: "Release Changes" + required: true + type: string + +jobs: + build: + runs-on: ubuntu-latest + env: + ZAPRET_VERSION: ${{ inputs.zapret-version }} + steps: + - uses: actions/checkout@v4 + + - name: Setup Git submodules + run: git submodule update --init --recursive + + - name: Install dependencies + run: sudo apt install build-essential pkg-config just unzip + + - name: Build zaprett + run: just -f rust/justfile build-android --release + + - name: Make build dirs + run: mkdir -p zaprett/system/bin zaprett-hosts/system/bin zaprett/system/etc/zaprett/lists out lists zapret-hosts/system/etc/zaprett/lists + + - name: Copy files to dirs + run: | + #copy nfqws and zaprett + cp rust/target/armv7-linux-androideabi/release/zaprett zaprett/system/bin/zaprett-armv7 + cp rust/target/aarch64-linux-android/release/zaprett zaprett/system/bin/zaprett-aarch64 + cp rust/target/x86_64-linux-android/release/zaprett zaprett/system/bin/zaprett-x86_64 + + cp -a src/* zaprett/ + cp -r zaprett/* zaprett-hosts/ + + - name: Download and copy actual lists + run: | + wget https://raw.githubusercontent.com/CherretGit/zaprett-repo/refs/heads/main/lists/include/list-youtube.txt -O lists/list-youtube.txt + wget https://raw.githubusercontent.com/CherretGit/zaprett-repo/refs/heads/main/lists/include/list-discord.txt -O lists/list-discord.txt + + cp lists/list-youtube.txt zaprett/system/etc/zaprett/lists/ + cp lists/list-youtube.txt zaprett-hosts/system/etc/zaprett/lists/ + + cp lists/list-discord.txt zaprett/system/etc/zaprett/lists/ + cp lists/list-discord.txt zaprett-hosts/system/etc/zaprett/lists/ + + cp hosts/hosts zaprett-hosts/system/etc + + - name: Create module.prop + run: | + cat > zaprett/module.prop < zaprett-hosts/module.prop < changelog.md + if: ${{ inputs.create_release == 'true' }} + run: echo "${{ inputs.release_changes }}" > changelog.md - name: Update update.json + if: ${{ inputs.create_release == 'true' }} run: | cat > update.json < update_tv.json <