Skip to content

Commit

Permalink
Changes to allow migration to Azure Pipelines for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kayone committed Jun 26, 2019
1 parent 9849107 commit 0560f19
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 5 deletions.
85 changes: 85 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions setup/appget.iss
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -36,6 +37,7 @@ AppContact={#SupportURL}
VersionInfoVersion={#BuildNumber}
UninstallDisplayName={#AppName}
ChangesEnvironment=yes
OutputDir={#OutputDir}

;Windows 7 SP1
MinVersion=6.1sp1
Expand Down Expand Up @@ -136,5 +138,3 @@ begin
end;
end;
end;
4 changes: 3 additions & 1 deletion setup/sign.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ECHO %BUILD_BUILDNUMBER%

setup\AzureSignTool\AzureSignTool.exe sign ^
--description-url "https://appget.net" ^
--file-digest sha512 ^
Expand All @@ -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
3 changes: 2 additions & 1 deletion src/AppGet.Tests/HostSystem/MachineIdFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace AppGet.Tests.HostSystem
public class MachineIdFixture : TestBase<MachineId>
{
[Test]
[Explicit]
public void get_machine_guid()
{
Mocker.Use<ICalculateHash>(new Sha256());
Expand All @@ -18,4 +19,4 @@ public void get_machine_guid()
guid.Should().NotContain("=");
}
}
}
}

0 comments on commit 0560f19

Please sign in to comment.