Update release script
This commit is contained in:
parent
c5da87b681
commit
d8eb04dc18
|
|
@ -3,23 +3,23 @@ $last = $manifest.latest
|
||||||
$current = (Get-Content package.json | ConvertFrom-Json).version
|
$current = (Get-Content package.json | ConvertFrom-Json).version
|
||||||
|
|
||||||
if ($last -eq $current) {
|
if ($last -eq $current) {
|
||||||
Write-Host "Latest version is $last. No need to publish." -ForegroundColor Green -BackgroundColor DarkMagenta
|
Write-Output "Latest version is $last. No need to publish." -ForegroundColor Green -BackgroundColor DarkMagenta
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
Install-Module PSGitHub -Force
|
Install-Module PSGitHub -Force
|
||||||
Write-Host "'PSGitHub' has been installed." -ForegroundColor Green
|
Write-Output "'PSGitHub' has been installed." -ForegroundColor Green
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
composer install --no-dev
|
composer install --no-dev
|
||||||
Remove-Item vendor/bin -Recurse -Force
|
Remove-Item vendor/bin -Recurse -Force
|
||||||
yarn
|
yarn
|
||||||
yarn build
|
yarn build
|
||||||
Write-Host "Dependencies have been installed." -ForegroundColor Green
|
Write-Output "Dependencies have been installed." -ForegroundColor Green
|
||||||
|
|
||||||
$zip = "blessing-skin-server-$current.zip"
|
$zip = "blessing-skin-server-$current.zip"
|
||||||
zip -9 -r $zip app bootstrap config database plugins public resources/lang resources/views resources/misc routes storage vendor .env.example artisan LICENSE README.md README_EN.md
|
zip -9 -r $zip app bootstrap config database plugins public resources/lang resources/views resources/misc routes storage vendor .env.example artisan LICENSE README.md README_EN.md
|
||||||
Write-Host "Zip archive is created." -ForegroundColor Green
|
Write-Output "Zip archive is created." -ForegroundColor Green
|
||||||
|
|
||||||
New-Item dist -ItemType Directory
|
New-Item dist -ItemType Directory
|
||||||
Set-Location dist
|
Set-Location dist
|
||||||
|
|
@ -28,7 +28,7 @@ Copy-Item -Path "../$zip" -Destination $zip
|
||||||
$manifest.latest = $current
|
$manifest.latest = $current
|
||||||
$manifest.url = $manifest.url.Replace($last, $current)
|
$manifest.url = $manifest.url.Replace($last, $current)
|
||||||
ConvertTo-Json $manifest | Out-File -FilePath update_2.json
|
ConvertTo-Json $manifest | Out-File -FilePath update_2.json
|
||||||
Write-Host "Update source is prepared." -ForegroundColor Green
|
Write-Output "Update source is prepared." -ForegroundColor Green
|
||||||
|
|
||||||
$azureToken = $env:AZURE_TOKEN
|
$azureToken = $env:AZURE_TOKEN
|
||||||
git config --global user.email 'g-plane@hotmail.com'
|
git config --global user.email 'g-plane@hotmail.com'
|
||||||
|
|
@ -37,7 +37,7 @@ git init
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Publish"
|
git commit -m "Publish"
|
||||||
git push -f "https://anything:$azureToken@dev.azure.com/blessing-skin/Blessing%20Skin%20Server/_git/Blessing%20Skin%20Server" master
|
git push -f "https://anything:$azureToken@dev.azure.com/blessing-skin/Blessing%20Skin%20Server/_git/Blessing%20Skin%20Server" master
|
||||||
Write-Host "Update source is pushed to Azure Repos." -ForegroundColor Green
|
Write-Output "Update source is pushed to Azure Repos." -ForegroundColor Green
|
||||||
|
|
||||||
$githubToken = $env:GITHUB_TOKEN | ConvertTo-SecureString -AsPlainText -Force
|
$githubToken = $env:GITHUB_TOKEN | ConvertTo-SecureString -AsPlainText -Force
|
||||||
$enChangelog = Get-Content "../resources/misc/changelogs/en/$current.md"
|
$enChangelog = Get-Content "../resources/misc/changelogs/en/$current.md"
|
||||||
|
|
@ -48,4 +48,4 @@ try {
|
||||||
} catch {
|
} catch {
|
||||||
# Do nothing.
|
# Do nothing.
|
||||||
}
|
}
|
||||||
Write-Host "New version $current is published!" -ForegroundColor Green -BackgroundColor DarkMagenta
|
Write-Output "New version $current is published!" -ForegroundColor Green -BackgroundColor DarkMagenta
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user