🐛 Actions support set domain
This commit is contained in:
5
script/build.ps1
vendored
5
script/build.ps1
vendored
@@ -38,7 +38,7 @@ $total = $total - 1
|
|||||||
|
|
||||||
# for windows, we need replace package name to title
|
# for windows, we need replace package name to title
|
||||||
ForEach ($line in (Get-Content -Path .\app.csv | Select-Object -Skip 1)) {
|
ForEach ($line in (Get-Content -Path .\app.csv | Select-Object -Skip 1)) {
|
||||||
$name, $title, $name_zh, $url = $line.Split(",")
|
$name, $title, $name_zh, $url = $line.Split(","), $domain = ([Uri]$url).Host
|
||||||
Write-Host "building package ${index}/${total}"
|
Write-Host "building package ${index}/${total}"
|
||||||
Write-Host "package name is ${name} ${name_zh}"
|
Write-Host "package name is ${name} ${name_zh}"
|
||||||
Write-Host "=========================="
|
Write-Host "=========================="
|
||||||
@@ -54,6 +54,9 @@ ForEach ($line in (Get-Content -Path .\app.csv | Select-Object -Skip 1)) {
|
|||||||
# replace url with no regex
|
# replace url with no regex
|
||||||
(Get-Content -Path $pake_conf_path -Raw) | ForEach-Object { $_.Replace('"url": ""', "`"url`": `"${url}`"") } | Set-Content $pake_conf_path
|
(Get-Content -Path $pake_conf_path -Raw) | ForEach-Object { $_.Replace('"url": ""', "`"url`": `"${url}`"") } | Set-Content $pake_conf_path
|
||||||
|
|
||||||
|
# -- replace domain -- #
|
||||||
|
(Get-Content -Path $common_conf_path -Raw) -replace '"domain":\s*"[^"]*"', '"domain": ""' | Set-Content -Path $common_conf_path
|
||||||
|
(Get-Content -Path $common_conf_path -Raw) | ForEach-Object { $_.Replace('"domain": ""', "`"domain`": `"${domain}`"") } | Set-Content $common_conf_path
|
||||||
|
|
||||||
# -- replace package name -- #
|
# -- replace package name -- #
|
||||||
# clear package_name with regex
|
# clear package_name with regex
|
||||||
|
|||||||
10
script/build.sh
vendored
10
script/build.sh
vendored
@@ -59,6 +59,8 @@ do
|
|||||||
package_title=${arr[1]}
|
package_title=${arr[1]}
|
||||||
package_zh_name=${arr[2]}
|
package_zh_name=${arr[2]}
|
||||||
url=${arr[3]}
|
url=${arr[3]}
|
||||||
|
domain=${url//http*:\/\//}
|
||||||
|
domain=${domain%%/*}
|
||||||
|
|
||||||
# replace package info
|
# replace package info
|
||||||
# clear url with regex
|
# clear url with regex
|
||||||
@@ -66,6 +68,10 @@ do
|
|||||||
# replace url with no regex
|
# replace url with no regex
|
||||||
$sd -s "\"url\": \"\"," "\"url\": \"${url}\"," src-tauri/pake.json
|
$sd -s "\"url\": \"\"," "\"url\": \"${url}\"," src-tauri/pake.json
|
||||||
|
|
||||||
|
# replace dangerousRemoteDomainIpcAccess domain
|
||||||
|
$sd "\"domain\": \"(.*?)\"," "\"domain\": \"\"," src-tauri/tauri.conf.json
|
||||||
|
$sd -s "\"domain\": \"\"," "\"domain\": \"${domain}\"," src-tauri/tauri.conf.json
|
||||||
|
|
||||||
# for apple, need replace title
|
# for apple, need replace title
|
||||||
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
||||||
# update icon
|
# update icon
|
||||||
@@ -157,8 +163,8 @@ do
|
|||||||
|
|
||||||
if [[ "$OSTYPE" =~ ^linux ]]; then
|
if [[ "$OSTYPE" =~ ^linux ]]; then
|
||||||
npm run tauri build
|
npm run tauri build
|
||||||
mv src-tauri/target/release/bundle/deb/${package_prefix}-"${package_name}"*.deb output/linux/"${package_title}"_`arch`.deb
|
mv "src-tauri/target/release/bundle/deb/${package_prefix}-${package_name}"*.deb "output/linux/${package_title}_`arch`.deb"
|
||||||
mv src-tauri/target/release/bundle/appimage/${package_prefix}-"${package_name}"*.AppImage output/linux/"${package_title}"_`arch`.AppImage
|
mv "src-tauri/target/release/bundle/appimage/${package_prefix}-${package_name}"*.AppImage "output/linux/${package_title}_`arch`.AppImage"
|
||||||
echo clear cache
|
echo clear cache
|
||||||
rm src-tauri/target/release
|
rm src-tauri/target/release
|
||||||
rm -rf src-tauri/target/release/bundle
|
rm -rf src-tauri/target/release/bundle
|
||||||
|
|||||||
Reference in New Issue
Block a user