idk what is going on
release / build (push) Failing after 3m12s

This commit is contained in:
lda
2025-08-25 03:57:04 +07:00 Unverified
parent 0c10cc734a
commit a5935bb1a9
15 changed files with 548 additions and 1 deletions
+57
View File
@@ -0,0 +1,57 @@
# Build a rootfs tarball suitable for `wget -O- ... | tar -xz -C /` on OpenWrt.
# It lays out files as absolute-root paths inside the archive:
# root/.bin/wakey
# etc/init.d/wakey
# Usage: ./scripts/package_rootfs.ps1 -Version 0.1.0 -Target armv7-unknown-linux-musleabihf -OutDir dist
param(
[Parameter(Mandatory = $true)][string]$Version,
[Parameter(Mandatory = $true)][string]$Target,
[string]$OutDir = "dist"
)
$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
$binName = if ($Target -like "*-windows-*") { "wakey.exe" } else { "wakey" }
$binSrc = Join-Path $root "target/$Target/release/$binName"
if (-not (Test-Path $binSrc)) { throw "Missing binary: $binSrc (build it first)" }
$staging = Join-Path $dist ("rootfs-" + [System.Guid]::NewGuid().ToString("N"))
New-Item -ItemType Directory -Force -Path $staging | Out-Null
# Lay out rootfs tree
$rootDir = Join-Path $staging "root/.bin"
$etcDir = Join-Path $staging "etc/init.d"
New-Item -ItemType Directory -Force -Path $rootDir | Out-Null
New-Item -ItemType Directory -Force -Path $etcDir | Out-Null
Copy-Item $binSrc (Join-Path $rootDir "wakey") -Force
# Copy all OpenWrt init scripts present in repo
Get-ChildItem (Join-Path $root 'scripts/init/openwrt') -File | ForEach-Object {
$dest = Join-Path $etcDir $_.Name
Copy-Item $_.FullName $dest -Force
}
# Create tarball
$pkgName = "wakey-rootfs-$Version-$Target.tgz"
Push-Location $staging
if (Get-Command tar -ErrorAction SilentlyContinue) {
tar -czf (Join-Path $dist $pkgName) *
}
else {
# Fallback to zip (router can unzip too if available); prefer tar if possible
Compress-Archive -Path * -DestinationPath (Join-Path $dist ($pkgName -replace '\.tgz$', '.zip')) -Force
}
Pop-Location
# Cleanup staging
Remove-Item -Recurse -Force $staging
Write-Host "Rootfs package: " (Join-Path $dist $pkgName)
Write-Host "On router: wget -O- <URL/$pkgName> | tar -xz -C /"
Write-Host "Then: chmod +x /etc/init.d/wakey && /etc/init.d/wakey enable && /etc/init.d/wakey start"
Write-Host "For any additional init scripts (e.g., update_tailscale), also chmod +x and enable/start as needed."