From 8dc774bcd39a52d3905ed02a4ec6004abc86b718 Mon Sep 17 00:00:00 2001 From: RKrom Date: Mon, 3 Nov 2014 15:42:39 +0100 Subject: [PATCH] Added tag generation to the build script. --- build.ps1 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index 32293955e..f4fa0eef1 100644 --- a/build.ps1 +++ b/build.ps1 @@ -207,6 +207,25 @@ Function PackageInstaller { return } +# This function tags the current +Function TagCode { + Write-Host "Setting id_rsa with the content from environment rsakey so we can push a tag" + # Write the RSA key contents from the AppVeyor rsakey UI ENV variable to the private key file + $key = $env:rsakey + $fileContent = "-----BEGIN RSA PRIVATE KEY-----" + "`n" + for ($i = 0; $i -lt $key.Length / 64; $i++) { + $min = [math]::min(64, $key.Length - ($i * 64)); + $fileContent += $key.substring($i*64, $min) + "`n"; + } + $fileContent += "-----END RSA PRIVATE KEY-----" + "`n" + Set-Content c:\users\greenshot\.ssh\id_rsa $fileContent + Write-Host "Tagging repo with $fileversion" + git tag -a $fileversion -m 'Build from AppVeyor' + Write-Host "Pushing tags to remote." + git push --tags + return +} + FillTemplates echo "Generating MD5" @@ -220,4 +239,7 @@ echo "Generating ZIP" PackageZip echo "Generating Portable" -PackagePortable \ No newline at end of file +PackagePortable + +echo "Tagging with $fileversion" +TagCode \ No newline at end of file