Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
27 changes: 27 additions & 0 deletions pipelines/templates/copy-and-publish-powershell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Template helper to copy powershell dependency files and publish them as an artifact
parameters:
name: ''
source: ''
TargetPlatform: ''

steps:
- task: CopyFiles@2
displayName: 'Copy Files: ${{ parameters.name }}'
inputs:
Contents: |
${{ parameters.source }}\Microsoft.Extensions.Logging.Abstractions.dll
${{ parameters.source }}\Microsoft.WinGet.PowershellSupport.dll
${{ parameters.source }}\Microsoft.WinGet.RestSource.Util.dll
${{ parameters.source }}\Newtonsoft.Json.dll
${{ parameters.source }}\System.ComponentModel.Annotations.dll
${{ parameters.source }}\YamlDotNet.dll
${{ parameters.source }}\runtimes\win-${{TargetPlatform}}\native\WinGetUtil.dll
TargetFolder: '$(build.artifactstagingdirectory)\${{ parameters.name }}'
CleanTargetFolder: true
OverWrite: true

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: WinGet.RestSource-${{ parameters.name }}'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)\${{ parameters.name }}'
ArtifactName: 'WinGet.RestSource-${{ parameters.name }}'
113 changes: 63 additions & 50 deletions pipelines/templates/restore-build-publish-test.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,64 @@
# Template helper to restore, build, and publish

steps:
## Restore
- task: DotNetCoreCLI@2
displayName: 'Restore'
inputs:
command: 'restore'
projects: '**/*.csproj'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\src\NuGEt.config'
restoreDirectory: '$(Build.SourcesDirectory)\src\packages'

## Build
- task: VSBuild@1
displayName: Build
inputs:
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
clean: true

## Publish
# Publish ARM Templates
- template: copy-and-publish.yml
parameters:
name: WinGet.Restsource.Infrastructure
source: '$(Build.SourcesDirectory)\src\WinGet.RestSource.Infrastructure\bin\$(BuildConfiguration)'

# Publish Rest Function App
- template: package-and-publish.yml
parameters:
name: WinGet.RestSource.Functions
projects: '$(Build.SourcesDirectory)\src\WinGet.RestSource.Functions\WinGet.RestSource.Functions.csproj'
buildconfig: '$(BuildConfiguration)'
zipAfterPublish: True

## Run Unit Tests
- template: run-unittests.yml
parameters:
name: WinGet.RestSource.UnitTest
source: '$(Build.SourcesDirectory)\src\WinGet.RestSource.UnitTest\bin\$(BuildConfiguration)\netcoreapp3.1'
dll: Microsoft.WinGet.RestSource.UnitTest.dll

## Component Governance
- task: ComponentGovernanceComponentDetection@0
displayName: Component Governance
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'
# Template helper to restore, build, and publish

steps:
## Restore
- task: DotNetCoreCLI@2
displayName: 'Restore'
inputs:
command: 'restore'
projects: '**/*.csproj'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\src\NuGEt.config'
restoreDirectory: '$(Build.SourcesDirectory)\src\packages'

## Build
- task: VSBuild@1
displayName: Build
inputs:
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
clean: true

## Publish
# Publish ARM Templates
- template: copy-and-publish.yml
parameters:
name: WinGet.Restsource.Infrastructure
source: '$(Build.SourcesDirectory)\src\WinGet.RestSource.Infrastructure\bin\$(BuildConfiguration)'

# Publish Rest Function App
- template: package-and-publish.yml
parameters:
name: WinGet.RestSource.Functions
projects: '$(Build.SourcesDirectory)\src\WinGet.RestSource.Functions\WinGet.RestSource.Functions.csproj'
buildconfig: '$(BuildConfiguration)'
zipAfterPublish: True

# Publish x86 powershell binaries
- template: copy-and-publish-powershell.yml
parameters:
name: WinGet.Restsource.x86PowershellSupport
source: '$(Build.SourcesDirectory)\src\WinGet.RestSource.PowershellSupport\bin\$(BuildConfiguration)\netstandard2.0'
BuildPlatform: 'x86'

- template: copy-and-publish-powershell.yml
parameters:
name: WinGet.Restsource.x64PowershellSupport
source: '$(Build.SourcesDirectory)\src\WinGet.RestSource.PowershellSupport\bin\$(BuildConfiguration)\netstandard2.0'
BuildPlatform: 'x64'

## Run Unit Tests
- template: run-unittests.yml
parameters:
name: WinGet.RestSource.UnitTest
source: '$(Build.SourcesDirectory)\src\WinGet.RestSource.UnitTest\bin\$(BuildConfiguration)\netcoreapp3.1'
dll: Microsoft.WinGet.RestSource.UnitTest.dll

## Component Governance
- task: ComponentGovernanceComponentDetection@0
displayName: Component Governance
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'
failOnAlert: true
42 changes: 21 additions & 21 deletions src/NuGet.config
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="winget" value="https://pkgs.dev.azure.com/ms/winget-cli-restsource/_packaging/winget/nuget/v3/index.json" />
</packageSources>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<packageManagement>
<add key="format" value="1" />
<add key="disabled" value="False" />
</packageManagement>
<config>
<add key="dependencyversion" value="Highest" />
<add key="globalPackagesFolder" value="packages" />
</config>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="winget" value="https://pkgs.dev.azure.com/ms/winget-cli-restsource/_packaging/winget/nuget/v3/index.json" />
</packageSources>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<packageManagement>
<add key="format" value="1" />
<add key="disabled" value="False" />
</packageManagement>
<config>
<add key="dependencyversion" value="Highest" />
<add key="globalPackagesFolder" value="packages" />
</config>
</configuration>
4 changes: 2 additions & 2 deletions src/WinGet.RestSource.Functions/Common/ActionResultHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace Microsoft.WinGet.RestSource.Functions.Common
{
using System;
using System.Net;
using Microsoft.WinGet.RestSource.Constants;
using Microsoft.WinGet.RestSource.Models.Errors;
using Microsoft.WinGet.RestSource.Utils.Constants;
using Microsoft.WinGet.RestSource.Utils.Models.Errors;

/// <summary>
/// This Creates Action Results.
Expand Down
14 changes: 7 additions & 7 deletions src/WinGet.RestSource.Functions/InstallerFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ namespace Microsoft.WinGet.RestSource.Functions
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using Microsoft.WinGet.RestSource.Common;
using Microsoft.WinGet.RestSource.Constants;
using Microsoft.WinGet.RestSource.Exceptions;
using Microsoft.WinGet.RestSource.Functions.Common;
using Microsoft.WinGet.RestSource.Models;
using Microsoft.WinGet.RestSource.Models.Errors;
using Microsoft.WinGet.RestSource.Models.Schemas;
using Microsoft.WinGet.RestSource.Validators;
using Microsoft.WinGet.RestSource.Utils.Common;
using Microsoft.WinGet.RestSource.Utils.Constants;
using Microsoft.WinGet.RestSource.Utils.Exceptions;
using Microsoft.WinGet.RestSource.Utils.Models;
using Microsoft.WinGet.RestSource.Utils.Models.Errors;
using Microsoft.WinGet.RestSource.Utils.Models.Schemas;
using Microsoft.WinGet.RestSource.Utils.Validators;

/// <summary>
/// This class contains the functions for interacting with installers.
Expand Down
14 changes: 7 additions & 7 deletions src/WinGet.RestSource.Functions/LocaleFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ namespace Microsoft.WinGet.RestSource.Functions
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using Microsoft.WinGet.RestSource.Common;
using Microsoft.WinGet.RestSource.Constants;
using Microsoft.WinGet.RestSource.Exceptions;
using Microsoft.WinGet.RestSource.Functions.Common;
using Microsoft.WinGet.RestSource.Models;
using Microsoft.WinGet.RestSource.Models.Errors;
using Microsoft.WinGet.RestSource.Models.Schemas;
using Microsoft.WinGet.RestSource.Validators;
using Microsoft.WinGet.RestSource.Utils.Common;
using Microsoft.WinGet.RestSource.Utils.Constants;
using Microsoft.WinGet.RestSource.Utils.Exceptions;
using Microsoft.WinGet.RestSource.Utils.Models;
using Microsoft.WinGet.RestSource.Utils.Models.Errors;
using Microsoft.WinGet.RestSource.Utils.Models.Schemas;
using Microsoft.WinGet.RestSource.Utils.Validators;

/// <summary>
/// This class contains the functions for interacting with locales.
Expand Down
14 changes: 7 additions & 7 deletions src/WinGet.RestSource.Functions/ManifestSearchFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ namespace Microsoft.WinGet.RestSource.Functions
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using Microsoft.WinGet.RestSource.Common;
using Microsoft.WinGet.RestSource.Constants;
using Microsoft.WinGet.RestSource.Exceptions;
using Microsoft.WinGet.RestSource.Functions.Common;
using Microsoft.WinGet.RestSource.Models;
using Microsoft.WinGet.RestSource.Models.Arrays;
using Microsoft.WinGet.RestSource.Models.Schemas;
using Microsoft.WinGet.RestSource.Validators;
using Microsoft.WinGet.RestSource.Utils.Common;
using Microsoft.WinGet.RestSource.Utils.Constants;
using Microsoft.WinGet.RestSource.Utils.Exceptions;
using Microsoft.WinGet.RestSource.Utils.Models;
using Microsoft.WinGet.RestSource.Utils.Models.Arrays;
using Microsoft.WinGet.RestSource.Utils.Models.Schemas;
using Microsoft.WinGet.RestSource.Utils.Validators;

/// <summary>
/// This class contains the functions for searching manifests.
Expand Down
14 changes: 7 additions & 7 deletions src/WinGet.RestSource.Functions/PackageFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ namespace Microsoft.WinGet.RestSource.Functions
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Primitives;
using Microsoft.WinGet.RestSource.Common;
using Microsoft.WinGet.RestSource.Constants;
using Microsoft.WinGet.RestSource.Exceptions;
using Microsoft.WinGet.RestSource.Functions.Common;
using Microsoft.WinGet.RestSource.Models;
using Microsoft.WinGet.RestSource.Models.Errors;
using Microsoft.WinGet.RestSource.Models.Schemas;
using Microsoft.WinGet.RestSource.Validators;
using Microsoft.WinGet.RestSource.Utils.Common;
using Microsoft.WinGet.RestSource.Utils.Constants;
using Microsoft.WinGet.RestSource.Utils.Exceptions;
using Microsoft.WinGet.RestSource.Utils.Models;
using Microsoft.WinGet.RestSource.Utils.Models.Errors;
using Microsoft.WinGet.RestSource.Utils.Models.Schemas;
using Microsoft.WinGet.RestSource.Utils.Validators;

/// <summary>
/// This class contains the functions for interacting with packages.
Expand Down
16 changes: 8 additions & 8 deletions src/WinGet.RestSource.Functions/PackageManifestFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ namespace Microsoft.WinGet.RestSource.Functions
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using Microsoft.WinGet.RestSource.Common;
using Microsoft.WinGet.RestSource.Constants;
using Microsoft.WinGet.RestSource.Exceptions;
using Microsoft.WinGet.RestSource.Functions.Common;
using Microsoft.WinGet.RestSource.Models;
using Microsoft.WinGet.RestSource.Models.Arrays;
using Microsoft.WinGet.RestSource.Models.Errors;
using Microsoft.WinGet.RestSource.Models.Schemas;
using Microsoft.WinGet.RestSource.Validators;
using Microsoft.WinGet.RestSource.Utils.Common;
using Microsoft.WinGet.RestSource.Utils.Constants;
using Microsoft.WinGet.RestSource.Utils.Exceptions;
using Microsoft.WinGet.RestSource.Utils.Models;
using Microsoft.WinGet.RestSource.Utils.Models.Arrays;
using Microsoft.WinGet.RestSource.Utils.Models.Errors;
using Microsoft.WinGet.RestSource.Utils.Models.Schemas;
using Microsoft.WinGet.RestSource.Utils.Validators;

/// <summary>
/// This class contains the functions for interacting with manifests.
Expand Down
9 changes: 5 additions & 4 deletions src/WinGet.RestSource.Functions/ServerFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ namespace Microsoft.WinGet.RestSource.Functions
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using Microsoft.WinGet.RestSource.Constants;
using Microsoft.WinGet.RestSource.Exceptions;
using Microsoft.WinGet.RestSource.Cosmos;
using Microsoft.WinGet.RestSource.Functions.Common;
using Microsoft.WinGet.RestSource.Models;
using Microsoft.WinGet.RestSource.Models.Schemas;
using Microsoft.WinGet.RestSource.Utils.Constants;
using Microsoft.WinGet.RestSource.Utils.Exceptions;
using Microsoft.WinGet.RestSource.Utils.Models;
using Microsoft.WinGet.RestSource.Utils.Models.Schemas;

/// <summary>
/// This class contains the functions for interacting with packages.
Expand Down
4 changes: 2 additions & 2 deletions src/WinGet.RestSource.Functions/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ namespace Microsoft.WinGet.RestSource.Functions
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.WinGet.RestSource.Common;
using Microsoft.WinGet.RestSource.Constants;
using Microsoft.WinGet.RestSource.Cosmos;
using Microsoft.WinGet.RestSource.Utils.Common;
using Microsoft.WinGet.RestSource.Utils.Constants;

/// <summary>
/// Azure function startup class.
Expand Down
14 changes: 7 additions & 7 deletions src/WinGet.RestSource.Functions/VersionFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ namespace Microsoft.WinGet.RestSource.Functions
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using Microsoft.WinGet.RestSource.Common;
using Microsoft.WinGet.RestSource.Constants;
using Microsoft.WinGet.RestSource.Exceptions;
using Microsoft.WinGet.RestSource.Functions.Common;
using Microsoft.WinGet.RestSource.Models;
using Microsoft.WinGet.RestSource.Models.Errors;
using Microsoft.WinGet.RestSource.Validators;
using Version = Microsoft.WinGet.RestSource.Models.Schemas.Version;
using Microsoft.WinGet.RestSource.Utils.Common;
using Microsoft.WinGet.RestSource.Utils.Constants;
using Microsoft.WinGet.RestSource.Utils.Exceptions;
using Microsoft.WinGet.RestSource.Utils.Models;
using Microsoft.WinGet.RestSource.Utils.Models.Errors;
using Microsoft.WinGet.RestSource.Utils.Validators;
using Version = Microsoft.WinGet.RestSource.Utils.Models.Schemas.Version;

/// <summary>
/// This class contains the functions for interacting with versions.
Expand Down
Loading