Updating build to use Azure DevOps.

This commit is contained in:
Katy Shimizu 2023-01-09 16:49:03 -08:00
Родитель 23de1c1df9
Коммит 9f4876542d
28 изменённых файлов: 423 добавлений и 162 удалений

Просмотреть файл

@ -1,27 +1,28 @@
param (
[string[]]$projects = @(),
[string]$buildNumber,
[string]$packageSuffix = "0",
[bool]$isLocal = $false,
[string]$outputDirectory = "..\..\buildoutput"
[bool]$signPackages = $false,
[string]$outputDirectory = (Join-Path -Path $PSScriptRoot -ChildPath "buildoutput"),
[bool]$skipAssemblySigning = $false
)
if ($null -eq $buildNumber) {
throw 'Parameter $buildNumber cannot be null or empty. Exiting script.'
}
if ($isLocal){
$packageSuffix = "dev" + [datetime]::UtcNow.Ticks.ToString()
Write-Host "Local build - setting package suffixes to $packageSuffix" -ForegroundColor Yellow
}
dotnet --version
dotnet build -v q
dotnet build -v m
if (-not $?) { exit 1 }
$projects =
"WebJobs.Extensions",
"WebJobs.Extensions.CosmosDB",
"WebJobs.Extensions.Http",
"WebJobs.Extensions.Twilio",
"WebJobs.Extensions.Timers.Storage"
"WebJobs.Extensions.SendGrid"
foreach ($project in $projects)
{
$cmd = "pack", "src\$project\$project.csproj", "-o", $outputDirectory, "--no-build"
@ -31,13 +32,10 @@ foreach ($project in $projects)
$cmd += "--version-suffix", "-$packageSuffix"
}
& dotnet $cmd
& { dotnet $cmd }
}
### Sign package if build is not a PR
$shouldPackage = -not $env:APPVEYOR_PULL_REQUEST_NUMBER -or $env:APPVEYOR_PULL_REQUEST_TITLE.Contains("[pack]")
if ($shouldPackage) {
& ".\tools\RunSigningJob.ps1"
if ($signPackages) {
& { .\tools\RunSigningJob.ps1 -artifactDirectory $outputDirectory -buildNumber $buildNumber -skipAssemblySigning $skipAssemblySigning }
if (-not $?) { exit 1 }
}

Просмотреть файл

@ -1,9 +1,16 @@
Azure WebJobs SDK Extensions
===
##### Main Build
|Branch|Status|
|---|---|
|main|[![Build status](https://ci.appveyor.com/api/projects/status/5mqrok4j3l89cnvx/branch/main?svg=true)](https://ci.appveyor.com/project/appsvc/azure-webjobs-sdk-extensions/branch/main)|
|dev|[![Build status](https://ci.appveyor.com/api/projects/status/5mqrok4j3l89cnvx/branch/dev?svg=true)](https://ci.appveyor.com/project/appsvc/azure-webjobs-sdk-extensions/branch/dev)|
|main|[![Build Status](https://azfunc.visualstudio.com/Azure%20Functions/_apis/build/status/Azure.azure-webjobs-sdk-extensions?branchName=main)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=69&branchName=main)|
|dev|[![Build Status](https://azfunc.visualstudio.com/Azure%20Functions/_apis/build/status/Azure.azure-webjobs-sdk-extensions?branchName=dev)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=69&branchName=dev)|
##### WebJobs.Extensions.CosmosDB
|Branch|Status|
|---|---|
|main|[![Build Status](https://azfunc.visualstudio.com/Azure%20Functions/_apis/build/status/Azure.azure-webjobs-sdk-extensions.CosmosDB?branchName=main)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=232&branchName=main)|
|dev|[![Build Status](https://azfunc.visualstudio.com/Azure%20Functions/_apis/build/status/Azure.azure-webjobs-sdk-extensions.CosmosDB?branchName=dev)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=232&branchName=dev)|
This repo contains binding extensions for the **Azure WebJobs SDK**. See the [Azure WebJobs SDK repo](https://github.com/Azure/azure-webjobs-sdk) for more information. The binding extensions in this repo are available as the **Microsoft.Azure.WebJobs.Extensions** [nuget package](http://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions). **Note**: some of the extensions in this repo (like SendGrid, etc.) live in their own separate nuget packages following a standard naming scheme (e.g. Microsoft.Azure.WebJobs.Extensions.SendGrid). Also note that some of the features discussed here or in the wiki may still be in **pre-release**. To access those features you may need to pull the very latest pre-release packages from our "nightlies" package feed ([instructions here](https://github.com/Azure/azure-webjobs-sdk/wiki/%22Nightly%22-Builds)).

Просмотреть файл

@ -1,40 +0,0 @@
version: '{build}'
init:
- ps: |
if ($env:FUNCTIONS_NIGHTLY -eq "1") {
$version = Get-Date -Format "yyyyMMdd-HHmm"
Update-AppveyorBuild -Version $version -Message "Functions Scheduled Build"
}
pull_requests:
do_not_increment_build_number: true
image: Visual Studio 2017
branches:
only:
- main
- dev
- next
clone_folder: c:\azure-webjobs-sdk-extensions
install:
- ps: >
$env:CommitHash = "$env:APPVEYOR_REPO_COMMIT"
.\dotnet-install.ps1 -Version 3.1.300 -Architecture x86
build_script:
- ps: |
$buildNumber = 0
$hasTag = Test-Path env:APPVEYOR_REPO_TAG_NAME
if (-not $hasTag) {
$buildNumber = $env:APPVEYOR_BUILD_NUMBER
Write-Host "No git tag found. Setting package suffix to '$buildNumber'"
}
if ($hasTag) {
$env:Configuration = "Release"
}
.\Build.ps1 -packageSuffix "$buildNumber"
test_script:
- ps: >-
.\run-tests.ps1
on_finish:
- ps: .\tools\PollSigningResults.ps1

Просмотреть файл

@ -1,17 +1,41 @@
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
parameters: # user-configurable parameters
- name: skip_assembly_signing
displayName: Skip Assembly Signing
type: boolean
default: false
pr:
branches:
include:
- main
- dev
paths:
exclude: # don't trigger builds for file changes matching these paths
- src/WebJobs.Extensions.CosmosDB/*
trigger:
- dev
branches:
include:
- main
- dev
paths:
exclude: # don't trigger builds for file changes matching these paths
- test/WebJobs.Extensions.CosmosDB.Tests/*
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Release'
steps:
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
extends:
template: build/pipelines/templates/ci.yml
parameters: # template parameters
skip_assembly_signing: ${{ parameters.skip_assembly_signing }}
target_projects:
- WebJobs.Extensions
- WebJobs.Extensions.Http
- WebJobs.Extensions.SendGrid
- WebJobs.Extensions.Timers.Storage
- WebJobs.Extensions.Twilio
# WebJobs.Extensions.CosmosDB is run by a separate pipeline defined in its src/ folder
target_tests:
- WebJobs.Extensions.Tests
- WebJobs.Extensions.Http.Tests
- WebJobs.Extensions.MobileApps.Tests
- WebJobs.Extensions.SendGrid.Tests
- WebJobs.Extensions.Twilio.Tests

Просмотреть файл

@ -21,8 +21,8 @@
<RepositoryType>git</RepositoryType>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageLicenseUrl>https://go.microsoft.com/fwlink/?linkid=2028464</PackageLicenseUrl>
<PackageIconUrl>https://raw.githubusercontent.com/Azure/azure-webjobs-sdk-extensions/dev/build/webjobs.png</PackageIconUrl>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageIcon>webjobs.png</PackageIcon>
<PackageTags>Microsoft Azure WebJobs AzureFunctions</PackageTags>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)..\src.ruleset</CodeAnalysisRuleSet>
<UseSourceLink Condition="$(UseSourceLink) == '' And $(CI) != ''">true</UseSourceLink>
@ -54,9 +54,14 @@
<!-- Write out the source file for this project to point at raw.githubusercontent.com -->
<WriteLinesToFile File="$(BaseIntermediateOutputPath)source_link.json" Overwrite="true" Lines='{"documents": { "$(SourceLinkRoot)\\*" : "$(RemoteUri.Replace(".git", "").Replace("github.com", "raw.githubusercontent.com"))/$(LatestCommit)/*" }}' />
</Target>
<ItemGroup>
<AdditionalFiles Include="$(SolutionDir)\stylecop.json" Link="stylecop.json" />
<None Include="$(MSBuildThisFileDirectory)..\build\webjobs.png" Pack="true" PackagePath="\"/>
<None Include="$(MSBuildThisFileDirectory)..\LICENSE.txt" Pack="true" PackagePath=""/>
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)..\stylecop.json" Link="stylecop.json" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -0,0 +1,33 @@
# Adapted from https://github.com/Azure/azure-functions-host/blob/a4a3ba51fe291c546de0e1f578c7352a83203ca2/build/initialize-pipeline.ps1
$buildReason = $env:BUILD_REASON
$sourceBranch = $env:BUILD_SOURCEBRANCH
$isPr = ($buildReason -eq "PullRequest")
function GetPrTitle() {
$prTitle = ""
if ($isPr) {
$response = Invoke-RestMethod api.github.com/repos/$env:BUILD_REPOSITORY_ID/pulls/$env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
$prTitle = $response.title.ToLowerInvariant()
Write-Host "Pull request '$prTitle'"
}
else
{
Write-Host "Build not triggered by a PR; no title."
}
return $prTitle
}
Write-Host "BUILD_REASON: '$buildReason'"
Write-Host "BUILD_SOURCEBRANCH: '$sourceBranch'"
$prTitle = GetPrTitle
$signPackages = $false
if ((-not $isPr) -or ($prTitle.Contains("[pack]"))) {
Write-Host "Package signing conditions met."
$signPackages = $true
}
Write-Host "Setting 'SignPackages' to $signPackages"
Write-Host "##vso[task.setvariable variable=SignPackages;isOutput=true]$signPackages"

Просмотреть файл

@ -0,0 +1,126 @@
## CAUTION: Changing this template will affect all pipelines that extend it.
parameters:
- name: skip_assembly_signing
displayName: Skip Assembly Signing
type: boolean
default: false
- name: target_projects
displayName: Projects To Build
type: object
default: []
- name: target_tests
displayName: Test Projects
type: object
default: []
variables:
- template: variables.yml
- name: targetProjects
value: ${{ join(';',parameters.target_projects) }}
- name: targetTests
value: ${{ join(';',parameters.target_tests) }}
jobs:
- job: InitializePipeline
pool:
name: '1ES-Hosted-AzFunc'
demands:
- ImageOverride -equals MMS2019TLS
steps:
- task: 1ESHostedPoolValidation@1
- task: PowerShell@2
displayName: 'Initialize'
name: Initialize
inputs:
filePath: '$(Build.Repository.LocalPath)\build\initialize-pipeline.ps1'
## checks the PR title for inline commands, e.g. [pack]
- job: BuildAndTest
pool:
name: '1ES-Hosted-AzFunc'
demands:
- ImageOverride -equals MMS2019TLS
dependsOn: InitializePipeline
condition: succeeded()
variables:
signPackages: $[ dependencies.InitializePipeline.outputs['Initialize.SignPackages'] ]
steps:
- task: 1ESHostedPoolValidation@1
- pwsh: |
$packageSuffix = 0
if (-not $$(hasTag)) {
$packageSuffix = $(buildNumber)
Write-Host "No git tag found. Setting package suffix to '$packageSuffix'"
}
if ($$(hasTag)) {
$config = "Release"
Write-Host "Git tag found. Setting Configuration to '$config'"
$env:Configuration = $config
echo "##vso[task.setvariable variable=Configuration]$config" # let downstream tasks read this variable
}
$projectsArray = "$(targetProjects)" -split ";"
Write-Host "Building projects:"
Write-Host $projectsArray -separator "`n"
.\Build.ps1 -projects $projectsArray -buildNumber "$(buildNumber)" -packageSuffix "$packageSuffix" -outputDirectory "$(buildOutputDirectory)" -signPackages $$(signPackages) -skipAssemblySigning $${{ parameters.skip_assembly_signing }}
displayName: "Build source"
env:
CommitHash: $(Build.SourceVersion)
FILES_ACCOUNT_NAME: $(FilesAccountName)
FILES_ACCOUNT_KEY: $(FilesAccountKey)
## This task also optionally signs the packages
- pwsh: |
$testsArray = "$(targetTests)" -split ";"
Write-Host "Running tests:"
Write-Host $testsArray -separator "`n"
.\run-tests.ps1 -tests $testsArray
displayName: "Run tests"
## requires env:Configuration be set to report test results
env:
AzureWebJobsStorage: $(Storage)
AzureWebJobsDashboard: $(Storage)
AzureWebJobsCosmosDBConnectionString: $(CosmosDB)
ConnectionStrings:CosmosDB: $(CosmosDB)
- task: PublishTestResults@2
displayName: "Publish XUnit test results"
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '**/TEST.xml'
mergeTestResults: true
buildConfiguration: $(Configuration)
testRunTitle: 'XUnit Tests'
condition: always()
- pwsh: |
if ($$(signPackages))
{
Write-Host "Package signing enabled for this build. Retrieving signed files."
.\tools\PollSigningResults.ps1 -buildNumber "$(buildNumber)" -artifactDirectory "$(buildOutputDirectory)" -skipAssemblySigning $${{ parameters.skip_assembly_signing }}
}
else
{
Write-Host "Package signing conditions not met for this build."
}
displayName: "Poll signing results"
env:
FILES_ACCOUNT_NAME: $(FilesAccountName)
FILES_ACCOUNT_KEY: $(FilesAccountKey)
- task: ManifestGeneratorTask@0
displayName: "SBOM Generation"
inputs:
BuildDropPath: '$(buildOutputDirectory)'
Verbosity: 'Information'
- publish: '$(buildOutputDirectory)'
artifact: drop

Просмотреть файл

@ -0,0 +1,16 @@
## CAUTION: Changing these variables will affect all pipelines that extend this template (by way of ci.yml)
variables:
- group: 'WebJobs SDK Extensions Testing'
- group: 'Funkins Signing'
- name: buildNumber
value: $[ counter('constant', 11000) ]
- name: buildOutputDirectory
value: '$(System.DefaultWorkingDirectory)\buildoutput'
- name: IncludeBuildNumberInVersion
value: ${{ 0 }}
- name: isPr
value: $[ eq('$(Build.Reason)', 'PullRequest') ]
- name: hasTag
value: $[ startsWith('$(Build.SourceBranch)', 'refs/tag/') ]
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: ${{ true }}

Просмотреть файл

@ -1,14 +1,27 @@
function RunTest([string] $project, [string] $description,[bool] $skipBuild = $false, $filter = $null) {
Write-Host "Running test: $description" -ForegroundColor DarkCyan
param(
[string[]]$tests = @()
)
function RunTest([string]$project, [bool]$skipBuild = $false, [string]$filter = $null) {
Write-Host "Running test: $project" -ForegroundColor DarkCyan
Write-Host "-----------------------------------------------------------------------------" -ForegroundColor DarkCyan
Write-Host
$cmdargs = "test", ".\test\$project\", "-v", "q"
if ($filter) {
$cmdargs += "--filter", "$filter"
$cmdargs = "test", ".\test\$project\$project.csproj", "-v", "m", "--logger", "trx;LogFileName=TEST.xml"
if ($null -ne $env:Configuration)
{
Write-Host "Adding: --configuration $config"
$cmdargs += "--configuration", "$config"
}
if ($filter) {
Write-Host "Adding: --filter $filter"
$cmdargs += "--filter", "$filter"
}
Write-Host "Final command: 'dotnet $cmdargs'"
# We'll always rebuild for now.
# if ($skipBuild){
# $cmdargs += "--no-build"
@ -27,15 +40,10 @@ function RunTest([string] $project, [string] $description,[bool] $skipBuild = $f
return $r
}
$tests = @(
@{project ="WebJobs.Extensions.Tests"; description="Core extension Tests"},
@{project ="WebJobs.Extensions.Http.Tests"; description="HTTP extension tests"},
@{project ="WebJobs.Extensions.CosmosDB.Tests"; description="CosmosDB extension tests"},
@{project ="WebJobs.Extensions.MobileApps.Tests"; description="Mobile Apps extension tests"},
@{project ="WebJobs.Extensions.SendGrid.Tests"; description="SendGrid extension tests"},
@{project ="WebJobs.Extensions.Twilio.Tests"; description="Twilio extension tests"}
)
if ((-not $tests) -or ($tests.Count -lt 1))
{
throw "No test projects specified to run. Exiting script."
}
$success = $true
$testRunSucceeded = $true
@ -46,9 +54,12 @@ Write-Host "Current TimeZone: '$originalTZ'"
Set-TimeZone -Name "Pacific Standard Time"
$currentTZ = Get-TimeZone
Write-Host "Changing TimeZone for Timer tests. Now '$currentTZ'"
Write-Host "Environment setting Configuration is '$env:Configuration'."
dotnet --version
foreach ($test in $tests){
$testRunSucceeded = RunTest $test.project $test.description $testRunSucceeded $test.filter
$testRunSucceeded = RunTest $test $testRunSucceeded
$success = $testRunSucceeded -and $success
}

Просмотреть файл

@ -2,7 +2,7 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<NoWarn>$(NoWarn);8002</NoWarn>
<DocumentationFile></DocumentationFile>
@ -42,7 +42,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -25,6 +25,6 @@
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.1.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,40 @@
parameters: # user-configurable parameters
- name: skip_assembly_signing
displayName: Skip Assembly Signing
type: boolean
default: false
pr:
branches:
include:
- main
- dev
paths:
exclude: # don't trigger builds for file changes matching these paths
- src/WebJobs.Extensions.Http/*
- src/WebJobs.Extensions.MobileApps/*
- src/WebJobs.Extensions.SendGrid/*
- src/WebJobs.Extensions.Timers.Storage/*
- src/WebJobs.Extensions.Twilio/*
trigger:
branches:
include:
- main
- dev
paths:
exclude: # don't trigger builds for file changes matching these paths
- test/WebJobs.Extensions.Http.Tests/*
- test/WebJobs.Extensions.MobileApps.Tests/*
- test/WebJobs.Extensions.SendGrid.Tests/*
- test/WebJobs.Extensions.Timers.Storage.Tests/*
- test/WebJobs.Extensions.Twilio.Tests/*
extends:
template: ../../build/pipelines/templates/ci.yml
parameters: # template parameters
skip_assembly_signing: ${{ parameters.skip_assembly_signing }}
target_projects:
- WebJobs.Extensions.CosmosDB
target_tests:
- WebJobs.Extensions.CosmosDB.Tests

Просмотреть файл

@ -38,7 +38,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -25,7 +25,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -25,7 +25,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -31,7 +31,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -26,7 +26,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -26,7 +26,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<AssemblyName>Microsoft.Azure.WebJobs.Extensions.CosmosDB.Tests</AssemblyName>
<RootNamespace>Microsoft.Azure.WebJobs.Extensions.CosmosDB.Tests</RootNamespace>
@ -31,7 +31,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<AssemblyName>Microsoft.Azure.WebJobs.Extensions.Http.Tests</AssemblyName>
<RootNamespace>Microsoft.Azure.WebJobs.Extensions.Http.Tests</RootNamespace>
@ -35,7 +35,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<AssemblyName>Microsoft.Azure.WebJobs.Extensions.MobileApps.Tests</AssemblyName>
<RootNamespace>Microsoft.Azure.WebJobs.Extensions.MobileApps.Tests</RootNamespace>
@ -31,7 +31,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<AssemblyName>Microsoft.Azure.WebJobs.Extensions.SendGrid.Tests</AssemblyName>
<RootNamespace>Microsoft.Azure.WebJobs.Extensions.SendGrid.Tests</RootNamespace>
@ -30,7 +30,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<AssemblyName>Microsoft.Azure.WebJobs.Extensions.Tests.Common</AssemblyName>
<RootNamespace>Microsoft.Azure.WebJobs.Extensions.Tests.Common</RootNamespace>
@ -32,7 +32,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
<AssemblyName>Microsoft.Azure.WebJobs.Extensions.Tests</AssemblyName>
@ -31,7 +31,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="Microsoft.Azure.WebJobs.Host.Storage" Version="5.0.0-beta.1" />
</ItemGroup>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<AssemblyName>Microsoft.Azure.WebJobs.Extensions.Timers.Storage.Tests</AssemblyName>
<RootNamespace>Microsoft.Azure.WebJobs.Extensions.Timers.Storage.Tests</RootNamespace>
@ -29,7 +29,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<AssemblyName>Microsoft.Azure.WebJobs.Extensions.Twilio.Tests</AssemblyName>
<RootNamespace>Microsoft.Azure.WebJobs.Extensions.Twilio.Tests</RootNamespace>
@ -33,7 +33,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,39 +1,60 @@
$shouldPackage = -not $env:APPVEYOR_PULL_REQUEST_NUMBER -or $env:APPVEYOR_PULL_REQUEST_TITLE.Contains("[pack]")
$directoryPath = Split-Path $MyInvocation.MyCommand.Path -Parent
param (
[string]$buildNumber,
[string]$artifactDirectory,
[bool]$skipAssemblySigning = $false
)
if ($shouldPackage -and $env:SkipAssemblySigning -ne "true") {
$timeout = new-timespan -Minutes 15
$sw = [diagnostics.stopwatch]::StartNew();
$polling = $true;
$ctx = New-AzureStorageContext $env:FILES_ACCOUNT_NAME $env:FILES_ACCOUNT_KEY
$blob = $null;
while ($sw.elapsed -lt $timeout -and $polling) {
$blob = Get-AzureStorageBlob "$env:APPVEYOR_BUILD_VERSION.zip" "azure-webjobs-extensions-signed" -Context $ctx -ErrorAction Ignore
if (-not $blob) {
"${sw.elapsed} elapsed, polling..."
}
else {
"Jenkins artifacts found"
$polling = $false;
}
Start-Sleep -Seconds 5
if ($null -eq $buildNumber) {
throw 'Parameter $buildNumber cannot be null or empty. Exiting script.'
}
if (-not (Test-Path $artifactDirectory)) {
throw "Artifact directory '$artifactDirectory' not found. Exiting script."
}
$timeout = New-Timespan -Minutes 15
Write-Host "Set polling timeout to:" $timeout.ToString();
$sw = [System.Diagnostics.Stopwatch]::StartNew();
$polling = $true;
Write-Host "Connecting to storage account."
$ctx = New-AzureStorageContext -StorageAccountName $env:FILES_ACCOUNT_NAME -StorageAccountKey $env:FILES_ACCOUNT_KEY
$blob = $null;
while ($sw.elapsed -lt $timeout -and $polling) {
Write-Host "Retrieving Jenkins artifacts.."
$blob = Get-AzureStorageBlob -Blob "$buildNumber.zip" -Container "azure-webjobs-extensions-signed" -Context $ctx -ErrorAction Ignore
if (-not $blob) {
Write-Host "Jenkins artifacts not found. ${sw.elapsed} elapsed. Polling..."
}
if ($polling) {
"No jenkins artifacts found, investigate job at https://funkins-master.redmond.corp.microsoft.com/job/Build_signing/"
exit(1);
else {
Write-Host "Jenkins artifacts found."
$polling = $false;
}
Start-Sleep -Seconds 5
}
Remove-Item "$directoryPath/../buildoutput" -Recurse -Force
$sw.Stop();
Mkdir "$directoryPath/../buildoutput"
if ($polling) {
"No jenkins artifacts found after ${sw.Elapsed}. Investigate job at https://funkins-master.redmond.corp.microsoft.com/job/Build_signing/"
exit(1);
}
Get-AzureStorageBlobContent "$env:APPVEYOR_BUILD_VERSION.zip" "azure-webjobs-extensions-signed" -Destination "$directoryPath/../buildoutput/signed.zip" -Context $ctx
Write-Host "Removing directory $artifactDirectory"
Remove-Item -Path $artifactDirectory -Recurse -Force
Expand-Archive "$directoryPath/../buildoutput/signed.zip" "$directoryPath/../buildoutput/signed"
Write-Host "Recreating directory $artifactDirectory"
New-Item -ItemType "directory" -Path $artifactDirectory
$signedZipPath = Join-Path -Path $artifactDirectory -ChildPath "signed.zip"
Get-ChildItem "$directoryPath/../buildoutput/signed" | % {
Push-AppveyorArtifact $_.FullName
}
if (-not $?) { exit 1 }
}
Write-Host "Downloading signed file zip $buildNumber.zip to $signedZipPath"
Get-AzureStorageBlobContent -Blob "$buildNumber.zip" -Container "azure-webjobs-extensions-signed" -Destination $signedZipPath -Context $ctx
Write-Host "Unzipping signed files to $artifactDirectory"
Expand-Archive -LiteralPath $signedZipPath -DestinationPath $artifactDirectory
Write-Host "Removing signed file zip ${Split-Path -Path $signedZipPath -Leaf}."
Remove-Item -Path $signedZipPath
if (-not $?) { exit 1 }

Просмотреть файл

@ -1,19 +1,39 @@
$shouldPackage = -not $env:APPVEYOR_PULL_REQUEST_NUMBER -or $env:APPVEYOR_PULL_REQUEST_TITLE.Contains("[pack]")
$directoryPath = Split-Path $MyInvocation.MyCommand.Path -Parent
param (
[string]$buildNumber,
[string]$artifactDirectory,
[bool]$skipAssemblySigning = $false
)
if ($shouldPackage) {
Compress-Archive $directoryPath\..\buildoutput\* $directoryPath\..\buildoutput\tosign.zip
if ($null -eq $buildNumber) {
throw 'Parameter $buildNumber cannot be null or empty. Exiting script.'
}
if ($env:SkipAssemblySigning -eq "true") {
"Assembly signing disabled. Skipping signing process."
exit 0;
}
if (-not (Test-Path $artifactDirectory)) {
throw "Artifact directory '$artifactDirectory' not found. Exiting script."
}
$ctx = New-AzureStorageContext $env:FILES_ACCOUNT_NAME $env:FILES_ACCOUNT_KEY
Set-AzureStorageBlobContent "$directoryPath/../buildoutput/tosign.zip" "azure-webjobs-extensions" -Blob "$env:APPVEYOR_BUILD_VERSION.zip" -Context $ctx
$toSignPattern = Join-Path -Path $artifactDirectory -ChildPath "*"
$toSignZipPath = Join-Path -Path $artifactDirectory -ChildPath "tosign.zip"
$queue = Get-AzureStorageQueue "signing-jobs" -Context $ctx
Write-Host "Searching for files with path matching pattern: $toSignPattern"
$items = Get-ChildItem -Path $toSignPattern -Recurse
Write-Host $items
Write-Host "$($items.Count) items found."
$messageBody = "SignNupkgs;azure-webjobs-extensions;$env:APPVEYOR_BUILD_VERSION.zip"
$queue.CloudQueue.AddMessage($messageBody)
}
Compress-Archive -Path $toSignPattern -DestinationPath $toSignZipPath
Write-Host "Signing payload created at: $toSignZipPath"
if ($skipAssemblySigning) {
"Assembly signing disabled. Skipping signing process."
exit 0;
}
Write-Host "Uploading signing job '$buildNumber.zip' to storage."
# This will fail if the artifacts already exist.
$ctx = New-AzureStorageContext -StorageAccountName $env:FILES_ACCOUNT_NAME -StorageAccountKey $env:FILES_ACCOUNT_KEY
Set-AzureStorageBlobContent -File $toSignZipPath -Container "azure-webjobs-extensions" -Blob "$buildNumber.zip" -Context $ctx
$queue = Get-AzureStorageQueue -Name "signing-jobs" -Context $ctx
$messageBody = "SignNupkgs;azure-webjobs-extensions;$buildNumber.zip"
$queue.CloudQueue.AddMessage($messageBody)