-
Notifications
You must be signed in to change notification settings - Fork 6
/
make.ps1
27 lines (23 loc) · 920 Bytes
/
make.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$version = "0.0.0"
Function build_and_package {
Foreach ($target in $args) {
Write-Host "run build for $target start:"
$res = (Start-Process cargo -ArgumentList "build --release --target $target" -Wait -PassThru -NoNewWindow).ExitCode -Eq 0
Write-Host "build $target ok: $res"
$res -and (
Compress-Archive -Verbose -Path target/$target/release/fht2p.exe -CompressionLevel Optimal -Force -DestinationPath target/fht2p-v$version-$target.zip
)
}
}
Function get_version {
$toml = Get-Content "Cargo.toml"
$version_line = $toml -match '^version = .+#'
Write-Host "version_line: $version_line"
$script:version = $version_line.Split('"')[1]
Write-Host "version: $version"
return $version
}
# (get_version) -and (Write-Host "version2: $version")
(get_version) -and (
build_and_package "x86_64-pc-windows-msvc" "i586-pc-windows-msvc"
)