Browse Source

Updated choco CI/CD

pull/702/head
Dmitry Nefedov 3 months ago
parent
commit
8efe20843d
  1. 6
      .github/workflows/Chocolatey.yml
  2. 4
      Scripts/chocolatey.ps1

6
.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/

4
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

Loading…
Cancel
Save