You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.2 KiB
33 lines
1.2 KiB
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
|
|
|