2024-03-25 14:25:51 +08:00
|
|
|
name: sync to package repos
|
2024-01-19 14:56:27 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2024-01-24 18:06:06 +08:00
|
|
|
if: "!github.event.release.prerelease"
|
2024-01-19 14:56:27 +08:00
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
steps:
|
2024-04-07 16:06:14 +08:00
|
|
|
- uses: actions/checkout@v4.1.1
|
2024-01-19 14:56:27 +08:00
|
|
|
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
|
|
|
|
|
|
|
|
$ver = ($response | select-string '"tag_name":').Line.split("`"")[3].Trim('v')
|
|
|
|
|
2024-07-03 22:21:50 +08:00
|
|
|
$zip = ($response | Where-Object { $_ -like "*x64.zip`"" } | Select-Object -Last 1).Split("`"")[3]
|
2024-07-20 19:27:04 +08:00
|
|
|
$zipARM = ($response | Where-Object { $_ -like "*ARM64.zip`"" } | Select-Object -Last 1).Split("`"")[3]
|
2024-07-03 22:21:50 +08:00
|
|
|
$exe = ($response | Where-Object { $_ -like "*x64.exe`"" } | Select-Object -Last 1).Split("`"")[3]
|
2024-07-20 19:27:04 +08:00
|
|
|
$exeARM = ($response | Where-Object { $_ -like "*ARM64.exe`"" } | Select-Object -Last 1).Split("`"")[3]
|
2024-01-19 14:56:27 +08:00
|
|
|
|
|
|
|
$pattern = '(?s)(?<=<!--HASH-->).*?(?=<!--ENDHASH-->)'
|
|
|
|
$hash = (($response | select-string '"body"').Line | Select-String -Pattern $pattern | ForEach-Object { $_.Matches.Value.Trim() }).Split("\r\n")
|
2024-07-03 22:21:50 +08:00
|
|
|
$ziphash = ($hash | select-string "x64-ZIP").Line.Split('|')[1]
|
2024-07-20 19:27:04 +08:00
|
|
|
$zipARMhash = ($hash | select-string "ARM64-ZIP").Line.Split('|')[1]
|
2024-07-03 22:21:50 +08:00
|
|
|
$exehash = ($hash | select-string "x64-EXE").Line.Split('|')[1]
|
2024-07-20 19:27:04 +08:00
|
|
|
$exeARMhash = ($hash | select-string "ARM64-EXE").Line.Split('|')[1]
|
2024-01-19 14:56:27 +08:00
|
|
|
|
|
|
|
# chocolatey
|
|
|
|
echo $ver $zip $ziphash
|
|
|
|
Get-ChildItem *.* -Recurse | ForEach { (Get-Content $_) | ForEach {$_ -Replace '_VERSION_', $ver} | ForEach {$_ -Replace '_URL_', $zip} | ForEach {$_ -Replace '_CRC_', $ziphash} | 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/
|
|
|
|
|
|
|
|
# winget
|
2024-12-18 11:35:32 +08:00
|
|
|
# $wingetPackage = "lin-ycv.EverythingPowerToys"
|
|
|
|
# echo $wingetPackage $ver $exe $exehash $exeARM $exeARMhash
|
|
|
|
# rm -Path .\* -Recurse -Force
|
|
|
|
# git clone -b winget https://github.com/lin-ycv/EverythingPowerToys.git --depth 1
|
|
|
|
# Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
|
|
|
|
# cd .\EverythingPowerToys
|
|
|
|
# rm .git -Recurse -Force -Confirm:$false
|
|
|
|
# Get-ChildItem *.* -Recurse | ForEach { (Get-Content $_) | ForEach {$_ -Replace '_VERSION_', $ver} | ForEach {$_ -Replace '_URL_', $exe} | ForEach {$_ -Replace '_CRC_', $exehash} | ForEach {$_ -Replace '_armURL_', $exeARM} | ForEach {$_ -Replace '_armCRC_', $exeARMhash} | Set-Content $_ }
|
|
|
|
# ..\wingetcreate submit -p "New version: lin-ycv.EverythingPowerToys version $ver" -t ${{ secrets.EVERYTHINGPT }} .
|
2024-03-25 14:25:51 +08:00
|
|
|
|
2024-07-20 19:27:04 +08:00
|
|
|
# scoop
|
2024-07-20 21:37:08 +08:00
|
|
|
# cd ..
|
|
|
|
# git clone -b EverythingPowerToys https://github.com/lin-ycv/ScoopExtras.git --depth 1
|
|
|
|
# cd .\ScoopExtras\bucket
|
|
|
|
# gh repo sync lin-ycv/ScoopExtras -b master
|
|
|
|
# git pull
|
|
|
|
# rm everything-powertoys.json -Force
|
|
|
|
# Invoke-WebRequest https://github.com/lin-ycv/EverythingPowerToys/raw/scoop/everything-powertoys.json -OutFile everything-powertoys.json
|
|
|
|
# (Get-Content everything-powertoys.json) | ForEach-Object {$_ -Replace '_VERSION_', $ver} | ForEach-Object {$_ -Replace '_URL_', $zip} | ForEach-Object {$_ -Replace '_CRC_', $ziphash} | ForEach-Object {$_ -Replace '_armURL_', $zipARM} | ForEach-Object {$_ -Replace '_armCRC_', $zipARMhash} | Set-Content everything-powertoys.json
|
|
|
|
# git add .
|
|
|
|
# git commit -m "everything-powertoys@$ver : update"
|
|
|
|
# git push -f
|
|
|
|
# gh repo set-default ScoopInstaller/Extras
|
|
|
|
# gh pr create --base master --title "everything-powertoys@$ver : update" --body "- [X] I have read the [Contributing Guide](https://github.com/ScoopInstaller/.github/blob/main/.github/CONTRIBUTING.md)."
|