V0.72.0 #22
Workflow file for this run
This file contains 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: sync to chocolately | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: chocolatey | |
- name: Config and Push | |
run: | | |
rm .git -Recurse -Force -Confirm:$false | |
$response=curl.exe -s https://api.github.com/repos/lin-ycv/everythingpowertoys/releases/latest | |
$browser=($response | select-string "browser_").Line | |
if($browser.Count -gt 1){ $browser=$browser[$browser.Count-1] } | |
$url=$browser.Split("`"")[3] | |
$ver=($response | select-string '"name":').Line[0].Split("`"")[3].Split(" ")[0].substring(1) | |
Invoke-WebRequest $url -O e.zip | |
$sum=(Get-FileHash e.zip -Algorithm SHA256).Hash | |
rm e.zip | |
echo $ver $url $sum | |
Get-ChildItem *.* -Recurse | ForEach { (Get-Content $_) | ForEach {$_ -Replace '_VERSION_', $ver} | ForEach {$_ -Replace '_URL_', $url} | ForEach {$_ -Replace '_CRC_', $sum} | Set-Content $_ } | |
if([System.IO.File]::Exists("$PWD\1")) { rm 1 } | |
choco pack | |
ls | |
choco apikey --key ${{ secrets.CHOCOLATEY }} --source https://push.chocolatey.org/ | |
choco push everythingpowertoys.$ver.nupkg --source https://push.chocolatey.org/ |