Skip to content

Commit

Permalink
updates for 2.4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dovholuknf committed Sep 23, 2024
1 parent 4cb30d1 commit e9f513b
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 44 deletions.
55 changes: 39 additions & 16 deletions Installer/build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
param(
[string]$version,
[string]$url = "https://github.com/openziti/desktop-edge-win/releases/download/",
[string]$stream = "beta",
[datetime]$published_at = (Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ"),
[bool]$jsonOnly = $false,
[bool]$revertGitAfter = $true,
[string]$versionQualifier = ""
)

$ErrorActionPreference = "Stop"

function verifyFile($path) {
Expand All @@ -18,7 +28,7 @@ $ADV_INST_HOME = "C:\Program Files (x86)\Caphyon\Advanced Installer ${ADV_INST_V
$SIGNTOOL="${ADV_INST_HOME}\third-party\winsdk\x64\signtool.exe"
$ADVINST = "${ADV_INST_HOME}\bin\x86\AdvancedInstaller.com"
$ADVPROJECT = "${scriptPath}\ZitiDesktopEdge.aip"
$ZITI_EDGE_TUNNEL_VERSION="v1.1.0"
$ZITI_EDGE_TUNNEL_VERSION="v1.1.4"

echo "Cleaning previous build folder if it exists"
Remove-Item "${buildPath}" -r -ErrorAction Ignore
Expand All @@ -35,7 +45,7 @@ if($null -eq $env:ZITI_EDGE_TUNNEL_BUILD) {
}
echo "========================== fetching ziti-edge-tunnel =========================="
$zet_dl="https://github.com/openziti/ziti-tunnel-sdk-c/releases/download/${ZITI_EDGE_TUNNEL_VERSION}/ziti-edge-tunnel-Windows_x86_64.zip"
echo "Beginning to download ziti-edge-tunnel from ${zet_dl}"
echo "Beginning to download ziti-edge-tunnel from ${zet_dl} to ${destination}"
echo ""
$response = Invoke-WebRequest $zet_dl -OutFile "${destination}"
} else {
Expand Down Expand Up @@ -77,16 +87,21 @@ msbuild ZitiDesktopEdge.sln /property:Configuration=Release

Pop-Location

$installerVersion=(Get-Content -Path ${checkoutRoot}\version)
if ($version -eq "") {
$version=(Get-Content -Path ${checkoutRoot}\version)
}

echo "Building VERSION $version"

if($null -ne $env:ZITI_DESKTOP_EDGE_VERSION) {
echo "ZITI_DESKTOP_EDGE_VERSION is set. Using that: ${env:ZITI_DESKTOP_EDGE_VERSION} instead of version found in file ${installerVersion}"
$installerVersion=$env:ZITI_DESKTOP_EDGE_VERSION
echo "Version set to: ${installerVersion}"
echo "ZITI_DESKTOP_EDGE_VERSION is set. Using that: ${env:ZITI_DESKTOP_EDGE_VERSION} instead of version found in file ${version}"
$version=$env:ZITI_DESKTOP_EDGE_VERSION
echo "Version set to: ${version}"
}
$action = '/SetVersion'

echo "issuing $ADVINST /edit $ADVPROJECT $action $installerVersion (service version: $serviceVersion) - see https://www.advancedinstaller.com/user-guide/set-version.html"
& $ADVINST /edit $ADVPROJECT $action $installerVersion
echo "issuing $ADVINST /edit $ADVPROJECT $action $version (service version: $serviceVersion) - see https://www.advancedinstaller.com/user-guide/set-version.html"
& $ADVINST /edit $ADVPROJECT $action $version

$action = '/build'
echo "Assembling installer using AdvancedInstaller at: $ADVINST $action $ADVPROJECT"
Expand All @@ -103,7 +118,7 @@ if($gituser -eq "ziti-ci") {
}

$outputPath="${scriptPath}\Output"
$exeName="Ziti Desktop Edge Client-${installerVersion}.exe"
$exeName="Ziti Desktop Edge Client-${version}.exe"
$exeAbsPath="${outputPath}\${exeName}"

if($null -eq $env:AWS_KEY_ID) {
Expand All @@ -118,15 +133,23 @@ if($null -eq $env:OPENZITI_P12_PASS_2024) {
echo ""
} else {
echo "adding additional signature to executable with openziti.org signing certificate"
echo "Using ${SIGNTOOL} to sign executable with the additional OpenZiti signature"
echo "Using ${SIGNTOOL} to sign executable with the additional OpenZiti signature: ${exeAbsPath}"
& "$SIGNTOOL" sign /f "${scriptPath}\openziti_2024.p12" /p "${env:OPENZITI_P12_PASS_2024}" /tr http://ts.ssl.com /fd sha512 /td sha512 /as "${exeAbsPath}"
}

(Get-FileHash "${exeAbsPath}").Hash > "${scriptPath}\Output\Ziti Desktop Edge Client-${installerVersion}.exe.sha256"
(Get-FileHash "${exeAbsPath}").Hash > "${scriptPath}\Output\Ziti Desktop Edge Client-${version}.exe.sha256"
echo "========================== build.ps1 completed =========================="

$defaultRootUrl = "https://github.com/openziti/desktop-edge-win/releases/download/"
$defaultStream = "beta"
$defaultPublishedAt = Get-Date
$updateJson = "${installerVersion}.json"
& .\Installer\output-build-json.ps1 -version $installerVersion -url $defaultRootUrl -stream $defaultStream -published_at $defaultPublishedAt -outputPath $updateJson
$outputPath = "${scriptPath}\Output\Ziti Desktop Edge Client-${version}.exe.json"
& .\Installer\output-build-json.ps1 -version $version -url $url -stream $stream -published_at $published_at -outputPath $outputPath -versionQualifier $versionQualifier

echo "REMOVING .back files: ${scriptPath}\*back*"
Remove-Item "${scriptPath}\*back*" -Recurse -ErrorAction SilentlyContinue

echo "Copying json file to beta.json"
copy $outputPath "$checkoutRoot\release-streams\beta.json"


if($revertGitAfter) {
git checkout DesktopEdge/Properties/AssemblyInfo.cs ZitiUpdateService/Properties/AssemblyInfo.cs Installer/ZitiDesktopEdge.aip
}
9 changes: 5 additions & 4 deletions Installer/output-build-json.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
param(
[Parameter(Mandatory = $true)]
[string]$version,
[string]$url = "http://localhost:8000/local",
[string]$stream = "beta",
[string]$url = "http://localhost:8000/release-streams/local",
[string]$stream = "local",
[string]$outputPath = "${version}.json",
[datetime]$published_at
[datetime]$published_at,
[string]$versionQualifier = ""
)

echo "=========== emitting a json file that represents this build ============"
Expand All @@ -29,7 +30,7 @@ $jsonTemplate = @"
"assets": [
{
"name": "Ziti.Desktop.Edge.Client-${version}.exe",
"browser_download_url": "${url}/${version}/Ziti.Desktop.Edge.Client-${version}.exe"
"browser_download_url": "${url}/${version}${versionQualifier}/Ziti.Desktop.Edge.Client-${version}.exe"
}
]
}
Expand Down
50 changes: 32 additions & 18 deletions build-test-release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,54 @@
param(
[Parameter(Mandatory = $true)]
[string]$version,
[string]$url = "http://localhost:8000/local",
[string]$url = "http://localhost:8000/release-streams/local",
[string]$stream = "local",
[datetime]$published_at = (Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ"),
[bool]$jsonOnly = $false,
[switch]$keepGitAfter
[bool]$revertGitAfter = $true,
[string]$versionQualifier = ""
)
echo ""
$env:ZITI_DESKTOP_EDGE_DOWNLOAD_URL="$url"
$env:ZITI_DESKTOP_EDGE_VERSION="$version"
$scriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Path -Parent

$outputPath = "$scriptDirectory\release-streams\${version}.json"
& .\Installer\output-build-json.ps1 -version $version -url $url -stream $stream -published_at $published_at -outputPath $outputPath

Copy-Item -Force "$scriptDirectory\release-streams\${version}.json" "$scriptDirectory\release-streams\${stream}.json"
echo "json file written to: $scriptDirectory\release-streams\${stream}.json"

if(! $jsonOnly) {
$scriptToExecute = Join-Path -Path $scriptDirectory -ChildPath "Installer\build.ps1"
& $scriptToExecute
& .\Installer\build.ps1 -version $version -url $url -stream $stream -published_at $published_at -jsonOnly $jsonOnly -revertGitAfter $revertGitAfter -versionQualifier $versionQualifier
$exitCode = $LASTEXITCODE
if($exitCode -gt 0) {
Write-Host "build.ps1 failed!"
exit $exitCode
}
Write-Host "only updating the json at $scriptDirectory\release-streams\${stream}.json"
mkdir $scriptDirectory\release-streams\local\${version} -ErrorAction Ignore > $null
Move-Item -Force "./Installer/Output/Ziti Desktop Edge Client-${version}.exe" "$scriptDirectory\release-streams\local\${version}\Ziti.Desktop.Edge.Client-${version}.exe"
Move-Item -Force "./Installer/Output/Ziti Desktop Edge Client-${version}.exe.sha256" "$scriptDirectory\release-streams\local\${version}\Ziti.Desktop.Edge.Client-${version}.exe.sha256"

mkdir "$scriptDirectory\release-streams\local\${version}" -ErrorAction Ignore > $null
#echo "$scriptDirectory/Installer/Output/Ziti Desktop Edge Client-${version}.exe" "$scriptDirectory\release-streams\local\${version}\Ziti.Desktop.Edge.Client-${version}.exe"
Move-Item -Force "$scriptDirectory/Installer/Output/Ziti Desktop Edge Client-${version}.exe" "$scriptDirectory\release-streams\local\${version}\Ziti.Desktop.Edge.Client-${version}.exe"
Move-Item -Force "$scriptDirectory/Installer/Output/Ziti Desktop Edge Client-${version}.exe.sha256" "$scriptDirectory\release-streams\local\${version}\Ziti.Desktop.Edge.Client-${version}.exe.sha256"
Write-Host ""
Write-Host "done."
Write-Host "installer exists at $scriptDirectory\release-streams\local\${version}\Ziti.Desktop.Edge.Client-${version}.exe"
}

$outputPath = "${version}.json"
& .\Installer\output-build-json.ps1 -version $version -url $url -stream $stream -published_at $published_at -outputPath $outputPath
Copy-Item -Force "$outputPath" "$scriptDirectory\release-streams\local\${version}"
Copy-Item -Force "$outputPath" "$scriptDirectory\release-streams\local\${version}\test.json"
Copy-Item -Force "${version}.json" "$scriptDirectory\release-streams\${stream}.json"

if(!$keepGitAfter) {
if($revertGitAfter) {
git checkout DesktopEdge/Properties/AssemblyInfo.cs ZitiUpdateService/Properties/AssemblyInfo.cs Installer/ZitiDesktopEdge.aip
}
echo "Done"
echo "json file written to: $scriptDirectory\release-streams\${stream}.json"
echo "run a python server to test: python -m http.server 8000 -d .\release-streams"

Write-Host ""
Write-Host "Dependencies from ziti-edge-tunnel:"
Write-Host "---------------------------------------------"
& '.\Installer\build\service\ziti-edge-tunnel.exe' version -v
Write-Host ""

Write-Host "Start a python server in this location with:"
Write-Host ""
Write-Host " python -m http.server 8000"
Write-Host ""
Write-Host "Set the automatic upgrade url to http://localhost:8000/release-streams/local.json"
Write-Host ""
10 changes: 5 additions & 5 deletions release-streams/beta.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "2.4.0.0",
"tag_name": "2.4.0.0",
"published_at": "2024-07-01T18:18:53Z",
"name": "2.4.1.0",
"tag_name": "2.4.1.0",
"published_at": "2024-09-23T05:38:06Z",
"installation_critical": false,
"assets": [
{
"name": "Ziti.Desktop.Edge.Client-2.4.0.0.exe",
"browser_download_url": "https://github.com/openziti/desktop-edge-win/releases/download/2.4.0.0/Ziti.Desktop.Edge.Client-2.4.0.0.exe"
"name": "Ziti.Desktop.Edge.Client-2.4.1.0.exe",
"browser_download_url": "http://localhost:8000/release-streams/local/2.4.1.0/Ziti.Desktop.Edge.Client-2.4.1.0.exe"
}
]
}
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.0.2
2.4.1.0

0 comments on commit e9f513b

Please sign in to comment.