Changed build to generate UNSTABLE files when the build in major.minor.build.revision is odd. Currently we are building 1.2.0 which will result in an unstable. When we change the version to 1.2.1 in AppVeyor we get releases.

This commit is contained in:
RKrom 2014-06-17 14:20:00 +02:00
commit 9bed298611
4 changed files with 20 additions and 10 deletions

View file

@ -5,7 +5,7 @@ Apply text and shapes to the screenshot. Offers capture of window, region or ful
CHANGE LOG:
@DETAILVERSION@ UNSTABLE
@DETAILVERSION@
Features:
* Feature #184,#282,#486: Image editor now has a Speech bubble

View file

@ -1,6 +1,6 @@
[Format]
Type=PortableApps.comFormat
Version=@VERSION@
Version=2.0
[Details]
Name=Greenshot Portable
@ -22,14 +22,14 @@ EULAVersion=true
[Version]
PackageVersion=@DETAILVERSION@
DisplayVersion=@VERSION@
DisplayVersion=@FILEVERSION@
[SpecialPaths]
Plugins=NONE
[Dependencies]
UsesJava=false
UsesDotNetVersion=4.5
UsesDotNetVersion=3.5
[Control]
Icons=1

View file

@ -1,6 +1,6 @@
#define ExeName "Greenshot"
#define Version "@VERSION@"
#define DetailVersion "@DETAILVERSION@"
#define FileVersion "@FILEVERSION@"
; Include the scripts to install .NET Framework
; See http://www.codeproject.com/KB/install/dotnetfx_innosetup_instal.aspx
@ -122,7 +122,7 @@ InfoBeforeFile=..\additional_files\readme.txt
LicenseFile=..\additional_files\license.txt
LanguageDetectionMethod=uilanguage
MinVersion=0,5.01.2600
OutputBaseFilename={#ExeName}-INSTALLER-{#Version}
OutputBaseFilename={#ExeName}-INSTALLER-{#FileVersion}
OutputDir=..\
PrivilegesRequired=none
SetupIconFile=..\..\icons\applicationIcon\icon.ico

View file

@ -24,7 +24,17 @@
$version=$env:APPVEYOR_BUILD_VERSION
$gitcommit=$env:APPVEYOR_REPO_COMMIT
$gitcommit=$gitcommit.SubString(0, [math]::Min($gitcommit.Length, 6))
$detailversion=$version + '-' + $gitcommit
$release=(([version]$version).build) % 2 -eq 1
$fileversion=$version
# Add the UNSTABLE, if we aren't a release -> the build is even. (major.minor.build.revision)
if ( ! $release) {
$fileversion=$version + "-UNSTABLE"
$detailversion=$detailversion + " UNSTABLE"
} else {
$detailversion=$detailversion + " Release"
}
Write-Host "Building Greenshot $detailversion"
# Create a MD5 string for the supplied filename
@ -49,7 +59,7 @@ Function FillTemplates {
# Create an empty array, this will contain the replaced lines
$newtext = @()
foreach ($line in $template) {
$newtext += $line -replace "\@VERSION\@", $version -replace "\@DETAILVERSION\@", $detailversion
$newtext += $line -replace "\@VERSION\@", $version -replace "\@DETAILVERSION\@", $detailversion -replace "\@FILEVERSION\@", $fileversion
}
# Write the new information to the file
$newtext | Set-Content $newfile -encoding UTF8
@ -132,8 +142,8 @@ Function PackageZip {
$destinstaller = "$destbase\NO-INSTALLER"
# Only remove the zip we are going to create, to prevent adding but keeping the history
if (Test-Path ("$destbase\Greenshot-NO-INSTALLER-$version.zip")) {
Remove-Item "$destbase\Greenshot-NO-INSTALLER-$version.zip" -Confirm:$false
if (Test-Path ("$destbase\Greenshot-NO-INSTALLER-$fileversion.zip")) {
Remove-Item "$destbase\Greenshot-NO-INSTALLER-$fileversion.zip" -Confirm:$false
}
# Remove the directory to create the files in
if (Test-Path ("$destinstaller")) {
@ -170,7 +180,7 @@ Function PackageZip {
$zipOutput = "$(get-location)\zip"
$zip7 = "$(get-location)\greenshot\tools\7zip\7za.exe"
$arguments = @('a', '-mx9', '-tzip', '-r', "$destbase\Greenshot-NO-INSTALLER-$version.zip", "$destinstaller\*")
$arguments = @('a', '-mx9', '-tzip', '-r', "$destbase\Greenshot-NO-INSTALLER-$fileversion.zip", "$destinstaller\*")
Write-Host "Starting $zip7 $arguments"
$zipResult = Start-Process -wait -PassThru "$zip7" -ArgumentList $arguments -NoNewWindow -RedirectStandardOutput "$zipOutput.log" -RedirectStandardError "$zipOutput.error"
Write-Host "Log output:"