diff --git a/.github/workflows/workflow_without_post.yml b/.github/workflows/workflow_without_post.yml new file mode 100644 index 0000000..a25e672 --- /dev/null +++ b/.github/workflows/workflow_without_post.yml @@ -0,0 +1,173 @@ +name: Build module (Without telegram post) + +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag for the release (x.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 + steps: + - uses: actions/checkout@v4 + + - name: Make build dirs + run: mkdir -p zaprett/system/bin zaprett-extended/system/bin zaprett-tv/system/bin zaprett/system/etc/zaprett/lists zapret-latest out lists zapret-extended/system/etc/zaprett/lists zapret-tv/system/etc/zaprett/lists + + - name: Download latest zapret binaries + run: | + LATEST_RELEASE=$(curl -s https://api.github.com/repos/bol-van/zapret/releases/latest) + DOWNLOAD_URL=$(echo "$LATEST_RELEASE" | grep -o 'browser_download_url.*zapret-v.*\.zip"' | cut -d'"' -f3) + wget $DOWNLOAD_URL -O zapret-latest.zip + + - name: Unzip zapret binaries + run: | + unzip -o zapret-latest.zip + ZAPRET_DIR=$(find . -maxdepth 1 -type d -name 'zapret-v*' | head -n 1) + if [ "$(ls -A "$ZAPRET_DIR")" ]; then + mv "$ZAPRET_DIR"/* zapret-latest/ + else + echo "Warning: $ZAPRET_DIR is empty" + fi + rm -rf "${ZAPRET_DIR}" + rm zapret-latest.zip + + - name: Copy files to dirs + run: | + #copy nfqws and zaprett + cp zapret-latest/binaries/android-arm/nfqws zaprett/system/bin/nfqws_arm32 + cp zapret-latest/binaries/android-arm64/nfqws zaprett/system/bin/nfqws_arm64 + cp zapret-latest/binaries/android-x86/nfqws zaprett/system/bin/nfqws_x86 + cp zapret-latest/binaries/android-x86_64/nfqws zaprett/system/bin/nfqws_x86_64 + cp zapret-latest/binaries/linux-mips/nfqws zaprett/system/bin/nfqws_mips + cp zapret-latest/binaries/linux-mipsel/nfqws zaprett/system/bin/nfqws_mipsel + #cp src/bin/zaprett zaprett/system/bin/ + + cp -a src/* zaprett/ + + #copy all files to another distributions + cp -r zaprett/* zaprett-extended/ + cp -r zaprett/* zaprett-tv/ + - name: Download and copy actual lists + run: | + wget https://raw.githubusercontent.com/CherretGit/zaprett-hosts-repo/refs/heads/main/lists/list-youtube.txt -O lists/list-youtube.txt + wget https://raw.githubusercontent.com/CherretGit/zaprett-hosts-repo/refs/heads/main/lists/list-discord.txt -O lists/list-discord.txt + wget https://raw.githubusercontent.com/CherretGit/zaprett-hosts-repo/refs/heads/main/lists/list-extended.txt -O lists/list-extended.txt + + cp lists/list-youtube.txt zaprett/system/etc/zaprett/lists/ + cp lists/list-youtube.txt zaprett-extended/system/etc/zaprett/lists/ + cp lists/list-youtube.txt zaprett-tv/system/etc/zaprett/lists/ + + cp lists/list-discord.txt zaprett/system/etc/zaprett/lists/ + cp lists/list-discord.txt zaprett-extended/system/etc/zaprett/lists/ + + cp lists/list-extended.txt zaprett-extended/system/etc/zaprett/lists/ + + - name: Create module.prop + run: | + cat > zaprett/module.prop < zaprett-extended/module.prop < zaprett-tv/module.prop < changelog.md + + - name: Update update.json + run: | + cat > update.json < update_extended.json < update_tv.json <