From d350525a100bf7e9527f0b554dbbbee54abce9a3 Mon Sep 17 00:00:00 2001 From: Fayeed Pawaskar Date: Mon, 23 Oct 2023 10:40:22 +0530 Subject: [PATCH] Fix windows release tag issue --- ui/package.json | 2 +- ui/scripts/patch-prerelease-tags.ps1 | 5 +++++ ui/scripts/reverse-patch-prerelease-tags.ps1 | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 ui/scripts/patch-prerelease-tags.ps1 create mode 100644 ui/scripts/reverse-patch-prerelease-tags.ps1 diff --git a/ui/package.json b/ui/package.json index bd75d6f18..55d68b0c8 100644 --- a/ui/package.json +++ b/ui/package.json @@ -29,7 +29,7 @@ "eject": "vite eject", "build": "vite build", "package-ad4m": "run-script-os", - "package-ad4m:windows": "cargo clean && yarn run build && yarn tauri build --verbose", + "package-ad4m:windows": "cargo clean && powershell -ExecutionPolicy Bypass -File ./scripts/patch-prerelease-tags.ps1 && yarn run build && yarn tauri build --verbose && powershell -ExecutionPolicy Bypass -File ./scripts/reverse-patch-prerelease-tags.ps1", "package-ad4m:macos": "yarn run build && yarn tauri build --verbose", "package-ad4m:linux": "yarn run build && ./scripts/patch-safe-buffer.sh && yarn tauri build --verbose && ./scripts/reverse-patch-safe-buffer.sh" }, diff --git a/ui/scripts/patch-prerelease-tags.ps1 b/ui/scripts/patch-prerelease-tags.ps1 new file mode 100644 index 000000000..76de559ff --- /dev/null +++ b/ui/scripts/patch-prerelease-tags.ps1 @@ -0,0 +1,5 @@ +(Get-Content -Path 'package.json' -Raw) -replace '"version": "(.*)-prerelease",', '"version": "$1",' | Set-Content -Path 'package.json' + +(Get-Content -Path 'src-tauri/tauri.conf.json' -Raw) -replace '"version": "(.*)-prerelease"', '"version": "$1"' | Set-Content -Path 'src-tauri/tauri.conf.json' + +(Get-Content -Path 'src-tauri/Cargo.toml' -Raw) -replace 'version = "(.*)-prerelease\.0"', 'version = "$1"' | Set-Content -Path 'src-tauri/Cargo.toml' diff --git a/ui/scripts/reverse-patch-prerelease-tags.ps1 b/ui/scripts/reverse-patch-prerelease-tags.ps1 new file mode 100644 index 000000000..c51fe56d9 --- /dev/null +++ b/ui/scripts/reverse-patch-prerelease-tags.ps1 @@ -0,0 +1,5 @@ +(Get-Content -Path 'package.json' -Raw) -replace '"version": "(.*)",', '"version": "$1-prerelease",' | Set-Content -Path 'package.json' + +(Get-Content -Path 'src-tauri/tauri.conf.json' -Raw) -replace '"version": "(.*)",', '"version": "$1-prerelease",' | Set-Content -Path 'src-tauri/tauri.conf.json' + +(Get-Content -Path 'src-tauri/Cargo.toml' -Raw) -replace 'version = "(.*)"', 'version = "$1-prerelease.0"' | Set-Content -Path 'src-tauri/Cargo.toml'