diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml index 4b286a8..f0c9ec7 100644 --- a/.github/workflows/autoupdate.yml +++ b/.github/workflows/autoupdate.yml @@ -58,16 +58,7 @@ jobs: if: steps.update.outputs.UpdateStatus == 'Update Available' - name: Commit Updated nuspec - run: | - $HEAD = $(git rev-parse HEAD) - $NUSPEC_B64 = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes([System.IO.File]::ReadAllText('wave\wave.nuspec'))) - $CHOCLATEY_B64 = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes([System.IO.File]::ReadAllText('wave\chocolateyinstall.ps1'))) - gh api graphql -f query=' - mutation createCommit { - createCommitOnBranch(input: {branch: {repositoryNameWithOwner: "wavetermdev/chocolatey", branchName: "main"}, message: {headline: "Update hello.txt"}, fileChanges: {additions: [{path: "wave/wave.nuspec", contents: "$($NUSPEC_B64)"},{path: "wave/tools/chocolateyinstall.ps1", contents:"$($CHOCOLATEY_B64)"}]}, expectedHeadOid: "$($HEAD)"}) { - commit { - url - } - } - }' + run: scripts\Commit-Update.ps1 + env: + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} shell: pwsh diff --git a/scripts/Commit-Update.ps1 b/scripts/Commit-Update.ps1 new file mode 100644 index 0000000..67dd03b --- /dev/null +++ b/scripts/Commit-Update.ps1 @@ -0,0 +1,14 @@ +$HEAD = $(git rev-parse HEAD) +$NUSPEC_B64 = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes([System.IO.File]::ReadAllText('wave\wave.nuspec'))) +$CHOCOLATEY_B64 = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes([System.IO.File]::ReadAllText('wave\tools\chocolateyinstall.ps1'))) +$QUERY = @" +mutation createCommit { + createCommitOnBranch(input: {branch: {repositoryNameWithOwner: "wavetermdev/chocolatey", branchName: "main"}, message: {headline: "Update hello.txt"}, fileChanges: {additions: [{path: "wave/wave.nuspec", contents: "$NUSPEC_B64"},{path: "wave/tools/chocolateyinstall.ps1", contents:"$CHOCOLATEY_B64"}]}, expectedHeadOid: "$HEAD"}) { + commit { + url + } + } +} +"@ + +gh api graphql -f query=$QUERY \ No newline at end of file diff --git a/wave/tools/chocolateyinstall.ps1 b/wave/tools/chocolateyinstall.ps1 index bb885fa..a44c138 100644 --- a/wave/tools/chocolateyinstall.ps1 +++ b/wave/tools/chocolateyinstall.ps1 @@ -1,6 +1,6 @@ $ErrorActionPreference = 'Stop' $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" -$url64 = 'https://dl.waveterm.dev/releases-w2/Wave-win32-x64-0.8.12.msi' +$url64 = 'https://dl.waveterm.dev/releases-w2/Wave-win32-x64-0.9.3.msi' $packageArgs = @{ packageName = $env:ChocolateyPackageName unzipLocation = $toolsDir @@ -8,10 +8,10 @@ $packageArgs = @{ url64bit = $url64 softwareName = 'Wave' - checksum64 = '064194834A092496B9BB3CED219C683F47A05E68A5E3F180C56C33A4FBB6CA6F02945E5812756E4B6004BF139946D2D07B0674DBEC883D2351AFEFF991680374' + checksum64 = '7b2802a8a2b86bae9dd973114435883cdb5dea4986c2804892be997e64c3d35b058a054adde57be5bacfe544583f35cff84df24f70e3c9e5b2b03d880d376b5c' checksumType64= 'sha512' silentArgs = "/qn /norestart /l*v `"$($env:TEMP)\$($packageName).$($env:chocolateyPackageVersion).MsiInstall.log`"" validExitCodes= @(0, 3010, 1641) } -Install-ChocolateyPackage @packageArgs +Install-ChocolateyPackage @packageArgs \ No newline at end of file diff --git a/wave/wave.nuspec b/wave/wave.nuspec index 93b11dd..3733559 100644 --- a/wave/wave.nuspec +++ b/wave/wave.nuspec @@ -1,7 +1,7 @@ wave - 0.8.12 + 0.9.3 Wave Terminal Command Line Inc https://www.waveterm.dev