Skip to content

Commit

Permalink
Merge pull request #7 from stackql/feature/stackql-release-update
Browse files Browse the repository at this point in the history
updated to 0.5.509
  • Loading branch information
jeffreyaven authored Dec 25, 2023
2 parents a92dab7 + 8b4f22f commit 3eca3f1
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 21 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ Creates a chocolatey package for stackql

## Bump the version

To bump the version, update the `version` field in `stackql/stackql.nuspec` to the new version number.
To bump the version, update the `version` and `releaseNotes` fields in `stackql/stackql.nuspec`.

```xml
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>stackql</id>
<version>0.5.509</version>
<releaseNotes>https://github.com/stackql/stackql/releases/tag/v0.5.509</releaseNotes>
...
```

Expand Down
6 changes: 4 additions & 2 deletions stackql/stackql.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ This is a nuspec. It mostly adheres to https://docs.nuget.org/create/Nuspec-Refe
<metadata>
<id>stackql</id>
<version>0.5.509</version>
<releaseNotes>https://github.com/stackql/stackql/releases/tag/v0.5.509</releaseNotes>
<packageSourceUrl>https://github.com/stackql/chocolatey-install</packageSourceUrl>
<owners>stackql</owners>
<title>stackql (Install)</title>
<authors>stackql</authors>
<projectUrl>https://stackql.io/</projectUrl>
<iconUrl>https://rawcdn.githack.com/stackql/stackql.io/c58a82edd5c42244866e01887cc112a2c275a08b/static/android-chrome-192x192.png</iconUrl>
<!-- <copyright>Year Software Vendor</copyright> -->
<copyright>2023 StackQL Studios</copyright>
<licenseUrl>https://github.com/stackql/stackql/blob/main/LICENSE</licenseUrl>
<authors>stackql</authors>
<owners>stackql</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<projectSourceUrl>https://github.com/stackql/stackql</projectSourceUrl>
<docsUrl>https://stackql.io/docs</docsUrl>
Expand All @@ -36,7 +39,6 @@ This is a nuspec. It mostly adheres to https://docs.nuget.org/create/Nuspec-Refe
<tags>stackql cspm</tags>
<summary>Query and interact with cloud and SaaS resources using SQL</summary>
<description>StackQL is a multi-cloud XOps development tool that enables you to query and interact with cloud and SaaS resources using SQL. StackQL can be used for compliance, assurance, IaC, SysOps and more.</description>
<!-- <releaseNotes>__REPLACE_OR_REMOVE__MarkDown_Okay</releaseNotes> -->
<!-- =============================== -->
<!-- Specifying dependencies and version ranges? https://docs.nuget.org/create/versioning#specifying-version-ranges-in-.nuspec-files -->
<!--<dependencies>
Expand Down
28 changes: 10 additions & 18 deletions stackql/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
$ErrorActionPreference = 'Stop';
$ErrorActionPreference = 'Stop';
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url64 = 'https://releases.stackql.io/stackql/latest/stackql_windows_amd64.msi'

# Download the file temporarily to calculate checksum
$tempFile = Join-Path $env:TEMP 'stackql.msi'
Invoke-WebRequest -Uri $url64 -OutFile $tempFile

# Calculate checksum
$checksum64 = (certutil -hashfile $tempFile SHA256)[1] -replace " ", ""
Remove-Item $tempFile -Force

$packageArgs = @{
packageName = $env:ChocolateyPackageName
unzipLocation = $toolsDir
fileType = 'MSI'
url64bit = $url64
softwareName = 'stackql*'
checksum64 = $checksum64.Hash
checksumType64= 'sha256'
silentArgs = "/passive /l* stackql.log"
validExitCodes= @(0, 3010, 1641)
packageName = $env:ChocolateyPackageName
unzipLocation = $toolsDir
fileType = 'MSI'
url64bit = $url64
softwareName = 'stackql*'
checksum64 = '60025e4479d5945c712230481004689fc38b68102423f3407330c90e28c07953'
checksumType64 = 'sha256'
silentArgs = "/passive /l* stackql.log"
validExitCodes = @(0, 3010, 1641)
}

Install-ChocolateyPackage @packageArgs
22 changes: 22 additions & 0 deletions update_checksum.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
$ErrorActionPreference = 'Stop'

# Define URLs and paths
$msiUrl = 'https://releases.stackql.io/stackql/latest/stackql_windows_amd64.msi'
$msiTempPath = Join-Path $env:TEMP 'stackql_windows_amd64.msi'
$installScriptPath = 'stackql\tools\chocolateyinstall.ps1'

# Download the MSI file
Invoke-WebRequest -Uri $msiUrl -OutFile $msiTempPath

# Calculate the checksum
$checksum = (certutil -hashfile $msiTempPath SHA256)[1] -replace " ", ""

# Remove the temporary MSI file
Remove-Item $msiTempPath -Force

# Update the install script with the new checksum
$scriptContent = Get-Content $installScriptPath -Raw
$updatedScriptContent = $scriptContent -replace "(checksum64\s*=\s*)'.*'", "`$1'$checksum'"
Set-Content $installScriptPath -Value $updatedScriptContent -Force

Write-Host "Updated checksum in $installScriptPath"

0 comments on commit 3eca3f1

Please sign in to comment.