Publish current app and server
This commit is contained in:
+13
-2
@@ -8,6 +8,7 @@
|
||||
index.html landing page people are sent to
|
||||
latest.json update manifest the app polls
|
||||
memby-<version>.apk the build itself
|
||||
LICENSE / NOTICE licence terms and acknowledgements
|
||||
|
||||
Copy that folder to whatever the NAS serves, keeping the file names. Old APKs can
|
||||
stay alongside — only latest.json decides what the app offers.
|
||||
@@ -23,13 +24,18 @@
|
||||
Public URL of the folder on the NAS, e.g. https://nas.example.com/memby.
|
||||
Used to build absolute links on the landing page.
|
||||
|
||||
.PARAMETER SourceUrl
|
||||
Recipient-accessible URL for the exact corresponding source. This link is embedded
|
||||
in the APK and release page. It must remain available to everyone receiving a build.
|
||||
|
||||
.EXAMPLE
|
||||
.\release.ps1 -Version 0.1.54 -Notes "Faster home screen" -BaseUrl https://nas.example.com/memby
|
||||
#>
|
||||
param(
|
||||
[string] $Version,
|
||||
[string] $Notes = '',
|
||||
[Parameter(Mandatory = $true)][string] $BaseUrl
|
||||
[Parameter(Mandatory = $true)][string] $BaseUrl,
|
||||
[string] $SourceUrl = 'https://g.sublogue.com/admin/memby'
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
@@ -65,7 +71,7 @@ if ($Version) {
|
||||
|
||||
# --- build -----------------------------------------------------------------
|
||||
|
||||
& (Join-Path $root 'gradlew.bat') --console=plain clean test assembleRelease
|
||||
& (Join-Path $root 'gradlew.bat') --console=plain clean test assembleRelease "-Pmemby.sourceUrl=$SourceUrl"
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Build failed' }
|
||||
|
||||
$apk = Join-Path $root 'app\build\outputs\apk\release\app-release.apk'
|
||||
@@ -88,6 +94,10 @@ if (Test-Path $outDir) { Remove-Item $outDir -Recurse -Force }
|
||||
New-Item -ItemType Directory -Force $outDir | Out-Null
|
||||
|
||||
Copy-Item $apk (Join-Path $outDir $apkName)
|
||||
Copy-Item (Join-Path $root 'LICENSE') (Join-Path $outDir 'LICENSE')
|
||||
$notice = (Get-Content -Raw (Join-Path $root 'NOTICE')).
|
||||
Replace('https://g.sublogue.com/admin/memby', $SourceUrl)
|
||||
Set-Content -LiteralPath (Join-Path $outDir 'NOTICE') -Value $notice -Encoding utf8
|
||||
|
||||
# apkUrl stays relative so the folder keeps working if the NAS is reached by another
|
||||
# name; the app resolves it against the manifest's own URL.
|
||||
@@ -104,6 +114,7 @@ $page = $page.Replace('{{VERSION}}', $Version).
|
||||
Replace('{{APK_NAME}}', $apkName).
|
||||
Replace('{{APK_URL}}', "$base/$apkName").
|
||||
Replace('{{BASE_URL}}', $base).
|
||||
Replace('{{SOURCE_URL}}', $SourceUrl).
|
||||
Replace('{{SIZE}}', $size).
|
||||
Replace('{{NOTES}}', $(if ($Notes) { $Notes } else { 'Various improvements.' })).
|
||||
Replace('{{DATE}}', (Get-Date -Format 'd MMMM yyyy'))
|
||||
|
||||
Reference in New Issue
Block a user