From 77da9f1e2d04fe4483996d4aba6d0126c62d0aa0 Mon Sep 17 00:00:00 2001 From: David Gardiner Date: Sat, 2 Nov 2024 17:20:29 +1030 Subject: [PATCH] pbi-tools 1.1.1 --- pbi-tools/pbi-tools.nuspec | 8 +++-- pbi-tools/tools/chocolateyinstall.ps1 | 7 ++-- pbi-tools/update.ps1 | 46 +++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 pbi-tools/update.ps1 diff --git a/pbi-tools/pbi-tools.nuspec b/pbi-tools/pbi-tools.nuspec index eb2d0b13..2d7031b0 100644 --- a/pbi-tools/pbi-tools.nuspec +++ b/pbi-tools/pbi-tools.nuspec @@ -3,13 +3,13 @@ pbi-tools - 1.0.0-rc02 + 1.1.1 https://github.com/flcdrg/au-packages/tree/master/pbi-tools flcdrg pbi-tools Mathias Thierbach https://pbi.tools/ - https://pbi.tools/images/company_logo.png + https://rawcdn.githack.com/flcdrg/au-packages/33ec628bb4b38f7af7616a47b2324de34c648998/pbi-tools/icons/pbi-tools.png Mathias Thierbach https://raw.githubusercontent.com/pbi-tools/pbi-tools/main/LICENSE false @@ -25,7 +25,9 @@ - Windows 64-bit - Power BI Desktop 64-bit. Installer version (default location) and/or Windows Store version supported. Optionally, pbi-tools works with Power BI Desktop in a custom location, provided the path is specified in the `PBITOOLS_PbiInstallDir` environment variable. - .Net Framework Runtime 4.7.2 (Comes with Power BI Desktop) - + diff --git a/pbi-tools/tools/chocolateyinstall.ps1 b/pbi-tools/tools/chocolateyinstall.ps1 index 7f9f03de..362a3faf 100644 --- a/pbi-tools/tools/chocolateyinstall.ps1 +++ b/pbi-tools/tools/chocolateyinstall.ps1 @@ -1,6 +1,9 @@ $ErrorActionPreference = 'Stop'; $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" +$url64 = 'https://github.com/pbi-tools/pbi-tools/releases/download/1.1.1/pbi-tools.1.1.1.zip' +$checksum64 = 'f2d0a26f68f9ac20a8729513dad850cf9253182c86637209bd49e6753cfe2a77' + $packageArgs = @{ packageName = $env:ChocolateyPackageName softwareName = 'pbi-tools*' @@ -8,8 +11,8 @@ $packageArgs = @{ silentArgs = '' validExitCodes= @(0) - url64 = "https://github.com/pbi-tools/pbi-tools/releases/download/1.0.0-rc.2/pbi-tools.1.0.0-rc.2.zip" #download URL, HTTPS preferrred - checksum64 = '2DA0061A53C17BA1B2840BF89EF58B496F9AAB1355FB09A16094D3E3FFB6E934' + url64 = $url64 + checksum64 = $checksum64 checksumType64= 'sha256' destination = $toolsDir } diff --git a/pbi-tools/update.ps1 b/pbi-tools/update.ps1 new file mode 100644 index 00000000..2b30d1e6 --- /dev/null +++ b/pbi-tools/update.ps1 @@ -0,0 +1,46 @@ +Import-Module chocolatey-au + +$ErrorActionPreference = 'Stop' + +function global:au_SearchReplace { + @{ + ".\tools\chocolateyInstall.ps1" = @{ + "(?i)(^[$]url64\s*=\s*)'.*'" = "`${1}'$($Latest.URL64)'" + "(?i)(^[$]checksum64\s*=\s*)'.*'" = "`${1}'$($Latest.Checksum64)'" + } + } +} + +. ../_scripts/GitHub.ps1 + +function global:au_GetLatest { + $release = Get-GitHubLatestRelease "pbi-tools/pbi-tools" + + $version = Get-ReleaseVersion -release $release + + # Convert semver2 to semver1 + $version = $version.Replace("-beta.", "-beta").Replace("-rc.", "-rc") + + if (-not $version) { + Write-Warning "Couldn't find version number" + return "Ignore" + } + + $assets = Invoke-RestMethod -Method Get -Uri $release.assets_url -Headers $headers + + # filename 'pbi-tools.1.1.1.zip' + $asset64 = $assets | Where-Object { $_.name -match 'pbi-tools\.\d+\.\d+\.\d+\.zip' } | Select-Object -First 1 + + $Latest = @{ + Version = $version + Url64 = $asset64.browser_download_url + ReleaseNotes = $release.body.Replace("# ", "## ") # Increase heading levels + } + return $Latest +} + +function global:au_AfterUpdate ($Package) { + Update-ReleaseNotes $Package +} + +update -ChecksumFor 64 \ No newline at end of file