mirror of https://github.com/helm/helm
Signed-off-by: Rahul Somasundaram <ssrahul96@gmail.com>pull/10238/head
parent
932d2a98a2
commit
fe231d674b
@ -0,0 +1,46 @@
|
|||||||
|
if (![string]::IsNullOrEmpty(${Env:CIRCLE_PR_NUMBER})) {
|
||||||
|
Write-Host "Skipping deploy step; as this is a PR"
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (![string]::IsNullOrEmpty(${Env:CIRCLE_TAG})) {
|
||||||
|
$ci_version = ${Env:CIRCLE_TAG}
|
||||||
|
}
|
||||||
|
elseif ( ${Env:CIRCLE_BRANCH} -eq "main" ) {
|
||||||
|
$ci_version = "canary"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Host "Skipping deploy step; this is neither a releasable branch or a tag"
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
Invoke-WebRequest -Uri https://jrsoftware.org/download.php/is.exe -OutFile inno.exe
|
||||||
|
|
||||||
|
$process = Start-Process -FilePath .\inno.exe -ArgumentList "/VERYSILENT", "/NORESTART" -NoNewWindow -PassThru -Wait
|
||||||
|
|
||||||
|
$process.WaitForExit()
|
||||||
|
|
||||||
|
Write-Host "Inno installer exit code : " $process.ExitCode
|
||||||
|
|
||||||
|
$binary_name = "helm-" + $ci_version + "-windows-amd64"
|
||||||
|
|
||||||
|
Write-Host "App Version :" $ci_version "Binary Name :" $binary_name
|
||||||
|
|
||||||
|
$process = Start-Process -FilePath ${Env:ProgramFiles(x86)}"\Inno Setup 6\ISCC.exe" -ArgumentList "helm_installer.iss", "/Dversion=$ci_version", "/Dopname=$binary_name" -NoNewWindow -PassThru -Wait
|
||||||
|
|
||||||
|
$process.WaitForExit()
|
||||||
|
|
||||||
|
Write-Host "Inno Compiler exit code : " $process.ExitCode
|
||||||
|
|
||||||
|
|
||||||
|
$output = "Output\"
|
||||||
|
$binary_path = $output + $binary_name + ".exe"
|
||||||
|
|
||||||
|
$hash = Get-FileHash -Path $binary_path -Algorithm SHA256
|
||||||
|
|
||||||
|
$opsha = $output + [System.IO.Path]::GetFileName($hash.Path) + $hash.Algorithm.ToLower()
|
||||||
|
$hash.Hash > $opsha
|
||||||
|
|
||||||
|
$opshasum = $opsha + "sum"
|
||||||
|
|
||||||
|
$hash.Hash + " " + $binary_name + ".exe" > $opshasum
|
@ -0,0 +1,34 @@
|
|||||||
|
[Setup]
|
||||||
|
AppName=Helm
|
||||||
|
AppVersion={#version}
|
||||||
|
DefaultDirName={autopf}\Helm
|
||||||
|
DefaultGroupName=Helm
|
||||||
|
PrivilegesRequired=lowest
|
||||||
|
AppPublisher=Helm
|
||||||
|
AppPublisherURL=https://helm.sh
|
||||||
|
AppSupportURL=https://github.com/helm/helm
|
||||||
|
LicenseFile="windows-amd64\LICENSE"
|
||||||
|
OutputBaseFilename={#opname}
|
||||||
|
|
||||||
|
[Files]
|
||||||
|
Source: "windows-amd64\*" ; DestDir: "{app}\bin";
|
||||||
|
|
||||||
|
[Registry]
|
||||||
|
Root: "HKCU"; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}\bin"; Check: NeedsAddPathHKCU(ExpandConstant('{app}\bin'))
|
||||||
|
|
||||||
|
[Code]
|
||||||
|
function NeedsAddPathHKCU(Param: string): boolean;
|
||||||
|
var
|
||||||
|
OrigPath: string;
|
||||||
|
begin
|
||||||
|
if not RegQueryStringValue(HKEY_CURRENT_USER,
|
||||||
|
'Environment',
|
||||||
|
'Path', OrigPath)
|
||||||
|
then begin
|
||||||
|
Result := True;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
// look for the path with leading and trailing semicolon
|
||||||
|
// Pos() returns 0 if not found
|
||||||
|
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
|
||||||
|
end;
|
Loading…
Reference in new issue