delete unneeded fake shit
This commit is contained in:
+25
-21
@@ -6,34 +6,34 @@ This folder has small helpers for build, CI, and router install. Keep it simple;
|
|||||||
|
|
||||||
1. Start your Gitea runner on this Windows PC (if not already running):
|
1. Start your Gitea runner on this Windows PC (if not already running):
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
./scripts/act_runner.ps1
|
./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.
|
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):
|
2. Publish, tag, and push (recommended):
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
./scripts/publish.ps1 -Tag
|
./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`.
|
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
|
3. Install on the router
|
||||||
|
|
||||||
Use the release asset URL from your Gitea Release page:
|
Use the updater on the router to fetch the latest automatically:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
wget -O- https://<gitea>/<owner>/<repo>/releases/download/v0.1.0/wakey-rootfs-v0.1.0-armv7-unknown-linux-musleabihf.tgz | tar -xz -C /
|
WAKEY_HOST=git.ldlda.com WAKEY_OWNER=lda WAKEY_REPO=wakey sh /etc/ldlda_help/update_wakey.sh
|
||||||
chmod +x /etc/init.d/wakey && /etc/init.d/wakey enable && /etc/init.d/wakey restart
|
```
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively, use the updater on the router to fetch the latest automatically:
|
Alternatively, use the release asset URL from your Gitea Release page:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
WAKEY_HOST=git.ldlda.com WAKEY_OWNER=lda WAKEY_REPO=wakey sh /etc/ldlda_help/update_wakey.sh
|
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
|
## Scripts overview
|
||||||
|
|
||||||
@@ -41,9 +41,7 @@ This folder has small helpers for build, CI, and router install. Keep it simple;
|
|||||||
- `dev_push.ps1` — Fast dev loop: build + upload to router. Usage:
|
- `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]`
|
- `./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.
|
- Uploads to `<RemotePath>.tmp` then atomically moves into place; `-Restart` restarts the service; `-Quiet` silences MOTD.
|
||||||
- `cross_build.ps1` — Simple wrapper for `cargo build` per target (default: armv7-unknown-linux-musleabihf).
|
|
||||||
- `package_rootfs.ps1` — Produces `dist/wakey-rootfs-<version>-<target>.tgz` with `/root/.bin/wakey` and `/etc/init.d/*`.
|
- `package_rootfs.ps1` — Produces `dist/wakey-rootfs-<version>-<target>.tgz` with `/root/.bin/wakey` and `/etc/init.d/*`.
|
||||||
- `package.ps1` — Dev bundle with binaries + init scripts (not a rootfs layout).
|
|
||||||
- `publish.ps1` — Optional version bump + build + tag (and `cargo publish` only if you pass `-Publish`).
|
- `publish.ps1` — Optional version bump + build + tag (and `cargo publish` only if you pass `-Publish`).
|
||||||
|
|
||||||
## CI (Gitea)
|
## CI (Gitea)
|
||||||
@@ -56,8 +54,8 @@ This folder has small helpers for build, CI, and router install. Keep it simple;
|
|||||||
## Local build/install (manual path)
|
## Local build/install (manual path)
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
# Build (requires cross installed)
|
# Build
|
||||||
./scripts/cross_build.ps1 -Release -Targets armv7-unknown-linux-musleabihf
|
cargo build --release --target armv7-unknown-linux-musleabihf
|
||||||
|
|
||||||
# Package rootfs
|
# Package rootfs
|
||||||
./scripts/package_rootfs.ps1 -Version v0.1.0 -Target armv7-unknown-linux-musleabihf
|
./scripts/package_rootfs.ps1 -Version v0.1.0 -Target armv7-unknown-linux-musleabihf
|
||||||
@@ -72,4 +70,10 @@ tar -xz -f /tmp/wakey.tgz -C /
|
|||||||
chmod +x /etc/init.d/wakey && /etc/init.d/wakey enable && /etc/init.d/wakey restart
|
chmod +x /etc/init.d/wakey && /etc/init.d/wakey enable && /etc/init.d/wakey restart
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Or you can use the script:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
./scripts/dev_push.ps1 -Pass <password>
|
||||||
|
```
|
||||||
|
|
||||||
That’s it. Keep the flow: start runner → tag push → install.
|
That’s it. Keep the flow: start runner → tag push → install.
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
# Build release binaries using cross for Linux targets.
|
|
||||||
# Requires: cross installed (cargo install cross)
|
|
||||||
param(
|
|
||||||
[string[]]$Targets = @("armv7-unknown-linux-musleabihf"),
|
|
||||||
[switch]$Release
|
|
||||||
)
|
|
||||||
|
|
||||||
$ErrorActionPreference = 'Stop'
|
|
||||||
|
|
||||||
$mode = if ($Release) { "--release" } else { "" }
|
|
||||||
|
|
||||||
foreach ($t in $Targets) {
|
|
||||||
Write-Host "Building for $t..."
|
|
||||||
cross build $mode --target $t
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "Done."
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
# Package a release tarball with binaries and init scripts.
|
|
||||||
# Usage: ./scripts/package.ps1 -Version 0.1.0 -OutDir dist
|
|
||||||
param(
|
|
||||||
[Parameter(Mandatory = $true)][string]$Version,
|
|
||||||
[string]$OutDir = "dist",
|
|
||||||
[string[]]$Targets = @("armv7-unknown-linux-musleabihf")
|
|
||||||
)
|
|
||||||
|
|
||||||
$ErrorActionPreference = 'Stop'
|
|
||||||
|
|
||||||
$root = Split-Path -Parent $MyInvocation.MyCommand.Path | Split-Path -Parent
|
|
||||||
$dist = Join-Path $root $OutDir
|
|
||||||
New-Item -ItemType Directory -Force -Path $dist | Out-Null
|
|
||||||
|
|
||||||
$pkgName = "wakey-$Version"
|
|
||||||
$pkgDir = Join-Path $dist $pkgName
|
|
||||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue $pkgDir
|
|
||||||
New-Item -ItemType Directory -Force -Path $pkgDir | Out-Null
|
|
||||||
|
|
||||||
# Copy LICENSE/README if present
|
|
||||||
if (Test-Path "$root/README.md") { Copy-Item "$root/README.md" $pkgDir }
|
|
||||||
if (Test-Path "$root/LICENSE") { Copy-Item "$root/LICENSE" $pkgDir }
|
|
||||||
|
|
||||||
# Binaries per target
|
|
||||||
foreach ($t in $Targets) {
|
|
||||||
$binName = if ($t -like "*-windows-*") { "wakey.exe" } else { "wakey" }
|
|
||||||
$src = Join-Path $root "target/$t/release/$binName"
|
|
||||||
if (-not (Test-Path $src)) { throw "Missing binary: $src" }
|
|
||||||
$tDir = Join-Path $pkgDir "bin/$t"
|
|
||||||
New-Item -ItemType Directory -Force -Path $tDir | Out-Null
|
|
||||||
Copy-Item $src $tDir
|
|
||||||
}
|
|
||||||
|
|
||||||
# Init scripts
|
|
||||||
$initDir = Join-Path $pkgDir "init"
|
|
||||||
New-Item -ItemType Directory -Force -Path $initDir | Out-Null
|
|
||||||
Copy-Item "$root/scripts/init" $initDir -Recurse
|
|
||||||
|
|
||||||
# Systemd service (for Linux hosts)
|
|
||||||
Copy-Item "$root/scripts/systemd" $initDir -Recurse -ErrorAction SilentlyContinue
|
|
||||||
|
|
||||||
# Tarball
|
|
||||||
Push-Location $dist
|
|
||||||
if (Get-Command tar -ErrorAction SilentlyContinue) {
|
|
||||||
tar -czf "$pkgName.tgz" "$pkgName"
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
# Fallback to zip on Windows
|
|
||||||
Compress-Archive -Path "$pkgName" -DestinationPath "$pkgName.zip" -Force
|
|
||||||
}
|
|
||||||
Pop-Location
|
|
||||||
|
|
||||||
Write-Host "Packaged: $dist/$pkgName.(tgz|zip)"
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# One-shot: build, package, and print artifact location (no cross required).
|
|
||||||
# Usage: ./scripts/release.ps1 -Version 0.1.0 -Targets armv7-unknown-linux-musleabihf
|
|
||||||
param(
|
|
||||||
[Parameter(Mandatory = $true)][string]$Version,
|
|
||||||
[string[]]$Targets = @("armv7-unknown-linux-musleabihf")
|
|
||||||
)
|
|
||||||
|
|
||||||
$ErrorActionPreference = 'Stop'
|
|
||||||
|
|
||||||
foreach ($t in $Targets) {
|
|
||||||
rustup target add $t
|
|
||||||
cargo build --release --target $t
|
|
||||||
}
|
|
||||||
./scripts/package.ps1 -Version $Version -Targets $Targets
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Wakey WOL+ARP service
|
|
||||||
After=network-online.target
|
|
||||||
Wants=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
ExecStart=/usr/local/bin/wakey
|
|
||||||
Restart=on-failure
|
|
||||||
RestartSec=2
|
|
||||||
User=wakey
|
|
||||||
Group=wakey
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
Reference in New Issue
Block a user