mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-12 05:48:25 -04:00
Update Build-Electron.ps1
Former-commit-id: 893561a454a81e29b75f17c69bc3ccc17c513f4a [formerly 782aa0ebfedf2c6bab720f438789100929431038] [formerly 054eddb22685b1941d8119f47de2137705d20dfa] [formerly df6c901dbbc16f39daca1a7474b01d3f7f6dfa0a [formerly 305fb2b384498f98225faeff9746188189ac00c2 [formerly 1ebc0451f2bc8e02d4a62c0bb5a863485ff9227d]]] Former-commit-id: 7cac061a80d4c8495405aa101fd003f54a855cb2 [formerly de5e7029f4938798da39ed2e9dcc5ab35d833214 [formerly 3b6e62a62a784efffc6814cfcb53c1447b592500]] Former-commit-id: 7a938eff38dd3086b5d4d8a669fe773bafdb48b4 [formerly dbeb4601de821d2ec230b31f19398f26fd0bea53] Former-commit-id: 6de6eeecd7980a46700446039dfedc08a153b477
This commit is contained in:
parent
7c806a4a23
commit
b5a4d2579f
@ -1,7 +1,10 @@
|
|||||||
# This script is intended to be run by Create-DraftRelease, and must be dot-sourced (run with `. ./Build-Electron.ps1` or `. /path/to/Build-Electron.ps1`)
|
# This script is intended to be run by Create-DraftRelease, and must be dot-sourced (run with `. ./Build-Electron.ps1` or `. /path/to/Build-Electron.ps1`)
|
||||||
# because it modifies variables needed in Create-DraftRelease
|
# because it modifies variables needed in Create-DraftRelease
|
||||||
$base_dir = "$PSScriptRoot/../bld/electron/"
|
$base_dir = "$PSScriptRoot/../bld/electron/"
|
||||||
if ($electronbuild -eq "") {
|
if ($text_tag -match 'WikiMed|Wikivoyage') {
|
||||||
|
$electronbuild = "local"
|
||||||
|
}
|
||||||
|
if (($electronbuild -eq "")) {
|
||||||
""
|
""
|
||||||
$electronbuild_check = Read-Host "Do you want to build Electron packages on GitHub? [Y/N]"
|
$electronbuild_check = Read-Host "Do you want to build Electron packages on GitHub? [Y/N]"
|
||||||
$electronbuild_check = -Not ( $electronbuild_check -imatch 'n' )
|
$electronbuild_check = -Not ( $electronbuild_check -imatch 'n' )
|
||||||
@ -39,7 +42,6 @@ if ($electronbuild -eq "cloud") {
|
|||||||
} else {
|
} else {
|
||||||
"[DRYRUN]: Cloudbuild dispatched.`n"
|
"[DRYRUN]: Cloudbuild dispatched.`n"
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
}
|
||||||
# Package installer electron app for Windows
|
# Package installer electron app for Windows
|
||||||
"`nChecking for installer package for Windows..."
|
"`nChecking for installer package for Windows..."
|
||||||
@ -50,7 +52,8 @@ if ($alt_tag -imatch 'WikiMed|Wikivoyage') {
|
|||||||
$comp_electron_archive = $base_dir + "$text_tag.by.Kiwix.$base_tag.zip"
|
$comp_electron_archive = $base_dir + "$text_tag.by.Kiwix.$base_tag.zip"
|
||||||
$WinInstaller = $base_dir + "$alt_tag by Kiwix Setup $numeric_tag-E.exe"
|
$WinInstaller = $base_dir + "$alt_tag by Kiwix Setup $numeric_tag-E.exe"
|
||||||
}
|
}
|
||||||
if (-Not (Test-Path $WinInstaller -PathType Leaf)) {
|
if ($electronbuild -eq "local") {
|
||||||
|
if (-Not (Test-Path $WinInstaller -PathType Leaf)) {
|
||||||
"No package found: building $WinInstaller..."
|
"No package found: building $WinInstaller..."
|
||||||
if (-Not $dryrun) {
|
if (-Not $dryrun) {
|
||||||
npm run dist-win
|
npm run dist-win
|
||||||
@ -60,9 +63,11 @@ if (-Not (Test-Path $WinInstaller -PathType Leaf)) {
|
|||||||
"Oh no! The Windows installer build failed!"
|
"Oh no! The Windows installer build failed!"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
"Package found."
|
"Package found."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
# Portable app isn't built in the cloud, so we always run this
|
||||||
if (-Not ($old_windows_support -or (Test-Path $comp_electron_archive -PathType Leaf))) {
|
if (-Not ($old_windows_support -or (Test-Path $comp_electron_archive -PathType Leaf))) {
|
||||||
# Package portable electron app for Windows
|
# Package portable electron app for Windows
|
||||||
"Building portable Electron app for Windows"
|
"Building portable Electron app for Windows"
|
||||||
@ -109,22 +114,23 @@ if (-Not ($old_windows_support -or (Test-Path $comp_electron_archive -PathType L
|
|||||||
"Compressing: $AddAppPackage, $compressed_assets_dir to $comp_electron_archive"
|
"Compressing: $AddAppPackage, $compressed_assets_dir to $comp_electron_archive"
|
||||||
if (-Not $dryrun) { "$AddAppPackage", "$compressed_assets_dir" | Compress-Archive -DestinationPath $comp_electron_archive -Force }
|
if (-Not $dryrun) { "$AddAppPackage", "$compressed_assets_dir" | Compress-Archive -DestinationPath $comp_electron_archive -Force }
|
||||||
}
|
}
|
||||||
# Package Electron app for Linux
|
if ($electronbuild -eq "local") {
|
||||||
"`nChecking for Electron packages for Linux..."
|
# Package Electron app for Linux
|
||||||
$LinuxBasePackage = $base_dir + "Kiwix JS $alt_tag-$numeric_tag-E"
|
"`nChecking for Electron packages for Linux..."
|
||||||
if ($alt_tag -imatch 'Wikivoyage|WikiMed') {
|
$LinuxBasePackage = $base_dir + "Kiwix JS $alt_tag-$numeric_tag-E"
|
||||||
|
if ($alt_tag -imatch 'Wikivoyage|WikiMed') {
|
||||||
$LinuxBasePackage = $base_dir + "$alt_tag by Kiwix-$numeric_tag-E"
|
$LinuxBasePackage = $base_dir + "$alt_tag by Kiwix-$numeric_tag-E"
|
||||||
}
|
}
|
||||||
$DebBasePackage = $base_dir + $package_name + "_$numeric_tag-E"
|
$DebBasePackage = $base_dir + $package_name + "_$numeric_tag-E"
|
||||||
$RPMBasePackage = $base_dir + $package_name + "-$numeric_tag-E"
|
$RPMBasePackage = $base_dir + $package_name + "-$numeric_tag-E"
|
||||||
$AppImageArchives = @("$LinuxBasePackage.AppImage", ($LinuxBasePackage + "-i386.AppImage"),
|
$AppImageArchives = @("$LinuxBasePackage.AppImage", ($LinuxBasePackage + "-i386.AppImage"),
|
||||||
("$DebBasePackage" + "_i386.deb"), ("$DebBasePackage" + "_amd64.deb"))
|
("$DebBasePackage" + "_i386.deb"), ("$DebBasePackage" + "_amd64.deb"))
|
||||||
if ($alt_tag -notmatch 'WikiMed|Wikivoyage') {
|
if ($alt_tag -notmatch 'WikiMed|Wikivoyage') {
|
||||||
$RPMArchives = @("$RPMBasePackage.x86_64.rpm", "$RPMBasePackage.i686.rpm");
|
$RPMArchives = @("$RPMBasePackage.x86_64.rpm", "$RPMBasePackage.i686.rpm");
|
||||||
$AppImageArchives += $RPMArchives
|
$AppImageArchives += $RPMArchives
|
||||||
}
|
}
|
||||||
"Processing $AppImageArchives"
|
"Processing $AppImageArchives"
|
||||||
foreach ($AppImageArchive in $AppImageArchives) {
|
foreach ($AppImageArchive in $AppImageArchives) {
|
||||||
if (-Not (Test-Path $AppImageArchive -PathType Leaf)) {
|
if (-Not (Test-Path $AppImageArchive -PathType Leaf)) {
|
||||||
"No packages found: building $AppImageArchive..."
|
"No packages found: building $AppImageArchive..."
|
||||||
# To get docker to start, you might need to run below commands as admin
|
# To get docker to start, you might need to run below commands as admin
|
||||||
@ -150,6 +156,7 @@ foreach ($AppImageArchive in $AppImageArchives) {
|
|||||||
} else {
|
} else {
|
||||||
"Linux Electron package $AppImageArchive is available"
|
"Linux Electron package $AppImageArchive is available"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($old_windows_support) {
|
if ($old_windows_support) {
|
||||||
"`nSupport for XP and Vista was requested."
|
"`nSupport for XP and Vista was requested."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user