hurl/bin/release/release.ps1

38 lines
1.2 KiB
PowerShell
Raw Normal View History

2022-12-28 12:20:27 +03:00
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
2023-04-05 12:07:50 +03:00
write-host -foregroundcolor Cyan "----- build release -----"
2022-09-27 10:04:21 +03:00
$actual_dir=(Get-Location).Path
$project_root_path=(Resolve-Path -LiteralPath $PSScriptRoot\..\..).path
# build
cargo build --release --verbose --locked
2022-12-28 12:20:27 +03:00
if ($LASTEXITCODE) { Throw }
# create final package
2022-09-27 10:04:21 +03:00
$release_dir="$project_root_path\target\release"
$package_dir="$project_root_path\target\win-package"
New-Item -ItemType Directory -Force -Path $package_dir
Get-ChildItem -Path $release_dir -Recurse -Include *.dll -File | Copy-Item -Destination "$package_dir"
2022-12-28 02:04:26 +03:00
Get-ChildItem -Path $release_dir -Recurse -Include hurl*.exe -File | Copy-Item -Destination "$package_dir"
2022-09-27 10:04:21 +03:00
((& $package_dir\hurl --version) -Split " ")[1] > $package_dir\version.txt
Get-Content $package_dir\version.txt
# add hurl to PATH
2022-09-28 18:41:43 +03:00
$registry_user_path=(Get-ItemProperty -Path 'HKCU:\Environment').Path
$registry_machine_path=(Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment').Path
$env:Path = "$package_dir;$registry_user_path;$registry_machine_path"
sleep 10
2022-09-28 18:41:43 +03:00
# hurl infos
(Get-Command hurl).Path
(Get-Command hurlfmt).Path
hurl --version
2022-12-28 12:20:27 +03:00
if ($LASTEXITCODE) { Throw }
2022-09-28 18:41:43 +03:00
hurlfmt --version
2022-12-28 12:20:27 +03:00
if ($LASTEXITCODE) { Throw }
2022-09-27 10:04:21 +03:00
cd $actual_dir
2023-04-05 12:07:50 +03:00