Files
wakey/scripts
T
9305702b36 · 2026-04-06 16:55:19 +07:00
History
..
2026-04-04 08:22:42 +07:00
2026-01-31 19:39:12 +07:00
2026-04-04 08:22:42 +07:00
2026-04-06 16:28:23 +07:00
2025-12-06 00:57:14 +07:00
2025-12-16 17:34:56 +07:00
2026-01-31 19:26:30 +07:00
2026-04-06 16:55:19 +07:00

Scripts

This folder has small helpers for build, CI, and router install. Keep it simple; use only what you need.

  1. Start your Gitea runner on this Windows PC (if not already running):

    ./scripts/act_runner.ps1
    

    If first-time, it prints the exact register command. Run it once, check labels include windows:host,self-hosted, then rerun the script.

  2. Publish, tag, and push (recommended):

    ./scripts/publish.ps1 -Tag
    

    This will bump the version (if you specify one), build, ensure the runner is started, tag, and push. To also publish to the registry, add -Publish.

  3. Install on the router

    Use the updater on the router to fetch the latest automatically:

    WAKEY_HOST=git.ldlda.com WAKEY_OWNER=lda WAKEY_REPO=wakey sh /etc/ldlda_help/update_wakey.sh
    

    Alternatively, use the release asset URL from your Gitea Release page:

    wget -O- https://<gitea>/<owner>/<repo>/releases/download/v0.1.0/wakey-rootfs-v0.1.0-armv7-unknown-linux-musleabihf.tgz | tar -xz -C /
    chmod +x /etc/init.d/wakey && /etc/init.d/wakey enable && /etc/init.d/wakey restart
    

Scripts overview

  • act_runner.ps1 — Start/seed the local Gitea runner. Use -Attach to see logs, -ForceConfigure to register non-interactively.
  • dev_push.ps1 — Fast dev loop: build + upload to router. Usage:
    • ./scripts/dev_push.ps1 -Pass <password> [-HostName <ip>] [-RemotePath </root/.bin/wakey>] [-Restart] [-Quiet]
    • Uploads to <RemotePath>.tmp then atomically moves into place; -Restart restarts the service; -Quiet silences MOTD.
  • package_rootfs.ps1 — Produces dist/wakey-rootfs-<version>-<target>.tgz with /root/.bin/wakey and /etc/init.d/*.
  • publish.ps1 — Optional version bump + build + tag (and cargo publish only if you pass -Publish).
  • test_remote.ps1 — Build ARM Linux test binaries locally, upload them to the router, and run them there.

Remote test runner

test_remote.ps1 is the main way to run Linux/router-specific tests that do not make sense on Windows.

Basic examples:

./scripts/test_remote.ps1 -Package wakey
./scripts/test_remote.ps1 -Package wakey -BinaryFilter integration_live_services -Ignored -NoCapture
./scripts/test_remote.ps1 -Package wakey -BinaryFilter integration_live_services -Filter status_real_router_default_query_succeeds -Ignored -NoCapture
./scripts/test_remote.ps1 -AllPackages

Important semantics:

  • -BinaryFilter
    • selects which compiled Rust test executable(s) to run
  • -Filter
    • filters test functions inside a selected Rust test binary
  • -Ignored
    • runs #[ignore] tests
  • -IncludeIgnored
    • includes ignored tests in addition to normal ones
  • -List
    • lists tests inside the remote binary instead of executing them

Useful flags:

  • -BuildProfile debug|release
  • -Exact
  • -NoCapture
  • -ShowOutput
  • -Threads <n>
  • -RemoteHost root@<router-ip>
  • -RemoteTestPath /tmp/tmp/wakey-test

Implementation notes:

  • test executables are discovered via Cargo JSON messages, not regexing human output
  • binaries are batch-uploaded per package run
  • each package run gets a unique remote temp directory for safer concurrent use
  • packages with no test executables are skipped instead of treated as failures

CI (Gitea)

  • Defined in .gitea/workflows/release.yml.
  • Runs on your self-hosted, windows runner.
  • Steps: cross build → package rootfs → upload artifact (v3) → publish a release and attach tgz.
  • Requires secrets.GITEA_TOKEN in the repo to publish the release.

Local build/install (manual path)

# Build
cargo build --release --target armv7-unknown-linux-musleabihf

# Package rootfs
./scripts/package_rootfs.ps1 -Version v0.1.0 -Target armv7-unknown-linux-musleabihf

# Copy to router (PowerShell)
scp -O .\dist\wakey-rootfs-v0.1.0-armv7-unknown-linux-musleabihf.tgz root@<router-ip>:/tmp/wakey.tgz
# On the router
tar -xz -f /tmp/wakey.tgz -C /
chmod +x /etc/init.d/wakey && /etc/init.d/wakey enable && /etc/init.d/wakey restart

Or you can use the script:

./scripts/dev_push.ps1 -Pass <password>

Thats it. Keep the flow: start runner → tag push → install.