summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-01-23 03:51:44 +0800
committer魏曹先生 <1992414357@qq.com>2026-01-23 03:51:44 +0800
commitab3e1867bf54f6dbb10b80aac159ad52303166a3 (patch)
tree46a0f8123eecd3e61825b7a043036575057ae0f9
parent25eb411a2e4c4207fbd8111e68a520ff20cbda73 (diff)
Add pre-build validation to deployment scripts
-rw-r--r--deploy.ps123
-rwxr-xr-xdeploy.sh21
-rw-r--r--templates/setup_jv_cli.iss.template2
3 files changed, 44 insertions, 2 deletions
diff --git a/deploy.ps1 b/deploy.ps1
index d547c95..c76e7ed 100644
--- a/deploy.ps1
+++ b/deploy.ps1
@@ -5,11 +5,32 @@ $scriptPath = $MyInvocation.MyCommand.Path
$scriptDir = Split-Path $scriptPath -Parent
Set-Location $scriptDir
+# Test core library
+cargo test --manifest-path ..\VersionControl\Cargo.toml --workspace
+if ($LASTEXITCODE -ne 0) {
+ Write-Warning "Core library tests failed. Aborting build."
+ exit 1
+}
+
+# Test workspace
+cargo test --workspace
+if ($LASTEXITCODE -ne 0) {
+ Write-Warning "Workspace tests failed. Aborting build."
+ exit 1
+}
+
+# Check if git worktree is clean
+$gitStatus = git status --porcelain
+if ($gitStatus) {
+ Write-Warning "Git worktree is not clean. Commit or stash changes before building."
+ exit 1
+}
+
# Check for ISCC
$isccPath = Get-Command ISCC -ErrorAction SilentlyContinue
if (-not $isccPath) {
Write-Warning '"Inno Setup" not installed. (https://jrsoftware.org/isinfo.php)'
- exit
+ exit 1
}
# Build
diff --git a/deploy.sh b/deploy.sh
index 0ad0926..de598b7 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -5,6 +5,27 @@
# Change to the directory where the script is located
cd "$(dirname "$0")" || exit 1
+# Test core library
+cargo test --manifest-path ../VersionControl/Cargo.toml --workspace
+if [ $? -ne 0 ]; then
+ echo "Core library tests failed. Aborting build."
+ exit 1
+fi
+
+# Test workspace
+cargo test --workspace
+if [ $? -ne 0 ]; then
+ echo "Workspace tests failed. Aborting build."
+ exit 1
+fi
+
+# Check if git worktree is clean
+git_status=$(git status --porcelain)
+if [ -n "$git_status" ]; then
+ echo "Git worktree is not clean. Commit or stash changes before building."
+ exit 1
+fi
+
# Build
if FORCE_BUILD=$(date +%s) cargo build --workspace --release; then
# Export
diff --git a/templates/setup_jv_cli.iss.template b/templates/setup_jv_cli.iss.template
index 15a0fbc..8a45ee5 100644
--- a/templates/setup_jv_cli.iss.template
+++ b/templates/setup_jv_cli.iss.template
@@ -17,7 +17,7 @@ AllowNoIcons=yes
LicenseFile=..\..\LICENSE
PrivilegesRequired=lowest
OutputDir=..\..\.temp\
-OutputBaseFilename=JustEnoughVCS For Windows
+OutputBaseFilename=JustEnoughVCS_Windows_<<<VERSION>>>
SetupIconFile=..\..\resources\images\Yizi.ico
SolidCompression=yes
WizardStyle=modern dynamic