diff options
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/publish-packages.cmd | 40 | ||||
-rwxr-xr-x | buildscripts/publish-packages.sh | 33 | ||||
-rw-r--r-- | buildscripts/publish.proj | 20 | ||||
-rw-r--r-- | buildscripts/syncAzure.proj | 19 | ||||
-rw-r--r-- | buildscripts/updatePublishedVersions.ps1 | 26 |
5 files changed, 138 insertions, 0 deletions
diff --git a/buildscripts/publish-packages.cmd b/buildscripts/publish-packages.cmd new file mode 100644 index 000000000..633ff7199 --- /dev/null +++ b/buildscripts/publish-packages.cmd @@ -0,0 +1,40 @@ +@echo off +REM don't pass args to buildvars-setup, just get defaults +call %~dp0buildvars-setup.cmd + +set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" +if not exist %_msbuildexe% (set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe") +REM hopefully it's on the path +if not exist %_msbuildexe% set _msbuildexe=msbuild + +set AzureAccount= +set AzureToken= +set Container= + +:Arg_Loop +if "%1" == "" goto ArgsDone + +if /i "%1" == "-AzureAccount" (set AzureAccount=%2&shift&shift&goto Arg_Loop) +if /i "%1" == "-AzureToken" (set AzureToken=%2&shift&shift&goto Arg_Loop) +if /i "%1" == "-Container" (set Container=%2&shift&shift&goto Arg_Loop) + +echo Invalid command line argument: %1 +exit /b 1 +:ArgsDone + +set AzureToken=%AzureToken:"=% + +if "%AzureAccount%" == "" ( + echo Azure account not specified. + exit /b 1 +) +if "%AzureToken%" == "" ( + echo Azure token not specified. + exit /b 1 +) +if "%Container%" == "" ( + echo Azure container not specified. + exit /b 1 +) + +%_msbuildexe% %__ProjectDir%\buildscripts\publish.proj /p:CloudDropAccountName=%AzureAccount% /p:CloudDropAccessToken=%AzureToken% /p:ContainerName=%Container% /flp:v=diag;LogFile=publish-packages.log
\ No newline at end of file diff --git a/buildscripts/publish-packages.sh b/buildscripts/publish-packages.sh new file mode 100755 index 000000000..a1632ed15 --- /dev/null +++ b/buildscripts/publish-packages.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +export AzureAccount= +export AzureToken= +export Container= + +while [ "$1" != "" ]; do + lowerI="$(echo $1 | awk '{print tolower($0)}')" + case $lowerI in + -azureaccount) + shift + export AzureAccount=$1 + ;; + -azuretoken) + shift + export AzureToken=$1 + ;; + -container) + shift + export Container=$1 + ;; + *) + echo Bad argument $1 + exit 1 + esac + shift +done + +# don't pass args to buildvars-setup, just get defaults +scriptRoot="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +. $scriptRoot/buildvars-setup.sh + +$__ProjectRoot/Tools/msbuild.sh $scriptRoot/publish.proj /p:CloudDropAccountName=$AzureAccount /p:CloudDropAccessToken=$AzureToken /p:ContainerName=$Container "/flp:v=diag;LogFile=publish-packages.log"
\ No newline at end of file diff --git a/buildscripts/publish.proj b/buildscripts/publish.proj new file mode 100644 index 000000000..25731c681 --- /dev/null +++ b/buildscripts/publish.proj @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> + <Import Project="$(ToolsDir)PublishContent.targets" /> + <Import Project="$(ToolsDir)versioning.targets" /> + + <PropertyGroup> + <PublishPattern Condition="'$(PublishPattern)' == ''">$(PackageOutputRoot)**\*.nupkg</PublishPattern> + </PropertyGroup> + + <Target Name="CreateContainerName" + DependsOnTargets="CreateVersionFileDuringBuild" + Condition="'$(ContainerName)' == ''"> + <PropertyGroup> + <ContainerName>corert-$(PreReleaseLabel)-$(BuildNumberMajor)-$(BuildNumberMinor)</ContainerName> + </PropertyGroup> + </Target> + + <Target Name="Build" DependsOnTargets="CreateContainerName;UploadToAzure" /> +</Project>
\ No newline at end of file diff --git a/buildscripts/syncAzure.proj b/buildscripts/syncAzure.proj new file mode 100644 index 000000000..5e5c3bcc8 --- /dev/null +++ b/buildscripts/syncAzure.proj @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> + + <PropertyGroup> + <ContainerNamePrefix Condition="'$(ContainerNamePrefix)' == ''">corert-$(PreReleaseLabel)</ContainerNamePrefix> + <ContainerName Condition="'$(ContainerNamePrefix)' != '' and '$(BuildNumberMajor)' != '' and '$(BuildNumberMinor)' != ''">$(ContainerNamePrefix)-$(BuildNumberMajor)-$(BuildNumberMinor)</ContainerName> + <DownloadDirectory>$(PackagesDir)AzureTransfer</DownloadDirectory> + </PropertyGroup> + + <Import Project="$(ToolsDir)SyncCloudContent.targets" /> + + <Target Name="ValidateRequiredProperties"> + <Error Condition="'$(CloudDropAccountName)' == ''" Text="Missing property CloudDropAccountName." /> + <Error Condition="'$(CloudDropAccessToken)' == ''" Text="Missing property CloudDropAccessToken." /> + </Target> + + <Target Name="Build" DependsOnTargets="ValidateRequiredProperties;DownloadBlobsFromAzureTargets" /> +</Project>
\ No newline at end of file diff --git a/buildscripts/updatePublishedVersions.ps1 b/buildscripts/updatePublishedVersions.ps1 new file mode 100644 index 000000000..465bb4e70 --- /dev/null +++ b/buildscripts/updatePublishedVersions.ps1 @@ -0,0 +1,26 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +# This script updates the dotnet/versions repository based on a set of packages. It directly +# commits the changes using GitHub APIs. + +param( + [Parameter(Mandatory=$true)][string]$gitHubUser, + [Parameter(Mandatory=$true)][string]$gitHubEmail, + [Parameter(Mandatory=$true)][string]$gitHubAuthToken, + [Parameter(Mandatory=$true)][string]$versionsRepoOwner, + [Parameter(Mandatory=$true)][string]$versionsRepo, + [Parameter(Mandatory=$true)][string]$versionsRepoPath, + # A pattern matching all packages in the set that the versions repository should be set to. + [Parameter(Mandatory=$true)][string]$nupkgPath) + +msbuild /t:UpdatePublishedVersions ` + /p:GitHubUser="$gitHubUser" ` + /p:GitHubEmail="$gitHubEmail" ` + /p:GitHubAuthToken="$gitHubAuthToken" ` + /p:VersionsRepoOwner="$versionsRepoOwner" ` + /p:VersionsRepo="$versionsRepo" ` + /p:VersionsRepoPath="$versionsRepoPath" ` + /p:ShippedNuGetPackageGlobPath="$nupkgPath"
\ No newline at end of file |