blessing-skin-plugins/publish.ps1

29 lines
927 B
PowerShell
Raw Normal View History

2019-07-31 15:47:41 +08:00
git config --global user.name 'Pig Fang'
git config --global user.email 'g-plane@hotmail.com'
2019-07-31 14:47:36 +08:00
2020-04-07 11:29:27 +08:00
$token = $env:GH_TOKEN
2019-07-31 14:47:36 +08:00
Set-Location .dist
git add .
$shouldUpdate = git status -s
if ($shouldUpdate) {
2019-08-01 16:53:05 +08:00
git commit -m "Publish"
2020-04-07 11:45:54 +08:00
git remote set-url origin "https://tadaf:$token@github.com/bs-community/plugins-dist.git"
git push origin master
2019-07-31 14:47:36 +08:00
}
2019-12-07 09:59:20 +08:00
Set-Location '..'
$botRelease = (Invoke-WebRequest 'https://api.github.com/repos/bs-community/telegram-bot/releases/latest').Content | ConvertFrom-Json
$botBinUrl = ((Invoke-WebRequest $botRelease.assets_url).Content | ConvertFrom-Json).browser_download_url
bash -c "curl -fSL $botBinUrl -o bot"
chmod +x ./bot
./bot plugin updated.json
2020-04-18 22:42:34 +08:00
foreach ($lang in 'en', 'zh_CN') {
2020-07-16 18:31:32 +08:00
Invoke-WebRequest "https://purge.jsdelivr.net/gh/bs-community/plugins-dist@latest/registry_$lang.json"
2020-04-18 22:42:34 +08:00
}
2020-07-16 18:31:32 +08:00
Invoke-WebRequest 'https://purge.jsdelivr.net/gh/bs-community/plugins-dist@latest/registry.json'