Skip to content

Commit 6062439

Browse files
committed
Set up CI with Azure Pipelines
1 parent ba5d3aa commit 6062439

File tree

5 files changed

+156
-4
lines changed

5 files changed

+156
-4
lines changed

azure-pipelines.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
trigger:
2+
- main
3+
4+
pool:
5+
vmImage: 'windows-latest'
6+
7+
variables:
8+
projectName: 'Umbraco.Forms.Integrations.Crm.Hubspot'
9+
solution: '**/*.sln'
10+
project: 'src/$(projectName)/$(projectName).csproj'
11+
testPoject: 'src/$(projectName).Tests/$(projectName).Tests.csproj'
12+
buildPlatform: 'Any CPU'
13+
buildConfiguration: 'Release'
14+
15+
steps:
16+
- task: NuGetToolInstaller@1
17+
displayName: 'Install NuGet'
18+
19+
- task: NuGetCommand@2
20+
displayName: 'NuGet Restore'
21+
inputs:
22+
restoreSolution: '$(solution)'
23+
24+
- task: VSBuild@1
25+
displayName: 'Build Project'
26+
inputs:
27+
solution: '$(project)'
28+
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
29+
platform: '$(buildPlatform)'
30+
configuration: '$(buildConfiguration)'
31+
32+
- task: VSBuild@1
33+
displayName: 'Build Tests'
34+
inputs:
35+
solution: '$(testPoject)'
36+
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
37+
platform: '$(buildPlatform)'
38+
configuration: '$(buildConfiguration)'
39+
40+
- task: VSTest@2
41+
displayName: 'Run Tests'
42+
inputs:
43+
platform: '$(buildPlatform)'
44+
configuration: '$(buildConfiguration)'
45+
46+
- task: DotNetCoreCLI@2
47+
displayName: 'Create NuGet and Zip'
48+
inputs:
49+
command: 'pack'
50+
arguments: '--configuration $(buildConfiguration)'
51+
packagesToPack: '$(project)'
52+
versioningScheme: 'off'
53+
54+
- task: CopyFiles@2
55+
displayName: 'Copy Zip Artifact To Staging'
56+
inputs:
57+
SourceFolder: '$(Build.SourcesDirectory)\src\$(projectName)\bin\$(buildConfiguration)\'
58+
Contents: '$(projectName).*.zip'
59+
TargetFolder: '$(Build.ArtifactStagingDirectory)'
60+
61+
- task: PublishBuildArtifacts@1
62+
displayName: 'Publish Build Artifacts'
63+
inputs:
64+
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
65+
ArtifactName: 'drop'
66+
publishLocation: 'Container'
Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<!-- Frameworks https://docs.microsoft.com/en-us/dotnet/standard/frameworks#supported-target-frameworks -->
54
<TargetFramework>net472</TargetFramework>
65
</PropertyGroup>
76

87
<PropertyGroup>
98
<PackageId>Umbraco.Forms.Integrations.Crm.Hubspot</PackageId>
109
<Title>Umbraco Forms Integrations: CRM - Hubspot</Title>
11-
<Description>An extension for Umrbaco Forms to add support for submitting data to Hubspot</Description>
10+
<Description>An extension for Umbraco Forms to add support for submitting data to Hubspot</Description>
1211
<PackageIconUrl></PackageIconUrl>
1312
<PackageProjectUrl>https://github.com/umbraco/Umbraco.Forms.Integrations</PackageProjectUrl>
1413
<RepositoryUrl>https://github.com/umbraco/Umbraco.Forms.Integrations</RepositoryUrl>
@@ -18,18 +17,72 @@
1817
</PropertyGroup>
1918

2019
<ItemGroup>
21-
<PackageReference Include="UmbracoCms.Web" Version="8.14.0" />
20+
<PackageReference Include="MSBuild.Umbraco.Packaging" Version="1.0.2" />
21+
<PackageReference Include="UmbracoCms.Web" Version="8.1.0" />
2222
<PackageReference Include="UmbracoForms.Core" Version="8.7.4" />
2323
</ItemGroup>
2424

25+
<ItemGroup>
26+
<Content Include="App_Plugins\UmbracoForms.Integrations\Crm\Hubspot\**\*.*">
27+
<Pack>true</Pack>
28+
<PackagePath>content\App_Plugins\UmbracoForms.Integrations\Crm\Hubspot\</PackagePath>
29+
</Content>
30+
</ItemGroup>
31+
2532
<ItemGroup>
2633
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
2734
<_Parameter1>Umbraco.Forms.Integrations.Crm.Hubspot.Tests</_Parameter1>
2835
</AssemblyAttribute>
2936
</ItemGroup>
3037

31-
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
38+
<!-- Copy App_Plugins files to test site when developing locally -->
39+
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)' == 'Debug'">
3240
<Exec Command="xcopy /E /Y /I &quot;$(ProjectDir)App_Plugins\UmbracoForms.Integrations\Crm\Hubspot&quot; &quot;$(SolutionDir)\Umbraco.Forms.Integrations.TestSite\App_Plugins\UmbracoForms.Integrations\Crm\Hubspot&quot;&#xD;&#xA;EXIT 0" />
3341
</Target>
3442

43+
<!--
44+
Create Umbraco package zip along with NuGet when dotnet pack is called.
45+
See and hat-tip:
46+
- https://24days.in/umbraco-cms/2019/umbraco-packages-2019/packaging/
47+
- https://github.com/callumbwhyte/msbuild-umbraco-packaging
48+
-->
49+
<UsingTask AssemblyFile="$(TargetDir)\MSBuild.Umbraco.Packaging.dll" TaskName="MSBuild.Umbraco.Packaging.GatherAssemblies" />
50+
51+
<Target Name="UmbracoGatherFiles">
52+
<GatherAssemblies Dependencies="@(ReferenceCopyLocalPaths)"
53+
PackageRefs="@(PackageReference);@(ProjectReference)">
54+
<Output TaskParameter="Assemblies" ItemName="PackageAssemblies" />
55+
</GatherAssemblies>
56+
57+
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(TempFolder)\bin\" />
58+
<Copy SourceFiles="@(PackageAssemblies)" DestinationFolder="$(TempFolder)\bin\" />
59+
60+
<Copy SourceFiles="@(Content)" DestinationFiles="$(TempFolder)%(RelativeDir)%(Filename)%(Extension)" />
61+
</Target>
62+
63+
<UsingTask AssemblyFile="$(TargetDir)\MSBuild.Umbraco.Packaging.dll" TaskName="MSBuild.Umbraco.Packaging.GenerateManifest" />
64+
65+
<Target Name="UmbracoPackage" AfterTargets="Pack" DependsOnTargets="UmbracoClean;UmbracoGatherFiles">
66+
<GenerateManifest TargetDirectory="$(TempFolder)"
67+
Name="$(Product)"
68+
Description="$(Description)"
69+
Version="$(Version)"
70+
UmbracoVersion="$(UmbracoVersion)"
71+
Author="$(Authors)"
72+
AuthorUrl="$(AuthorUrl)"
73+
ProjectUrl="$(PackageProjectUrl)"
74+
IconUrl="$(PackageIconUrl)"
75+
LicenseUrl="$(PackageLicenseUrl)" />
76+
</Target>
77+
78+
<Target Name="UmbracoPackage" AfterTargets="Pack" DependsOnTargets="UmbracoClean;UmbracoGatherFiles">
79+
<ZipDirectory SourceDirectory="$(TempFolder)"
80+
DestinationFile="$(DestFolder)\$(Product).$(Version).zip"
81+
Overwrite="true" />
82+
</Target>
83+
84+
<Target Name="UmbracoClean" AfterTargets="Clean">
85+
<RemoveDir Directories="$(TempFolder)" />
86+
</Target>
87+
3588
</Project>

src/Umbraco.Forms.Integrations.TestSite/Umbraco.Forms.Integrations.TestSite.csproj

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Import Project="..\packages\MSBuild.Umbraco.Packaging.1.0.2\build\MSBuild.Umbraco.Packaging.props" Condition="Exists('..\packages\MSBuild.Umbraco.Packaging.1.0.2\build\MSBuild.Umbraco.Packaging.props')" />
23
<Import Project="..\packages\UmbracoCms.8.14.1\build\UmbracoCms.props" Condition="Exists('..\packages\UmbracoCms.8.14.1\build\UmbracoCms.props')" />
34
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
45
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
@@ -101,6 +102,12 @@
101102
<Reference Include="Microsoft.AspNet.SignalR.Core, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
102103
<HintPath>..\packages\Microsoft.AspNet.SignalR.Core.2.4.0\lib\net45\Microsoft.AspNet.SignalR.Core.dll</HintPath>
103104
</Reference>
105+
<Reference Include="Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
106+
<HintPath>..\packages\Microsoft.Build.Framework.15.9.20\lib\net46\Microsoft.Build.Framework.dll</HintPath>
107+
</Reference>
108+
<Reference Include="Microsoft.Build.Utilities.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
109+
<HintPath>..\packages\Microsoft.Build.Utilities.Core.15.9.20\lib\net46\Microsoft.Build.Utilities.Core.dll</HintPath>
110+
</Reference>
104111
<Reference Include="Microsoft.CSharp" />
105112
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
106113
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
@@ -123,6 +130,10 @@
123130
<Reference Include="Microsoft.Owin.Security.OAuth, Version=4.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
124131
<HintPath>..\packages\Microsoft.Owin.Security.OAuth.4.0.1\lib\net45\Microsoft.Owin.Security.OAuth.dll</HintPath>
125132
</Reference>
133+
<Reference Include="Microsoft.VisualStudio.Setup.Configuration.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
134+
<HintPath>..\packages\Microsoft.VisualStudio.Setup.Configuration.Interop.1.16.30\lib\net35\Microsoft.VisualStudio.Setup.Configuration.Interop.dll</HintPath>
135+
<EmbedInteropTypes>True</EmbedInteropTypes>
136+
</Reference>
126137
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
127138
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
128139
</Reference>
@@ -132,6 +143,9 @@
132143
<Reference Include="MiniProfiler.Shared, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b44f9351044011a3, processorArchitecture=MSIL">
133144
<HintPath>..\packages\MiniProfiler.Shared.4.0.138\lib\net461\MiniProfiler.Shared.dll</HintPath>
134145
</Reference>
146+
<Reference Include="MSBuild.Umbraco.Packaging, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
147+
<HintPath>..\packages\MSBuild.Umbraco.Packaging.1.0.2\lib\net472\MSBuild.Umbraco.Packaging.dll</HintPath>
148+
</Reference>
135149
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
136150
<HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
137151
</Reference>
@@ -178,6 +192,9 @@
178192
<Reference Include="Superpower, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aec39280ded1b3a7, processorArchitecture=MSIL">
179193
<HintPath>..\packages\Superpower.2.0.0\lib\net45\Superpower.dll</HintPath>
180194
</Reference>
195+
<Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
196+
<HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath>
197+
</Reference>
181198
<Reference Include="System.Data.Linq" />
182199
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
183200
<HintPath>..\packages\Umbraco.SqlServerCE.4.0.0.1\lib\net472\System.Data.SqlServerCe.dll</HintPath>
@@ -199,6 +216,11 @@
199216
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
200217
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
201218
</Reference>
219+
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
220+
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
221+
<Private>True</Private>
222+
<Private>True</Private>
223+
</Reference>
202224
<Reference Include="System.Runtime.Serialization" />
203225
<Reference Include="System.Security" />
204226
<Reference Include="System.Text.Encoding.CodePages, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
@@ -245,6 +267,7 @@
245267
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
246268
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
247269
</Reference>
270+
<Reference Include="System.Xaml" />
248271
<Reference Include="System.Xml.Linq" />
249272
<Reference Include="System.Drawing" />
250273
<Reference Include="System.Web" />
@@ -606,9 +629,12 @@
606629
<Error Condition="!Exists('..\packages\Umbraco.SqlServerCE.4.0.0.1\build\Umbraco.SqlServerCE.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Umbraco.SqlServerCE.4.0.0.1\build\Umbraco.SqlServerCE.targets'))" />
607630
<Error Condition="!Exists('..\packages\UmbracoCms.8.14.1\build\UmbracoCms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\UmbracoCms.8.14.1\build\UmbracoCms.props'))" />
608631
<Error Condition="!Exists('..\packages\UmbracoCms.8.14.1\build\UmbracoCms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\UmbracoCms.8.14.1\build\UmbracoCms.targets'))" />
632+
<Error Condition="!Exists('..\packages\MSBuild.Umbraco.Packaging.1.0.2\build\MSBuild.Umbraco.Packaging.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSBuild.Umbraco.Packaging.1.0.2\build\MSBuild.Umbraco.Packaging.props'))" />
633+
<Error Condition="!Exists('..\packages\MSBuild.Umbraco.Packaging.1.0.2\build\MSBuild.Umbraco.Packaging.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSBuild.Umbraco.Packaging.1.0.2\build\MSBuild.Umbraco.Packaging.targets'))" />
609634
</Target>
610635
<Import Project="..\packages\Umbraco.SqlServerCE.4.0.0.1\build\Umbraco.SqlServerCE.targets" Condition="Exists('..\packages\Umbraco.SqlServerCE.4.0.0.1\build\Umbraco.SqlServerCE.targets')" />
611636
<Import Project="..\packages\UmbracoCms.8.14.1\build\UmbracoCms.targets" Condition="Exists('..\packages\UmbracoCms.8.14.1\build\UmbracoCms.targets')" />
637+
<Import Project="..\packages\MSBuild.Umbraco.Packaging.1.0.2\build\MSBuild.Umbraco.Packaging.targets" Condition="Exists('..\packages\MSBuild.Umbraco.Packaging.1.0.2\build\MSBuild.Umbraco.Packaging.targets')" />
612638
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
613639
Other similar extension points exist, see Microsoft.Common.targets.
614640
<Target Name="BeforeBuild">

src/Umbraco.Forms.Integrations.TestSite/packages.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.7" targetFramework="net472" />
2727
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.7" targetFramework="net472" />
2828
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net472" />
29+
<package id="Microsoft.Build.Framework" version="15.9.20" targetFramework="net472" />
30+
<package id="Microsoft.Build.Utilities.Core" version="15.9.20" targetFramework="net472" />
2931
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net472" />
3032
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="2.0.0" targetFramework="net472" />
3133
<package id="Microsoft.IO.RecyclableMemoryStream" version="1.2.2" targetFramework="net472" />
@@ -34,9 +36,11 @@
3436
<package id="Microsoft.Owin.Security" version="4.0.1" targetFramework="net472" />
3537
<package id="Microsoft.Owin.Security.Cookies" version="4.0.1" targetFramework="net472" />
3638
<package id="Microsoft.Owin.Security.OAuth" version="4.0.1" targetFramework="net472" />
39+
<package id="Microsoft.VisualStudio.Setup.Configuration.Interop" version="1.16.30" targetFramework="net472" developmentDependency="true" />
3740
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net472" />
3841
<package id="MiniProfiler" version="4.0.138" targetFramework="net472" />
3942
<package id="MiniProfiler.Shared" version="4.0.138" targetFramework="net472" />
43+
<package id="MSBuild.Umbraco.Packaging" version="1.0.2" targetFramework="net472" />
4044
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net472" />
4145
<package id="NPoco" version="3.9.4" targetFramework="net472" />
4246
<package id="Owin" version="1.0" targetFramework="net472" />
@@ -53,8 +57,10 @@
5357
<package id="Serilog.Sinks.Map" version="1.0.0" targetFramework="net472" />
5458
<package id="SharpZipLib" version="0.86.0" targetFramework="net472" />
5559
<package id="Superpower" version="2.0.0" targetFramework="net472" />
60+
<package id="System.Collections.Immutable" version="1.5.0" targetFramework="net472" />
5661
<package id="System.Diagnostics.DiagnosticSource" version="4.4.1" targetFramework="net472" />
5762
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net472" />
63+
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net472" />
5864
<package id="System.Text.Encoding.CodePages" version="4.7.1" targetFramework="net472" />
5965
<package id="System.Threading.Tasks.Dataflow" version="4.9.0" targetFramework="net472" />
6066
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />

src/Umbraco.Forms.Integrations.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Forms.Integrations.
1515
EndProject
1616
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D8563F12-E8CF-4900-BEF4-531B8C1FE8A3}"
1717
ProjectSection(SolutionItems) = preProject
18+
..\azure-pipelines.yml = ..\azure-pipelines.yml
1819
..\README.md = ..\README.md
1920
EndProjectSection
2021
EndProject

0 commit comments

Comments
 (0)