From b89fe33296453ae7bb351c57431a3b80322c182a Mon Sep 17 00:00:00 2001 From: SaltyMonkey <1570693+SaltyMonkey@users.noreply.github.com> Date: Wed, 8 Oct 2025 21:42:19 +0300 Subject: [PATCH 1/8] chore: Added apk package manager support for install script --- install.sh | 98 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 78 insertions(+), 20 deletions(-) diff --git a/install.sh b/install.sh index 1ea1efb..66ce08f 100755 --- a/install.sh +++ b/install.sh @@ -4,6 +4,10 @@ REPO="https://api.github.com/repos/itdoginfo/podkop/releases/latest" DOWNLOAD_DIR="/tmp/podkop" COUNT=3 +# Cached flag to switch between ipk or apk package managers +PKG_IS_APK=0 +command -v apk >/dev/null 2>&1 && PKG_IS_APK=1 + rm -rf "$DOWNLOAD_DIR" mkdir -p "$DOWNLOAD_DIR" @@ -11,20 +15,65 @@ msg() { printf "\033[32;1m%s\033[0m\n" "$1" } +pkg_is_installed () { + local pkg_name="$1" + + if [ "$PKG_IS_APK" -eq 1 ]; then + # grep -q should work without change based on example from documentation + # apk list --installed --providers dnsmasq + # dnsmasq-full-2.90-r3 x86_64 {feeds/base/package/network/services/dnsmasq} (GPL-2.0) [installed] + apk list --installed | grep -q "$pkg_name" + else + opkg list-installed | grep -q "$pkg_name" + fi +} + +pkg_remove() { + local pkg_name="$1" + + if [ "$PKG_IS_APK" -eq 1 ]; then + # TODO: check --force-depends flag + # Nothing here: https://openwrt.org/docs/guide-user/additional-software/opkg-to-apk-cheatsheet + apk del "$pkg_name" + else + opkg remove --force-depends "$pkg_name" + fi +} + +pkg_list_update() { + if [ "$PKG_IS_APK" -eq 1 ]; then + apk update + else + opkg update + fi +} + +pkg_install() { + local pkg_file="$1" + + if [ "$PKG_IS_APK" -eq 1 ]; then + # Can't install without flag based on info from documentation + # If you're installing a non-standard (self-built) package, use the --allow-untrusted option: + apk add --allow-untrusted "$pkg_file" + else + opkg install "$pkg_file" + fi +} + main() { check_system sing_box /usr/sbin/ntpd -q -p 194.190.168.1 -p 216.239.35.0 -p 216.239.35.4 -p 162.159.200.1 -p 162.159.200.123 - opkg update || { echo "opkg update failed"; exit 1; } - + pkg_list_update || { echo "Packages list update failed"; exit 1; } + if [ -f "/etc/init.d/podkop" ]; then msg "Podkop is already installed. Upgraded..." else msg "Installed podkop..." fi - + if command -v curl &> /dev/null; then check_response=$(curl -s "https://api.github.com/repos/itdoginfo/podkop/releases/latest") @@ -34,11 +83,18 @@ main() { fi fi + local grep_url_pattern + if [ "$PKG_IS_APK" -eq 1 ]; then + grep_url_pattern='https://[^"[:space:]]*\.ipk' + else + grep_url_pattern='https://[^"[:space:]]*\.apk' + fi + download_success=0 while read -r url; do filename=$(basename "$url") filepath="$DOWNLOAD_DIR/$filename" - + attempt=0 while [ $attempt -lt $COUNT ]; do msg "Download $filename (count $((attempt+1)))..." @@ -53,40 +109,40 @@ main() { rm -f "$filepath" attempt=$((attempt+1)) done - + if [ $attempt -eq $COUNT ]; then msg "Failed to download $filename after $COUNT attempts" fi - done < <(wget -qO- "$REPO" | grep -o 'https://[^"[:space:]]*\.ipk') - + done < <(wget -qO- "$REPO" | grep -o "$grep_url_pattern") + if [ $download_success -eq 0 ]; then msg "No packages were downloaded successfully" exit 1 fi - + for pkg in podkop luci-app-podkop; do file=$(ls "$DOWNLOAD_DIR" | grep "^$pkg" | head -n 1) if [ -n "$file" ]; then msg "Installing $file" - opkg install "$DOWNLOAD_DIR/$file" + pkg_install "$DOWNLOAD_DIR/$file" sleep 3 fi done ru=$(ls "$DOWNLOAD_DIR" | grep "luci-i18n-podkop-ru" | head -n 1) if [ -n "$ru" ]; then - if opkg list-installed | grep -q luci-i18n-podkop-ru; then + if pkg_is_installed luci-i18n-podkop-ru; then msg "Upgraded ru translation..." - opkg remove luci-i18n-podkop* - opkg install "$DOWNLOAD_DIR/$ru" + pkg_remove remove luci-i18n-podkop* + pkg_install install "$DOWNLOAD_DIR/$ru" else msg "Русский язык интерфейса ставим? y/n (Need a Russian translation?)" while true; do read -r -p '' RUS case $RUS in y) - opkg remove luci-i18n-podkop* - opkg install "$DOWNLOAD_DIR/$ru" + pkg_remove luci-i18n-podkop* + pkg_install "$DOWNLOAD_DIR/$ru" break ;; n) @@ -133,15 +189,17 @@ check_system() { exit 1 fi - if opkg list-installed | grep -q https-dns-proxy; then + if pkg_is_installed https-dns-proxy; then msg "Сonflicting package detected: https-dns-proxy. Remove?" while true; do read -r -p '' DNSPROXY case $DNSPROXY in - yes|y|Y|yes) - opkg remove --force-depends luci-app-https-dns-proxy https-dns-proxy luci-i18n-https-dns-proxy* + yes|y|Y) + pkg_remove luci-app-https-dns-proxy + pkg_remove https-dns-proxy + pkg_remove luci-i18n-https-dns-proxy* break ;; *) @@ -154,7 +212,7 @@ check_system() { } sing_box() { - if ! opkg list-installed | grep -q "^sing-box"; then + if ! pkg_is_installed "^sing-box"; then return fi @@ -165,8 +223,8 @@ sing_box() { msg "sing-box version $sing_box_version is older than required $required_version" msg "Removing old version..." service podkop stop - opkg remove sing-box --force-depends + pkg_remove sing-box fi } -main +main \ No newline at end of file From 6ff543d7fb5c0028dca6821d207c63f9ba164f1f Mon Sep 17 00:00:00 2001 From: SaltyMonkey <1570693+SaltyMonkey@users.noreply.github.com> Date: Wed, 8 Oct 2025 21:57:46 +0300 Subject: [PATCH 2/8] refactor: Update podkop package * Removed direct package manager calls * Removed commands related to optional luci package * Added optional parameter for global_check for cases when function called by LuCI package * Removed useless external calls in version check cases * Improved build process support: version will be automatically set at installation time from package metadata and will be readable from script itself --- podkop/Makefile | 3 ++- podkop/files/usr/bin/podkop | 23 ++++++++--------------- podkop/files/usr/lib/constants.sh | 1 + 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/podkop/Makefile b/podkop/Makefile index d5c7d66..bacb7c1 100644 --- a/podkop/Makefile +++ b/podkop/Makefile @@ -48,7 +48,6 @@ endef define Package/podkop/install $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/etc/init.d/podkop $(1)/etc/init.d/podkop - sed -i "s/VERSION_FROM_MAKEFILE/$(PKG_VERSION)/g" $(1)/etc/init.d/podkop $(INSTALL_DIR) $(1)/etc/config $(INSTALL_CONF) ./files/etc/config/podkop $(1)/etc/config/podkop @@ -58,6 +57,8 @@ define Package/podkop/install $(INSTALL_DIR) $(1)/usr/lib/podkop $(CP) ./files/usr/lib/* $(1)/usr/lib/podkop/ + + sed -i -e 's/__COMPILED_VERSION_VARIABLE__/$(PKG_VERSION)/g' $(1)/usr/lib/podkop/constants.sh endef $(eval $(call BuildPackage,podkop)) diff --git a/podkop/files/usr/bin/podkop b/podkop/files/usr/bin/podkop index 15c671c..847e1b2 100755 --- a/podkop/files/usr/bin/podkop +++ b/podkop/files/usr/bin/podkop @@ -1784,13 +1784,7 @@ show_config() { } show_version() { - local version=$(opkg list-installed podkop | awk '{print $3}') - echo "$version" -} - -show_luci_version() { - local version=$(opkg list-installed luci-app-podkop | awk '{print $3}') - echo "$version" + echo "$PODKOP_VERSION" } show_sing_box_version() { @@ -1967,11 +1961,14 @@ find_working_resolver() { } global_check() { + local PODKOP_LUCI_VERSION="Unknown" + [ -n "$1" ] && PODKOP_LUCI_VERSION="$1" + print_global "📡 Global check run!" print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━" print_global "🛠️ System info" - print_global "🕳️ Podkop: $(opkg list-installed podkop | awk '{print $3}')" - print_global "🕳️ LuCI App: $(opkg list-installed luci-app-podkop | awk '{print $3}')" + print_global "🕳️ Podkop: ${PODKOP_VERSION}" + print_global "🕳️ LuCI App: ${PODKOP_LUCI_VERSION}" print_global "📦 Sing-box: $(sing-box version | head -n 1 | awk '{print $3}')" print_global "🛜 OpenWrt: $(grep OPENWRT_RELEASE /etc/os-release | cut -d'"' -f2)" print_global "🛜 Device: $(cat /tmp/sysinfo/model)" @@ -2133,7 +2130,6 @@ Available commands: show_config Display current podkop configuration show_version Show podkop version show_sing_box_config Show sing-box configuration - show_luci_version Show LuCI app version show_sing_box_version Show sing-box version show_system_info Show system information get_status Get podkop service status @@ -2192,9 +2188,6 @@ show_version) show_sing_box_config) show_sing_box_config ;; -show_luci_version) - show_luci_version - ;; show_sing_box_version) show_sing_box_version ;; @@ -2211,10 +2204,10 @@ check_dns_available) check_dns_available ;; global_check) - global_check + global_check "${2:-}" ;; *) show_help exit 1 ;; -esac +esac \ No newline at end of file diff --git a/podkop/files/usr/lib/constants.sh b/podkop/files/usr/lib/constants.sh index 4745434..42e4156 100644 --- a/podkop/files/usr/lib/constants.sh +++ b/podkop/files/usr/lib/constants.sh @@ -1,5 +1,6 @@ # shellcheck disable=SC2034 +PODKOP_VERSION="__COMPILED_VERSION_VARIABLE__" ## Common PODKOP_CONFIG="/etc/config/podkop" RESOLV_CONF="/etc/resolv.conf" From 28aeb29c516c870ac7efb5ebb124b014a5177103 Mon Sep 17 00:00:00 2001 From: SaltyMonkey <1570693+SaltyMonkey@users.noreply.github.com> Date: Wed, 8 Oct 2025 22:09:48 +0300 Subject: [PATCH 3/8] refactor: Update luci-app-podkop package * Removed direct package manager calls * Removed commands related to optional luci package * Update external global_check call with version pass * Removed useless external calls in version check cases * Improved build process support: version will be automatically set at installation time from package metadata and will be readable from JS as constant --- fe-app-podkop/src/constants.ts | 1 + luci-app-podkop/Makefile | 10 +++++++++- .../resources/view/podkop/diagnosticTab.js | 20 ++++++------------- .../luci-static/resources/view/podkop/main.js | 4 +++- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/fe-app-podkop/src/constants.ts b/fe-app-podkop/src/constants.ts index bdfe8f8..153f510 100644 --- a/fe-app-podkop/src/constants.ts +++ b/fe-app-podkop/src/constants.ts @@ -4,6 +4,7 @@ export const STATUS_COLORS = { WARNING: '#ff9800', }; +export const PODKOP_LUCI_APP_VERSION = '__COMPILED_VERSION_VARIABLE__'; export const FAKEIP_CHECK_DOMAIN = 'fakeip.podkop.fyi'; export const IP_CHECK_DOMAIN = 'ip.podkop.fyi'; diff --git a/luci-app-podkop/Makefile b/luci-app-podkop/Makefile index 03bf9af..94c0fdb 100644 --- a/luci-app-podkop/Makefile +++ b/luci-app-podkop/Makefile @@ -19,4 +19,12 @@ LUCI_LANGUAGES:=en ru include $(TOPDIR)/feeds/luci/luci.mk -# call BuildPackage - OpenWrt buildroot signature \ No newline at end of file +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)$(HTDOCS) + $(CP) $(PKG_BUILD_DIR)/htdocs/* $(1)$(HTDOCS)/ + $(INSTALL_DIR) $(1)/ + $(CP) $(PKG_BUILD_DIR)/root/* $(1)/ + sed -i -e 's/__COMPILED_VERSION_VARIABLE__/$(PKG_VERSION)/g' $(1)$(HTDOCS)/luci-static/resources/view/podkop/main.js || true +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) \ No newline at end of file diff --git a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/diagnosticTab.js b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/diagnosticTab.js index 5b5b2cf..480ff2a 100644 --- a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/diagnosticTab.js +++ b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/diagnosticTab.js @@ -376,7 +376,7 @@ function showConfigModal(command, title) { let formattedOutput = ''; if (command === 'global_check') { - safeExec('/usr/bin/podkop', [command], 'P0_PRIORITY', (res) => { + safeExec('/usr/bin/podkop', [command, `${main.PODKOP_LUCI_APP_VERSION}`], 'P0_PRIORITY', (res) => { formattedOutput = formatDiagnosticOutput(res.stdout || _('No output')); try { @@ -918,19 +918,11 @@ async function updateDiagnostics() { ); }); - safeExec( - '/usr/bin/podkop', - ['show_luci_version'], - 'P2_PRIORITY', - (result) => { - updateTextElement( - 'luci-version', - document.createTextNode( - result.stdout ? result.stdout.trim() : _('Unknown'), - ), - ); - }, - ); + updateTextElement( + 'luci-version', + document.createTextNode( + `${main.PODKOP_LUCI_APP_VERSION}` + ), safeExec( '/usr/bin/podkop', diff --git a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/main.js b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/main.js index 3597c07..d0a9456 100644 --- a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/main.js +++ b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/main.js @@ -1,4 +1,4 @@ -// This file is autogenerated, please don't change manually +// This file is autogenerated, please don't change manually "use strict"; "require baseclass"; "require fs"; @@ -592,6 +592,7 @@ var STATUS_COLORS = { ERROR: "#f44336", WARNING: "#ff9800" }; +var PODKOP_LUCI_APP_VERSION = "__COMPILED_VERSION_VARIABLE__"; var FAKEIP_CHECK_DOMAIN = "fakeip.podkop.fyi"; var IP_CHECK_DOMAIN = "ip.podkop.fyi"; var REGIONAL_OPTIONS = [ @@ -1913,6 +1914,7 @@ return baseclass.extend({ FETCH_TIMEOUT, IP_CHECK_DOMAIN, REGIONAL_OPTIONS, + PODKOP_LUCI_APP_VERSION, STATUS_COLORS, TabService, TabServiceInstance, From 752636347e26e774b9ef0f31856d1382f033b5eb Mon Sep 17 00:00:00 2001 From: SaltyMonkey <1570693+SaltyMonkey@users.noreply.github.com> Date: Wed, 8 Oct 2025 22:20:33 +0300 Subject: [PATCH 4/8] refactor: Remove old docker files --- Dockerfile | 9 --------- Dockerfile-SDK | 3 --- 2 files changed, 12 deletions(-) delete mode 100644 Dockerfile delete mode 100644 Dockerfile-SDK diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index cb92d74..0000000 --- a/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM itdoginfo/openwrt-sdk:24.10.1 - -ARG PKG_VERSION -ENV PKG_VERSION=${PKG_VERSION} - -COPY ./podkop /builder/package/feeds/utilites/podkop -COPY ./luci-app-podkop /builder/package/feeds/luci/luci-app-podkop - -RUN make defconfig && make package/podkop/compile && make package/luci-app-podkop/compile V=s -j4 \ No newline at end of file diff --git a/Dockerfile-SDK b/Dockerfile-SDK deleted file mode 100644 index 6fc99d9..0000000 --- a/Dockerfile-SDK +++ /dev/null @@ -1,3 +0,0 @@ -FROM openwrt/sdk:x86_64-v24.10.1 - -RUN ./scripts/feeds update -a && ./scripts/feeds install luci-base && mkdir -p /builder/package/feeds/utilites/ && mkdir -p /builder/package/feeds/luci/ From c0b400dfb07871e9745a92a7bbc73115762b3de6 Mon Sep 17 00:00:00 2001 From: SaltyMonkey <1570693+SaltyMonkey@users.noreply.github.com> Date: Wed, 8 Oct 2025 22:25:06 +0300 Subject: [PATCH 5/8] refactor: New docker files for build process --- Dockerfile-apk | 9 +++++++++ Dockerfile-ipk | 9 +++++++++ sdk/Dockerfile-sdk-apk | 7 +++++++ sdk/Dockerfile-sdk-ipk | 6 ++++++ 4 files changed, 31 insertions(+) create mode 100644 Dockerfile-apk create mode 100644 Dockerfile-ipk create mode 100644 sdk/Dockerfile-sdk-apk create mode 100644 sdk/Dockerfile-sdk-ipk diff --git a/Dockerfile-apk b/Dockerfile-apk new file mode 100644 index 0000000..1f1c2ce --- /dev/null +++ b/Dockerfile-apk @@ -0,0 +1,9 @@ +FROM itdoginfo/openwrt-sdk-apk:latest + +ARG PKG_VERSION +ENV PKG_VERSION=${PKG_VERSION} + +COPY ./podkop /builder/package/feeds/utilites/podkop +COPY ./luci-app-podkop /builder/package/feeds/luci/luci-app-podkop + +RUN make defconfig && make package/podkop/compile && make package/luci-app-podkop/compile V=s -j4 \ No newline at end of file diff --git a/Dockerfile-ipk b/Dockerfile-ipk new file mode 100644 index 0000000..2f88f66 --- /dev/null +++ b/Dockerfile-ipk @@ -0,0 +1,9 @@ +FROM itdoginfo/openwrt-sdk-ipk:latest + +ARG PKG_VERSION +ENV PKG_VERSION=${PKG_VERSION} + +COPY ./podkop /builder/package/feeds/utilites/podkop +COPY ./luci-app-podkop /builder/package/feeds/luci/luci-app-podkop + +RUN make defconfig && make package/podkop/compile && make package/luci-app-podkop/compile V=s -j4 \ No newline at end of file diff --git a/sdk/Dockerfile-sdk-apk b/sdk/Dockerfile-sdk-apk new file mode 100644 index 0000000..a2340dd --- /dev/null +++ b/sdk/Dockerfile-sdk-apk @@ -0,0 +1,7 @@ +FROM openwrt/sdk:x86-64-SNAPSHOT +WORKDIR /builder +RUN ./setup.sh \ + && ./scripts/feeds update -a \ + && ./scripts/feeds install luci-base \ + && mkdir -p /builder/package/feeds/utilites/ \ + && mkdir -p /builder/package/feeds/luci/ \ No newline at end of file diff --git a/sdk/Dockerfile-sdk-ipk b/sdk/Dockerfile-sdk-ipk new file mode 100644 index 0000000..4c19693 --- /dev/null +++ b/sdk/Dockerfile-sdk-ipk @@ -0,0 +1,6 @@ +FROM openwrt/sdk:x86_64-v24.10.3 +WORKDIR /builder +RUN ./scripts/feeds update -a \ + && ./scripts/feeds install luci-base \ + && mkdir -p /builder/package/feeds/utilites/ \ + && mkdir -p /builder/package/feeds/luci/ \ No newline at end of file From 267fd2b79333cfe89595312ff3dcfecd3c69cda1 Mon Sep 17 00:00:00 2001 From: SaltyMonkey <1570693+SaltyMonkey@users.noreply.github.com> Date: Wed, 8 Oct 2025 22:26:16 +0300 Subject: [PATCH 6/8] refactor: Added .gitattributes for better dev life at win and linux --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf From b5cfc017fedfbf66fe1e1aca8b68b97000440880 Mon Sep 17 00:00:00 2001 From: SaltyMonkey <1570693+SaltyMonkey@users.noreply.github.com> Date: Wed, 8 Oct 2025 23:15:52 +0300 Subject: [PATCH 7/8] chore: Automatic build process rewrite * Added apk packages support * Move to matrix builds * Minor versions update for some actions just in case * Automatic release with ipk/apk packages --- .github/workflows/build.yml | 118 ++++++++++++++++++++++++++++-------- 1 file changed, 92 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aea8ee5..14aa8d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,51 +4,117 @@ on: tags: - v* +permissions: + contents: write + jobs: - build: - name: Build podkop and luci-app-podkop + preparation: + name: Setup build version runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} steps: - - uses: actions/checkout@v4.2.1 + - uses: actions/checkout@v5.0.0 + with: + fetch-depth: 0 + - id: version + run: | + VERSION=$(git describe --tags --exact-match 2>/dev/null || echo "dev_$(date +%d%m%Y)") + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + + build: + name: Builder for ${{ matrix.package_type }} podkop and luci-app-podkop + runs-on: ubuntu-latest + needs: preparation + strategy: + matrix: + include: + - { package_type: ipk } + - { package_type: apk } + steps: + - uses: actions/checkout@v5.0.0 with: fetch-depth: 0 - - name: Extract version - id: version - run: | - VERSION=$(git describe --tags --exact-match 2>/dev/null || echo "dev_$(date +%d%m%Y)") - echo "version=$VERSION" >> $GITHUB_OUTPUT - - - name: Build and push - uses: docker/build-push-action@v6.9.0 + - name: Build ${{ matrix.package_type }} + uses: docker/build-push-action@v6.18.0 with: + file: ./Dockerfile-${{ matrix.package_type }} context: . - tags: podkop:ci + tags: podkop:ci-${{ matrix.package_type }} build-args: | - PKG_VERSION=${{ steps.version.outputs.version }} + PKG_VERSION=${{ needs.preparation.outputs.version }} - - name: Create Docker container - run: docker create --name podkop podkop:ci + - name: Create ${{ matrix.package_type }} Docker container + run: docker create --name ${{ matrix.package_type }} podkop:ci-${{ matrix.package_type }} - - name: Copy file from Docker container + - name: Copy files from ${{ matrix.package_type }} Docker container run: | - docker cp podkop:/builder/bin/packages/x86_64/utilites/. ./bin/ - docker cp podkop:/builder/bin/packages/x86_64/luci/. ./bin/ + mkdir -p ./bin/${{ matrix.package_type }} + rm -f ./bin/${{ matrix.package_type }}/*.${{ matrix.package_type }} || true + docker cp ${{ matrix.package_type }}:/builder/bin/packages/x86_64/utilites/. ./bin/${{ matrix.package_type }}/ + docker cp ${{ matrix.package_type }}:/builder/bin/packages/x86_64/luci/. ./bin/${{ matrix.package_type }}/ - - name: Filter IPK files + # Проблема в том, что sdk которая генерирует apk файлы не использует `_` символ --> только `-` в именах итоговых файлов + - name: Fix naming difference between build for packages (replace _ with -) + if: matrix.package_type == 'ipk' + shell: bash + run: | + for f in ./bin/${{ matrix.package_type }}/*.${{ matrix.package_type }}; do + [ -e "$f" ] || continue + base=$(basename "$f") + newname=$(echo "$base" | sed 's/_/-/g') + mv "$f" "./bin/${{ matrix.package_type }}/$newname" + done + + - name: Filter files + shell: bash run: | # Извлекаем версию из тега, убирая префикс 'v' VERSION=${GITHUB_REF#refs/tags/v} - mkdir -p ./filtered-bin - cp ./bin/luci-i18n-podkop-ru_*.ipk "./filtered-bin/luci-i18n-podkop-ru_${VERSION}.ipk" - cp ./bin/podkop_*.ipk ./filtered-bin/ - cp ./bin/luci-app-podkop_*.ipk ./filtered-bin/ + mkdir -p ./filtered-bin/${{ matrix.package_type }} + cp ./bin/${{ matrix.package_type }}/luci-i18n-podkop-ru-*.${{ matrix.package_type }} "./filtered-bin/luci-i18n-podkop-ru-${VERSION}.${{ matrix.package_type }}" + cp ./bin/${{ matrix.package_type }}/podkop-*.${{ matrix.package_type }} ./filtered-bin/ + cp ./bin/${{ matrix.package_type }}/luci-app-podkop-*.${{ matrix.package_type }} ./filtered-bin/ - name: Remove Docker container - run: docker rm podkop + run: docker rm ${{ matrix.package_type }} + + - name: Upload build artifacts + uses: actions/upload-artifact@v4.6.2 + with: + name: release-files-${{ github.ref_name }}-${{ matrix.package_type }} + path: ./filtered-bin/${{ matrix.package_type }}/*.${{ matrix.package_type }} + retention-days: 1 + if-no-files-found: error + + release: + name: Create Release + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v5.0.0 + - name: Create release dir + run: mkdir -p ./filtered-bin/release + + - name: Download ipk artifacts + uses: actions/download-artifact@v4 + with: + name: release-files-${{ github.ref_name }}-ipk + path: ./filtered-bin/release + + - name: Download apk artifacts + uses: actions/download-artifact@v4 + with: + name: release-files-${{ github.ref_name }}-apk + path: ./filtered-bin/release - name: Release - uses: softprops/action-gh-release@v2.0.8 + uses: softprops/action-gh-release@v2.4.0 with: - files: ./filtered-bin/*.ipk \ No newline at end of file + files: ./filtered-bin/release/*.* + draft: false + prerelease: false + name: ${{ github.ref_name }} + tag_name: ${{ github.ref_name }} \ No newline at end of file From 826245a89a23a21c9b070c5efa96def237e063e4 Mon Sep 17 00:00:00 2001 From: SaltyMonkey <1570693+SaltyMonkey@users.noreply.github.com> Date: Thu, 9 Oct 2025 00:56:15 +0300 Subject: [PATCH 8/8] fix: Minor changes and bugfixes, ci fix --- .github/workflows/build.yml | 1 - Dockerfile-apk | 2 +- Dockerfile-ipk | 2 +- install.sh | 8 ++++---- .../htdocs/luci-static/resources/view/podkop/main.js | 4 ++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14aa8d8..0a6d868 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,6 @@ jobs: - name: Copy files from ${{ matrix.package_type }} Docker container run: | mkdir -p ./bin/${{ matrix.package_type }} - rm -f ./bin/${{ matrix.package_type }}/*.${{ matrix.package_type }} || true docker cp ${{ matrix.package_type }}:/builder/bin/packages/x86_64/utilites/. ./bin/${{ matrix.package_type }}/ docker cp ${{ matrix.package_type }}:/builder/bin/packages/x86_64/luci/. ./bin/${{ matrix.package_type }}/ diff --git a/Dockerfile-apk b/Dockerfile-apk index 1f1c2ce..4c9a885 100644 --- a/Dockerfile-apk +++ b/Dockerfile-apk @@ -1,4 +1,4 @@ -FROM itdoginfo/openwrt-sdk-apk:latest +FROM itdoginfo/openwrt-sdk-apk:09102025 ARG PKG_VERSION ENV PKG_VERSION=${PKG_VERSION} diff --git a/Dockerfile-ipk b/Dockerfile-ipk index 2f88f66..aaa109e 100644 --- a/Dockerfile-ipk +++ b/Dockerfile-ipk @@ -1,4 +1,4 @@ -FROM itdoginfo/openwrt-sdk-ipk:latest +FROM itdoginfo/openwrt-sdk-ipk:24.10.3 ARG PKG_VERSION ENV PKG_VERSION=${PKG_VERSION} diff --git a/install.sh b/install.sh index 66ce08f..c84051b 100755 --- a/install.sh +++ b/install.sh @@ -85,9 +85,9 @@ main() { local grep_url_pattern if [ "$PKG_IS_APK" -eq 1 ]; then - grep_url_pattern='https://[^"[:space:]]*\.ipk' - else grep_url_pattern='https://[^"[:space:]]*\.apk' + else + grep_url_pattern='https://[^"[:space:]]*\.ipk' fi download_success=0 @@ -133,8 +133,8 @@ main() { if [ -n "$ru" ]; then if pkg_is_installed luci-i18n-podkop-ru; then msg "Upgraded ru translation..." - pkg_remove remove luci-i18n-podkop* - pkg_install install "$DOWNLOAD_DIR/$ru" + pkg_remove luci-i18n-podkop* + pkg_install "$DOWNLOAD_DIR/$ru" else msg "Русский язык интерфейса ставим? y/n (Need a Russian translation?)" while true; do diff --git a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/main.js b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/main.js index d0a9456..31db43d 100644 --- a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/main.js +++ b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/main.js @@ -1,4 +1,4 @@ -// This file is autogenerated, please don't change manually +// This file is autogenerated, please don't change manually "use strict"; "require baseclass"; "require fs"; @@ -1913,8 +1913,8 @@ return baseclass.extend({ FAKEIP_CHECK_DOMAIN, FETCH_TIMEOUT, IP_CHECK_DOMAIN, - REGIONAL_OPTIONS, PODKOP_LUCI_APP_VERSION, + REGIONAL_OPTIONS, STATUS_COLORS, TabService, TabServiceInstance,