30 lines
810 B
PowerShell
30 lines
810 B
PowerShell
# This script is used to create a release package.
|
|
# Usage:
|
|
# $env:VERSION=<the_version_number> ; .\make-release-package.ps1
|
|
#
|
|
# So that a release package named VERSION.zip will be created.
|
|
#
|
|
|
|
# go to the release folder and create a output.zip
|
|
Set-Location .\bin\Release
|
|
zip output -r .
|
|
# go back to the root
|
|
Set-Location ..\..\
|
|
# delete the old output.zip if exists
|
|
if (Test-Path output.zip) {
|
|
Remove-Item output.zip
|
|
}
|
|
# move the new output.zip to the root
|
|
Move-Item .\bin\Release\output.zip .
|
|
# rename to $VERSION.zip if version is specified
|
|
if ($null -eq $env:VERSION) {
|
|
Write-Output "Version is not specified."
|
|
}
|
|
else {
|
|
# delete the old $VERSION.zip if exists
|
|
if(Test-Path "$env:VERSION.zip") {
|
|
Remove-Item "$env:VERSION.zip"
|
|
}
|
|
Move-Item output.zip "$env:VERSION.zip"
|
|
}
|