Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build pipelines to generate framework package #300

Merged
merged 4 commits into from
Feb 12, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions build/AzurePipelinesTemplates/MUX-BuildDevProject-Steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
steps:
- template: MUX-BuildProject-Steps.yml
parameters:
solutionPath: MUXControls.sln
nugetConfigPath: nuget.config
appxPackageDir: $(appxPackageDir)
buildOutputDir: $(buildOutputDir)
publishDir: $(publishDir)

- script: |
call %Build_SourcesDirectory%\tools\MakeAppxHelper.cmd %BUILDPLATFORM% %BUILDCONFIGURATION% -builddate_yymm %BUILDDATE_YYMM% -builddate_dd $BUILDDATE_DD% -subversion %BUILDREVISION%
if %ERRORLEVEL% NEQ 0 (
echo ##vso[task.logissue type=error;] Make AppxHelper failed with exit code %ERRORLEVEL%
goto END
)
displayName: 'Make FrameworkPackage'
2 changes: 2 additions & 0 deletions build/AzurePipelinesTemplates/MUX-BuildProject-Steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ parameters:
appxPackageDir: '$(build.artifactStagingDirectory)\$(buildConfiguration)\$(buildPlatform)\AppxPackages'

steps:
- template: MUX-PopulateBuildDateAndRevision-Steps.yml

- script: |
echo parameters.solutionPath = '${{ parameters.solutionPath }}'
echo parameters.nugetConfigPath = '${{ parameters.nugetConfigPath }}'
Expand Down
17 changes: 3 additions & 14 deletions build/AzurePipelinesTemplates/MUX-CreateNugetPackage-Job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,15 @@ jobs:
- ${{ parameters.dependsOn }}

steps:
# Extract the build revision number from Build.BuildNumber. This is needed to pass to build-nupkg.
# This relies on the format of the pipeline name being of the format: $(date:yyMM).$(date:dd)$(rev:rrr)
# We can't use those variables here (they only work in the *name* of the top level Yaml), so
# pull them out here and set the variables for use in the nuget package version.
- powershell: |
$yymm = $env:BUILD_BUILDNUMBER.substring($env:BUILD_BUILDNUMBER.length - 10, 4)
$dd = $env:BUILD_BUILDNUMBER.substring($env:BUILD_BUILDNUMBER.length - 5, 2)
$revision = $env:BUILD_BUILDNUMBER.substring($env:BUILD_BUILDNUMBER.length - 3, 3)
Write-Host "##vso[task.setvariable variable=builddate]$yymm$dd"
Write-Host "##vso[task.setvariable variable=buildrevision]$revision"
displayName: 'Get build revision number'
- template: MUX-PopulateBuildDateAndRevision-Steps.yml

- script: |
echo parameters.jobName '${{ parameters.jobName }}'
echo parameters.buildOutputDir '${{ parameters.buildOutputDir }}'
echo parameters.nupkgdir '${{ parameters.nupkgdir }}'
echo parameters.publishPath '${{ parameters.publishPath }}'
echo buildrevision=$(buildrevision)
echo buildrevision=$(builddate)
echo builddate=$(builddate)
displayName: 'CreateNugetPackage: Display parameters'

- task: DownloadBuildArtifacts@0
Expand All @@ -54,9 +44,8 @@ jobs:
-prereleaseversion prerelease
-DateOverride '$(builddate)'
-Subversion '$(buildrevision)'
-SkipFrameworkPackage
-BuildArch ${{ parameters.primaryBuildArch }}
-BuildFlavor ${{ parameters.buildFlavor }}
-BuildFlavor ${{ parameters.buildFlavor }}

- task: PublishBuildArtifacts@1
displayName: 'Publish artifact: nupkg'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
steps:
# Extract the build revision number from Build.BuildNumber. This is needed to pass to build-nupkg.
# This relies on the format of the pipeline name being of the format: $(date:yyMM).$(date:dd)$(rev:rrr)
# We can't use those variables here (they only work in the *name* of the top level Yaml), so
# pull them out here and set the variables for use in the nuget package version.
- powershell: |
$yymm = $env:BUILD_BUILDNUMBER.substring($env:BUILD_BUILDNUMBER.length - 10, 4)
$dd = $env:BUILD_BUILDNUMBER.substring($env:BUILD_BUILDNUMBER.length - 5, 2)
$revision = $env:BUILD_BUILDNUMBER.substring($env:BUILD_BUILDNUMBER.length - 3, 3)
Write-Host "##vso[task.setvariable variable=builddate]$yymm$dd"
Write-Host "##vso[task.setvariable variable=builddate_yymm]$yymm"
Write-Host "##vso[task.setvariable variable=builddate_dd]$dd"
Write-Host "##vso[task.setvariable variable=buildrevision]$revision"

Write-Host builddate=$yymm$dd
Write-Host builddate_yymm=$yymm
Write-Host builddate_dd=$dd
Write-Host buildrevision=$revision
displayName: 'Get build revision number'
13 changes: 13 additions & 0 deletions build/AzurePipelinesTemplates/MUX-PublishDevProject-Steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
steps:
- task: powershell@2
displayName: 'Copy files to staging dir'
inputs:
targetType: filePath
filePath: build\CopyFilesToStagingDir.ps1
arguments: -BuildOutputDir '$(buildOutputDir)' -PublishDir '$(Build.ArtifactStagingDirectory)' -Platform '$(buildPlatform)' -Configuration '$(buildConfiguration)'

- task: PublishBuildArtifacts@1
displayName: 'Publish artifact: drop'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'drop'
1 change: 1 addition & 0 deletions build/CopyFilesToStagingDir.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ PublishFile $FullBuildOutput\Microsoft.UI.Xaml\sdk\Microsoft.UI.Xaml.winmd $Full
PublishFile $FullBuildOutput\Microsoft.UI.Xaml\Generic.xaml $FullPublishDir\Microsoft.UI.Xaml\
PublishFile -IfExists $FullBuildOutput\Microsoft.UI.Xaml.Design\Microsoft.UI.Xaml.Design.dll $FullPublishDir\Microsoft.UI.Xaml.Design\
PublishFile -IfExists $BuildOutputDir\$Configuration\AnyCPU\MUXControls.Test.TAEF\MUXControls.Test.dll $FullPublishDir\Test\
PublishFile $FullBuildOutput\FrameworkPackage\*.appx $FullPublishDir\FrameworkPackage

# Publish pdbs:
$symbolsOutputDir = "$($FullPublishDir)\Symbols\"
Expand Down
29 changes: 19 additions & 10 deletions build/FrameworkPackage/MakeFrameworkPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Param(
[string]$Configuration,
[string]$Publisher = "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
[string]$VersionOverride,
[string]$Subversion = "000",
[int]$Subversion = "000",
[string]$builddate_yymm,
[string]$builddate_dd,
[string]$TestAppManifest,
[string]$WindowsSdkBinDir,
[string]$BasePackageName,
Expand Down Expand Up @@ -40,14 +42,8 @@ Copy-IntoNewDirectory FrameworkPackageContents\* $fullOutputPath\PackageContents

Copy-IntoNewDirectory PriConfig\* $fullOutputPath

if (!$WindowsSdkBinDir -and $env:WindowsSdkVerBinPath)
{
$WindowsSdkBinDir = "${env:WindowsSdkVerBinPath}\x86"
}
else
{
$WindowsSdkBinDir = "${env:ProgramFiles(x86)}\Windows Kits\10\bin\x86"
}
$KitsRoot10 = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots" -Name KitsRoot10).KitsRoot10
$WindowsSdkBinDir = Join-Path $KitsRoot10 "bin\x86"

$scriptDirectory = Split-Path -Path $script:MyInvocation.MyCommand.Path -Parent

Expand Down Expand Up @@ -142,6 +138,7 @@ Write-Verbose "CustomProps = $customProps, VersionMajor = '$versionMajor', Versi
Exit 1
}


$pstZone = [System.TimeZoneInfo]::FindSystemTimeZoneById("Pacific Standard Time")
$pstTime = [System.TimeZoneInfo]::ConvertTimeFromUtc((Get-Date).ToUniversalTime(), $pstZone)
# Split version into yyMM.dd because appx versions can't be greater than 65535
Expand All @@ -158,7 +155,19 @@ Write-Verbose "CustomProps = $customProps, VersionMajor = '$versionMajor', Versi
$versionMinor = ""
}

$version = "${versionMajor}.${versionMinor}" + ($pstTime).ToString("yyMM") + "." + ($pstTime).ToString("dd").TrimStart("0") + "$subversion.0"
if (-not $builddate_yymm)
{
$builddate_yymm = ($pstTime).ToString("yyMM")
}
if (-not $builddate_dd)
{
$builddate_dd = ($pstTime).ToString("dd")
}

# Pad subversion up to 3 digits
$subversionPadded = $subversion.ToString("000")

$version = "${versionMajor}.${versionMinor}" + $builddate_yymm + "." + $builddate_dd.TrimStart("0") + "$subversionPadded.0"

Write-Verbose "Version = $version"
}
Expand Down
23 changes: 3 additions & 20 deletions build/MUX-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,9 @@ jobs:
value: $(Build.ArtifactStagingDirectory)

steps:
- template: AzurePipelinesTemplates\MUX-BuildProject-Steps.yml
parameters:
solutionPath: MUXControls.sln
nugetConfigPath: nuget.config
appxPackageDir: $(appxPackageDir)
buildOutputDir: $(buildOutputDir)
publishDir: $(publishDir)

- task: powershell@2
displayName: 'Copy files to staging dir'
inputs:
targetType: filePath
filePath: build\CopyFilesToStagingDir.ps1
arguments: -BuildOutputDir '$(buildOutputDir)' -PublishDir '$(Build.ArtifactStagingDirectory)' -Platform '$(buildPlatform)' -Configuration '$(buildConfiguration)'

- task: PublishBuildArtifacts@1
displayName: 'Publish artifact: drop'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'drop'
- template: AzurePipelinesTemplates\MUX-BuildDevProject-Steps.yml

- template: AzurePipelinesTemplates\MUX-PublishDevProject-Steps.yml

# Create Nuget Package
- template: AzurePipelinesTemplates\MUX-CreateNugetPackage-Job.yml
Expand Down
23 changes: 3 additions & 20 deletions build/MUX-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,9 @@ jobs:
value: $(Build.ArtifactStagingDirectory)

steps:
- template: AzurePipelinesTemplates\MUX-BuildProject-Steps.yml
parameters:
solutionPath: MUXControls.sln
nugetConfigPath: nuget.config
appxPackageDir: $(appxPackageDir)
buildOutputDir: $(buildOutputDir)
publishDir: $(publishDir)

- task: powershell@2
displayName: 'Copy files to staging dir'
inputs:
targetType: filePath
filePath: build\CopyFilesToStagingDir.ps1
arguments: -BuildOutputDir '$(buildOutputDir)' -PublishDir '$(publishDir)' -Platform '$(buildPlatform)' -Configuration '$(buildConfiguration)'

- task: PublishBuildArtifacts@1
displayName: 'Publish artifact: drop'
inputs:
PathtoPublish: '$(publishDir)'
artifactName: 'drop'
- template: AzurePipelinesTemplates\MUX-BuildDevProject-Steps.yml

- template: AzurePipelinesTemplates\MUX-PublishDevProject-Steps.yml

# Create Nuget Package
- template: AzurePipelinesTemplates\MUX-CreateNugetPackage-Job.yml
Expand Down
21 changes: 2 additions & 19 deletions build/MUX-Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,7 @@ jobs:
branchVersion: true
nugetVer: true

- template: AzurePipelinesTemplates\MUX-BuildProject-Steps.yml
parameters:
solutionPath: MUXControls.sln
nugetConfigPath: nuget.config
appxPackageDir: $(appxPackageDir)
buildOutputDir: $(buildOutputDir)
publishDir: $(publishDir)
- template: AzurePipelinesTemplates\MUX-BuildDevProject-Steps.yml

- task: PkgESCodeSign@10
displayName: CodeSign
Expand All @@ -66,18 +60,7 @@ jobs:
inputs:
filename: '$(Build.SourcesDirectory)\tools\PublishSymbols\PublishSymbols.cmd'

- task: powershell@2
displayName: 'Copy files to staging dir'
inputs:
targetType: filePath
filePath: build\CopyFilesToStagingDir.ps1
arguments: -BuildOutputDir '$(buildOutputDir)' -PublishDir '$(Build.ArtifactStagingDirectory)' -Platform '$(buildPlatform)' -Configuration '$(buildConfiguration)'

- task: PublishBuildArtifacts@1
displayName: 'Publish artifact: drop'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'drop'
- template: AzurePipelinesTemplates\MUX-PublishDevProject-Steps.yml

# Create Nuget Package
- template: AzurePipelinesTemplates\MUX-CreateNugetPackage-Job.yml
Expand Down
8 changes: 6 additions & 2 deletions build/NuSpecs/build-nupkg.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,14 @@ Write-Host $NugetCmdLine
Invoke-Expression $NugetCmdLine
if ($lastexitcode -ne 0)
{
Exit $lastexitcode;
Write-Host "Nuget returned $lastexitcode"
Exit $lastexitcode;
}

Write-Host
Write-Host "SkipFrameworkPackage = $SkipFrameworkPackage"
Write-Host

if(-not $SkipFrameworkPackage)
{
# Nuget package with framework package encapsulation
Expand All @@ -162,8 +166,8 @@ if(-not $SkipFrameworkPackage)
Invoke-Expression $NugetCmdLine
if ($lastexitcode -ne 0)
{
Exit $lastexitcode;
Write-Host "Nuget returned $lastexitcode"
Exit $lastexitcode;
}
}

Expand Down