From 8efe20843d4035b042b628a5c52877e06d7d4686 Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Sun, 28 Dec 2025 23:50:07 +0300 Subject: [PATCH] Updated choco CI/CD --- .github/workflows/Chocolatey.yml | 6 ++---- Scripts/chocolatey.ps1 | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Chocolatey.yml b/.github/workflows/Chocolatey.yml index 85b1a4fd..a8e284be 100644 --- a/.github/workflows/Chocolatey.yml +++ b/.github/workflows/Chocolatey.yml @@ -16,13 +16,11 @@ jobs: . "Scripts\Chocolatey.ps1" - name: Pack and push to Chocolatey - env: - Latest_Release: ${{ secrets.Latest_Release }} run: | - Write-Verbose -Message $env.Latest_Release -Verbose + Write-Verbose -Message $env:LatestRelease -Verbose # Replace variables with script latest versions - (Get-Content -Path "chocolatey\sophia.nuspec" -Encoding utf8NoBOM -Raw) -replace ("SophiaScriptVersion", "${{ env.Latest_Release }}") | Set-Content -Path "chocolatey\sophia.nuspec" -Encoding utf8NoBOM -Force + (Get-Content -Path "chocolatey\sophia.nuspec" -Encoding utf8NoBOM -Raw) -replace ("SophiaScriptVersion", "${{ env.LatestRelease }}") | Set-Content -Path "chocolatey\sophia.nuspec" -Encoding utf8NoBOM -Force choco pack chocolatey\sophia.nuspec --outputdirectory chocolatey choco apikey --key ${{ secrets.CHOCOLATEY_SECRET }} --source https://push.chocolatey.org/ diff --git a/Scripts/chocolatey.ps1 b/Scripts/chocolatey.ps1 index 2c4b8048..9904eb9f 100644 --- a/Scripts/chocolatey.ps1 +++ b/Scripts/chocolatey.ps1 @@ -39,5 +39,5 @@ $Sophia_Script_Wrapper = ($assets | Where-Object -FilterSc } | Set-Content -Path "chocolatey\tools\chocolateyinstall.ps1" -Encoding utf8 -Force # Save latest release tag for sophia.nuspec -$Latest_Release = $Latest_Release.Sophia_Script_Windows_11_PowerShell_5_1 -echo "Latest_Release=$Latest_Release" >> $env:GITHUB_ENV +$LatestRelease = $Latest_Release.Sophia_Script_Windows_11_PowerShell_5_1 +"LatestRelease=$LatestRelease" >> $env:GITHUB_ENV