blessing-skin-server/tools/release.ps1

34 lines
1.5 KiB
PowerShell
Raw Normal View History

2020-08-22 10:39:06 +08:00
$manifest = Invoke-WebRequest 'https://dev.azure.com/blessing-skin/51010f6d-9f99-40f1-a262-0a67f788df32/_apis/git/repositories/a9ff8df7-6dc3-4ff8-bb22-4871d3a43936/Items?path=%2Fupdate.json' | ConvertFrom-Json
2019-08-01 11:44:59 +08:00
$last = $manifest.latest
$current = (Get-Content package.json | ConvertFrom-Json).version
# Install dependencies
2020-10-30 10:04:51 +08:00
composer install --no-dev --prefer-dist --no-progress
2019-08-01 11:44:59 +08:00
Remove-Item vendor/bin -Recurse -Force
yarn
2019-08-01 14:47:48 +08:00
Write-Host "Dependencies have been installed." -ForegroundColor Green
2020-10-30 10:11:50 +08:00
./tools/build.ps1
2019-08-01 11:44:59 +08:00
$zip = "blessing-skin-server-$current.zip"
2021-02-17 10:25:54 +08:00
zip -9 -r $zip app bootstrap config database plugins public resources/lang resources/views resources/misc/textures routes storage vendor .env.example artisan LICENSE README.md README-zh.md index.html
2019-08-01 14:47:48 +08:00
Write-Host "Zip archive is created." -ForegroundColor Green
2019-08-01 11:44:59 +08:00
New-Item dist -ItemType Directory
Set-Location dist
Copy-Item -Path "../$zip" -Destination $zip
$manifest.latest = $current
$manifest.url = $manifest.url.Replace($last, $current)
2020-10-13 10:10:03 +08:00
$manifest.php = '7.4.0'
2020-07-16 18:35:03 +08:00
ConvertTo-Json $manifest | Out-File -FilePath update.json
2019-08-01 14:47:48 +08:00
Write-Host "Update source is prepared." -ForegroundColor Green
2019-08-01 11:44:59 +08:00
$azureToken = $env:AZURE_TOKEN
git config --global user.email 'g-plane@hotmail.com'
git config --global user.name 'Pig Fang'
git init
git add .
git commit -m "Publish"
git push -f "https://anything:$azureToken@dev.azure.com/blessing-skin/Blessing%20Skin%20Server/_git/Blessing%20Skin%20Server" master
2019-08-01 14:47:48 +08:00
Write-Host "Update source is pushed to Azure Repos." -ForegroundColor Green