Build packages / CI (push) Blocked by required conditions
Build packages / Version (push) Waiting to run
CI / Web (format, types, tests, bundles) (push) Blocked by required conditions
CI / ShellCheck (push) Blocked by required conditions
CI / ucode static checks (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 24.10) (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 25.12) (push) Blocked by required conditions
- Russian translation. The admin pages, the LuCI menu and the router's messages (errors, Health checks, update steps, the service log) come in Russian with the new luci-i18n-dawnline-ru package, released beside the app. LuCI shows it when its language is Russian, or "auto" with a Russian browser - The translation installs with install.sh when LuCI is in Russian (or with --lang ru), follows every Dawnline update and rollback, and can be added or removed in Components → Dawnline → Translation - The portal speaks the visitor's language: it opens in the system's language and switches between English and Russian in place, from the language pill beside its QR code. It carries its own translation and needs no package - Set-up steps quote the apps' own menus word for word, in Russian too: AmneziaVPN is "+ → Insert → Continue" (it has no "Add server"), and the Mac and Windows menus of WireGuard and AmneziaWG have their real names - Questions in the portal (Reconnect, Remove) read from the left edge and close with Cancel, without × - Numbers, sizes and dates follow the page's language. A server that can't start says why in one sentence; event details and service log lines read as whole sentences - README in Russian (README_ru.md). rules/i18n.md: how strings are written and translated; CI checks the catalogs (npm run i18n:check)
71 lines
2.5 KiB
Bash
Executable File
71 lines
2.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build the release packages with the OpenWrt SDK in Docker (as CI does):
|
|
# scripts/build-packages.sh [ipk|apk|all]
|
|
# Output: dist/luci-app-dawnline-<version>.{ipk,apk}, a translation package per
|
|
# po/<lang> (dist/luci-i18n-dawnline-<lang>-<version>.{ipk,apk}) and dist/sha256sums.txt
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
APP="$ROOT/package/luci-app-dawnline"
|
|
VERSION="$(sed -n 's/^PKG_VERSION:=//p' "$APP/Makefile")"
|
|
OUT="$ROOT/dist"
|
|
WHAT="${1:-all}"
|
|
IPK_SDK="${IPK_SDK:-itdoginfo/openwrt-sdk-ipk:24.10.6}"
|
|
APK_SDK="${APK_SDK:-itdoginfo/openwrt-sdk-apk:25.12.3}"
|
|
|
|
# One version everywhere: the Makefile, the ucode library and the web package.
|
|
grep -q "^export const VERSION = '$VERSION';" "$APP/root/usr/share/ucode/dawnline/util.uc" || { echo "util.uc VERSION != $VERSION" >&2; exit 1; }
|
|
grep -q "\"version\": \"$VERSION\"" "$ROOT/web/package.json" || { echo "web/package.json version != $VERSION" >&2; exit 1; }
|
|
|
|
mkdir -p "$OUT"
|
|
build() {
|
|
local type="$1" sdk="$2" tag="dawnline-build:$1"
|
|
docker build --platform linux/amd64 -f "$ROOT/build/Dockerfile" --build-arg "SDK_IMAGE=$sdk" -t "$tag" "$ROOT"
|
|
local id
|
|
id="$(docker create "$tag")"
|
|
rm -rf "$OUT/.$type" && mkdir -p "$OUT/.$type"
|
|
docker cp "$id:/builder/out/." "$OUT/.$type/"
|
|
docker rm "$id" >/dev/null
|
|
local f name
|
|
for f in "$OUT/.$type"/*."$type"; do
|
|
[ -f "$f" ] || continue
|
|
# ipk names use underscores (luci-app-dawnline_0.1.0-r1_all.ipk), apk names
|
|
# dashes: one stable name per package for both, its name and the version.
|
|
name="$(basename "$f")"
|
|
name="${name%%[_-][0-9]*}"
|
|
mv "$f" "$OUT/$name-$VERSION.$type"
|
|
echo "$OUT/$name-$VERSION.$type"
|
|
done
|
|
rm -rf "$OUT/.$type"
|
|
for name in luci-app-dawnline $(i18n_packages); do
|
|
[ -f "$OUT/$name-$VERSION.$type" ] || { echo "no $name .$type built" >&2; exit 1; }
|
|
done
|
|
}
|
|
|
|
# The translation packages luci.mk makes: one per po/<lang>.
|
|
i18n_packages() {
|
|
local d
|
|
for d in "$APP"/po/*/; do
|
|
d="$(basename "$d")"
|
|
[ "$d" = templates ] || printf 'luci-i18n-dawnline-%s\n' "$d"
|
|
done
|
|
}
|
|
|
|
case "$WHAT" in
|
|
ipk) build ipk "$IPK_SDK" ;;
|
|
apk) build apk "$APK_SDK" ;;
|
|
all) build ipk "$IPK_SDK"; build apk "$APK_SDK" ;;
|
|
*) echo "usage: $0 [ipk|apk|all]" >&2; exit 2 ;;
|
|
esac
|
|
|
|
(
|
|
cd "$OUT"
|
|
files=""
|
|
for name in luci-app-dawnline $(i18n_packages); do
|
|
for f in "$name-$VERSION".ipk "$name-$VERSION".apk; do [ -f "$f" ] && files="$files $f"; done
|
|
done
|
|
# shellcheck disable=SC2086
|
|
if command -v sha256sum >/dev/null; then sha256sum $files; else shasum -a 256 $files; fi > sha256sums.txt
|
|
)
|
|
cat "$OUT/sha256sums.txt"
|