From 0560f198b8d592b2f0ff2214c89ca768c280c2bf Mon Sep 17 00:00:00 2001 From: kayone Date: Wed, 26 Jun 2019 14:14:58 -0700 Subject: [PATCH] Changes to allow migration to Azure Pipelines for CI --- azure-pipelines.yml | 85 +++++++++++++++++++ setup/appget.iss | 6 +- setup/sign.bat | 4 +- .../HostSystem/MachineIdFixture.cs | 3 +- 4 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..186283ce --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,85 @@ +# .NET Desktop +# Build and run tests for .NET Desktop or Windows classic desktop solutions. +# Add steps that publish symbols, save build artifacts, and more: +# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net + +name: 0.8$(Rev:.r) +# trigger: +# branches: +# include: +# - * + +pool: + vmImage: 'windows-latest' + +variables: + solution: '**/AppGet.sln' + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + +steps: +- checkout: self + submodules: recursive + +- task: PowerShell@2 + inputs: + targetType: 'inline' + script: 'Get-ChildItem Env:' + failOnStderr: true + +- task: NuGetToolInstaller@1 + inputs: + versionSpec: '5.x' + checkLatest: true + +- task: NuGetCommand@2 + displayName: Nuget Restore + inputs: + restoreSolution: '$(solution)' + +- task: VSBuild@1 + displayName: Build + inputs: + solution: '$(solution)' + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)' + maximumCpuCount: true + +- task: VSTest@2 + displayName: Test + inputs: + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)' + testSelector: 'testAssemblies' + testAssemblyVer2: | + **\*tests.dll + !**\netcoreapp*\*.* + !**\*TestAdapter.dll + !**\obj\** + otherConsoleOptions: '/Framework:.NETFramework,Version=v4.6.1' + runInParallel: true + +- task: CmdLine@2 + displayName: Create Installer + inputs: + script: 'setup\\inno\\ISCC.exe setup\\appget.iss' + failOnStderr: true + +- task: CmdLine@2 + displayName: Sign Installer + inputs: + script: 'setup\\AzureSignTool\\AzureSignTool.exe sign ^ + --description-url "https://appget.net" ^ + --file-digest sha512 ^ + --azure-key-vault-url $(AKV_URL) ^ + --azure-key-vault-client-id $(AKV_CLIENT_ID) ^ + --azure-key-vault-client-secret $(AKV_CLIENT_SECRET) ^ + --azure-key-vault-certificate appget-authenticode ^ + --timestamp-rfc3161 http://timestamp.digicert.com ^ + --timestamp-digest sha512 ^ + -v ^ + $(build.artifactstagingdirectory)\appget.$(Build.BuildNumber).exe' + failOnStderr: true + +- publish: '$(build.artifactstagingdirectory)' + artifact: drop diff --git a/setup/appget.iss b/setup/appget.iss index c2a4e9a8..ed2a7f9c 100644 --- a/setup/appget.iss +++ b/setup/appget.iss @@ -8,7 +8,8 @@ #define AppURL "https://appget.net/" #define SupportURL "https://github.com/appget/appget/issues" #define UpdatesURL "https://github.com/appget/appget/releases" -#define BuildNumber GetEnv('APPVEYOR_BUILD_VERSION') +#define BuildNumber GetEnv('BUILD_BUILDNUMBER') +#define OutputDir GetEnv('BUILD_ARTIFACTSTAGINGDIRECTORY') [Setup] ; NOTE: The value of AppId uniquely identifies this application. @@ -36,6 +37,7 @@ AppContact={#SupportURL} VersionInfoVersion={#BuildNumber} UninstallDisplayName={#AppName} ChangesEnvironment=yes +OutputDir={#OutputDir} ;Windows 7 SP1 MinVersion=6.1sp1 @@ -136,5 +138,3 @@ begin end; end; end; - - diff --git a/setup/sign.bat b/setup/sign.bat index 7bdcd8e6..e9439f64 100644 --- a/setup/sign.bat +++ b/setup/sign.bat @@ -1,3 +1,5 @@ +ECHO %BUILD_BUILDNUMBER% + setup\AzureSignTool\AzureSignTool.exe sign ^ --description-url "https://appget.net" ^ --file-digest sha512 ^ @@ -8,4 +10,4 @@ setup\AzureSignTool\AzureSignTool.exe sign ^ --timestamp-rfc3161 http://timestamp.digicert.com ^ --timestamp-digest sha512 ^ -v ^ -setup\Output\appget.%APPVEYOR_BUILD_VERSION%.exe +setup\Output\appget.%BUILD_BUILDNUMBER%.exe diff --git a/src/AppGet.Tests/HostSystem/MachineIdFixture.cs b/src/AppGet.Tests/HostSystem/MachineIdFixture.cs index efabc376..7493d875 100644 --- a/src/AppGet.Tests/HostSystem/MachineIdFixture.cs +++ b/src/AppGet.Tests/HostSystem/MachineIdFixture.cs @@ -8,6 +8,7 @@ namespace AppGet.Tests.HostSystem public class MachineIdFixture : TestBase { [Test] + [Explicit] public void get_machine_guid() { Mocker.Use(new Sha256()); @@ -18,4 +19,4 @@ public void get_machine_guid() guid.Should().NotContain("="); } } -} \ No newline at end of file +}