-
-
Notifications
You must be signed in to change notification settings - Fork 72
51 lines (42 loc) · 2.2 KB
/
packageManagers.yml
File metadata and controls
51 lines (42 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Push updates to package managers
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
if: "!github.event.release.prerelease"
runs-on: windows-latest
steps:
- name: Config and Push
run: |
Install-Module Chocolatey-AU -Force
# Get Chocolatey manifests
git clone --filter=blob:none --no-checkout --depth 1 https://github.com/lin-ycv/chocolatey-pkgs.git
cd chocolatey-pkgs
git sparse-checkout set --cone
git sparse-checkout set .\manifests\everythingpowertoys
git checkout main
# Use Choco-AU to get the data
Install-Module Chocolatey-AU -Force
cd .\manifests\everythingpowertoys
$UpdateOutput = .\update.ps1
echo $Latest.Version $Latest.URL64 $Latest.Checksum64 $Latest.ARM64 $Latest.Checksuma64
# Chocolatey: Check (and Push)
$NupkgPath = (($UpdateOutput.Result | Where-Object {$_ -like '*.nupkg''*'}) -split "'")[1]
if ($NupkgPath){
Write-Output "Newer Version Available: push to Choco"
$ApiKey = '${{ secrets.CHOCOLATEY }}'
$ChocoServer = 'https://push.chocolatey.org/'
choco push $NupkgPath --source $ChocoServer --key $ApiKey
}
cd ..\..\..
# Winget
echo $Latest.Version $Latest.URL64e $Latest.Checksum64e $Latest.URLa64e $Latest.Checksuma64e
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_', $Latest.Version} | ForEach {$_ -Replace '_URL_', $Latest.URL64e} | ForEach {$_ -Replace '_CRC_', $Latest.Checksum64e} | ForEach {$_ -Replace '_armURL_', $Latest.URLa64e} | ForEach {$_ -Replace '_armCRC_', $Latest.Checksuma64e} | Set-Content $_ }
..\wingetcreate submit ".\\" -p "New version: EverythingPowerToys version $Latest.Version" -t ${{ secrets.EVERYTHINGPT }} .