Chocolatey push #42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Chocolatey push | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| Push: | |
| name: Push | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@main | |
| - name: Preparation | |
| run: | | |
| . "Scripts\Chocolatey.ps1" | |
| - name: Pack and push to Chocolatey | |
| run: | | |
| # $Latest_Release.Sophia_Script_Windows_11_PowerShell_5_1 | |
| Write-Verbose -Message $env:LatestRelease -Verbose | |
| # Replace variables with script latest versions | |
| (Get-Content -Path "Scripts\Chocolatey\sophia.nuspec" -Encoding utf8NoBOM -Raw) -replace ("SophiaScriptVersion", "${{ env.LatestRelease }}") | Set-Content -Path "Scripts\Chocolatey\sophia.nuspec" -Encoding utf8NoBOM -Force | |
| choco pack Scripts\Chocolatey\sophia.nuspec --outputdirectory Scripts\Chocolatey | |
| choco apikey --key ${{ secrets.CHOCOLATEY_SECRET }} --source https://push.chocolatey.org/ | |
| [xml]$Version = Get-Content -Path Scripts\Chocolatey\sophia.nuspec | |
| [string]$Version = $Version.package.metadata.version | |
| Write-Verbose -Message $Version -Verbose | |
| choco push Scripts\Chocolatey\sophia.$Version.nupkg --source https://push.chocolatey.org/ --yes |