From 1cda0af7eb19d4a6c167c5d86be32b49d34f1fbc Mon Sep 17 00:00:00 2001 From: Oren Novotny Date: Thu, 13 Sep 2018 16:00:32 -0400 Subject: [PATCH] consolidate files --- .vsts-ci.yml => .azure-pipelines.yml | 35 +++++++++++++--------------- SignPackages.ps1 | 9 ++++--- script/setversion.csproj | 10 -------- script/version.json | 8 ------- 4 files changed, 20 insertions(+), 42 deletions(-) rename .vsts-ci.yml => .azure-pipelines.yml (63%) delete mode 100644 script/setversion.csproj delete mode 100644 script/version.json diff --git a/.vsts-ci.yml b/.azure-pipelines.yml similarity index 63% rename from .vsts-ci.yml rename to .azure-pipelines.yml index 47fea20e..053c6d24 100644 --- a/.vsts-ci.yml +++ b/.azure-pipelines.yml @@ -1,6 +1,5 @@ trigger: - master -- develop - rel/* queue: Hosted VS2017 @@ -13,35 +12,33 @@ steps: modifyEnvironment: true displayName: Setup Environment Variables -- task: NuGetToolInstaller@0 - displayName: Use NuGet 4.6.2 +- task: DotNetCoreCLI@2 inputs: - versionSpec: 4.6.2 + command: custom + custom: tool + arguments: install --tool-path . nbgv + displayName: Install NBGV tool + condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false)) -- task: DotNetCoreCLI@2 - inputs: - command: build - projects: script/setversion.csproj - arguments: -c Release +- script: nbgv cloud displayName: Set Version - condition: eq(variables['system.pullrequest.isfork'], false) + condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false)) -- powershell: | - nuget install SignClient -Version 0.9.1 -SolutionDir $(Build.SourcesDirectory) -Verbosity quiet -ExcludeVersion - .\build.cmd +- script: build.cmd displayName: Build env: SIGNCLIENT_SECRET: $(SignClientSecret) SIGNCLIENT_USER: $(SignClientUser) VSTS_ACCESS_TOKEN: $(System.AccessToken) COVERALLS_TOKEN: $(COVERALLS_TOKEN) + ArtifactDirectory: $(System.DefaultWorkingDirectory)\artifacts - task: CopyFiles@2 inputs: Contents: 'artifacts/*.nupkg' TargetFolder: '$(build.artifactstagingdirectory)\packages' flattenFolders: true - condition: eq(variables['system.pullrequest.isfork'], false) + condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false)) - task: PublishBuildArtifacts@1 displayName: Publish Package Artifacts @@ -49,13 +46,13 @@ steps: pathToPublish: '$(build.artifactstagingdirectory)\packages' artifactType: container artifactName: Packages - condition: eq(variables['system.pullrequest.isfork'], false) + condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false)) - task: CopyFiles@2 inputs: Contents: '**/bin/*' TargetFolder: '$(build.artifactstagingdirectory)\binaries' - condition: eq(variables['system.pullrequest.isfork'], false) + condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false)) - task: PublishBuildArtifacts@1 displayName: Publish Binaries @@ -63,13 +60,13 @@ steps: pathToPublish: '$(build.artifactstagingdirectory)\binaries' artifactType: container artifactName: Binaries - condition: eq(variables['system.pullrequest.isfork'], false) + condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false)) - task: CopyFiles@2 inputs: Contents: 'src/ReactiveUI.**/Events_*.cs' TargetFolder: '$(build.artifactstagingdirectory)\Events' - condition: eq(variables['system.pullrequest.isfork'], false) + condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false)) - task: PublishBuildArtifacts@1 displayName: Publish Generated Events @@ -77,4 +74,4 @@ steps: pathToPublish: '$(build.artifactstagingdirectory)\Events' artifactType: container artifactName: Events - condition: eq(variables['system.pullrequest.isfork'], false) + condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false)) diff --git a/SignPackages.ps1 b/SignPackages.ps1 index 55521538..eac0c4b1 100644 --- a/SignPackages.ps1 +++ b/SignPackages.ps1 @@ -6,18 +6,17 @@ if([string]::IsNullOrWhitespace($env:SIGNCLIENT_SECRET)){ [System.Environment]::Exit(1); } -# Setup Variables we need to pass into the sign client tool +dotnet tool install --tool-path . SignClient +# Setup Variables we need to pass into the sign client tool $appSettings = "$currentDirectory\SignPackages.json" -$appPath = "$currentDirectory\packages\SignClient\tools\netcoreapp2.0\SignClient.dll" - -$nupgks = ls $currentDirectory\artifacts\*.nupkg | Select -ExpandProperty FullName +$nupgks = gci $Env:ArtifactDirectory\*.nupkg | Select -ExpandProperty FullName foreach ($nupkg in $nupgks){ Write-Host "Submitting $nupkg for signing" - dotnet $appPath 'sign' -c $appSettings -i $nupkg -r $env:SIGNCLIENT_USER -s $env:SIGNCLIENT_SECRET -n 'ReactiveUI' -d 'ReactiveUI' -u 'https://reactiveui.net' + .\SignClient 'sign' -c $appSettings -i $nupkg -r $env:SIGNCLIENT_USER -s $env:SIGNCLIENT_SECRET -n 'ReactiveUI' -d 'ReactiveUI' -u 'https://reactiveui.net' Write-Host "Finished signing $nupkg" } diff --git a/script/setversion.csproj b/script/setversion.csproj deleted file mode 100644 index 1a45c992..00000000 --- a/script/setversion.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - netstandard2.0 - - - - - - diff --git a/script/version.json b/script/version.json deleted file mode 100644 index f1b52a7d..00000000 --- a/script/version.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "inherit": true, - "cloudBuild": { - "buildNumber": { - "enabled": true - } - } -}