-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor and Rename Extractor (#104)
* Refactor and Rename MultiExtractor to RecursiveExtractor * Fix Broken Test Data
- Loading branch information
Showing
45 changed files
with
276 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,230 @@ | ||
# Azure Pipelines | ||
# https://aka.ms/yaml | ||
|
||
name: RecursiveExtractor_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) | ||
trigger: | ||
batch: true | ||
branches: | ||
include: | ||
- master | ||
paths: | ||
include: | ||
- src/RecursiveExtractor | ||
pr: | ||
branches: | ||
include: | ||
- master | ||
paths: | ||
include: | ||
- Pipelines | ||
- src/RecursiveExtractor | ||
|
||
stages: | ||
- stage: Test | ||
jobs: | ||
- job: build_test | ||
displayName: Run RecursiveExtractor Tests | ||
pool: | ||
vmImage: 'windows-latest' | ||
steps: | ||
- task: UseDotNet@2 | ||
inputs: | ||
packageType: 'sdk' | ||
version: '3.1.x' | ||
- task: NuGetToolInstaller@1 | ||
displayName: Install Nuget Tool | ||
inputs: | ||
versionSpec: '5.4.x' | ||
- task: NuGetCommand@2 | ||
displayName: NuGet Restore | ||
inputs: | ||
command: 'restore' | ||
restoreSolution: 'src/RecursiveExtractor.Tests/RecursiveExtractor.Tests.csproj' | ||
feedsToUse: 'config' | ||
nugetConfigPath: 'src/NuGet.Config' | ||
verbosityRestore: 'Normal' | ||
- task: DotNetCoreCLI@2 | ||
displayName: Dotnet Test | ||
inputs: | ||
command: 'test' | ||
projects: 'src/RecursiveExtractor.Tests/RecursiveExtractor.Tests.csproj' | ||
|
||
- stage: Build | ||
jobs: | ||
- job: build_win | ||
displayName: Build Nupkg | ||
pool: | ||
vmImage: 'windows-latest' | ||
steps: | ||
- task: UseDotNet@2 | ||
inputs: | ||
packageType: 'sdk' | ||
version: '3.1.x' | ||
- script: 'dotnet tool install -g nbgv' | ||
displayName: 'Install GitVersioning' | ||
- task: PowerShell@2 | ||
displayName: Set Release Version | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
$version = (nbgv get-version -v AssemblyInformationalVersion).split('+')[0] | ||
Write-Host "##vso[task.setvariable variable=ReleaseVersion;]$version" | ||
- task: DotNetCoreCLI@2 | ||
displayName: Pack RecursiveExtractor Nupkg (Lib) | ||
inputs: | ||
command: 'custom' | ||
custom: 'pack' | ||
arguments: '-c Release -o $(Build.BinariesDirectory)\nuget\RecursiveExtractor_$(ReleaseVersion)' | ||
workingDirectory: '$(SolutionDirectory)\RecursiveExtractor' | ||
- task: AntiMalware@3 | ||
displayName: Anti-Malware Scan | ||
inputs: | ||
InputType: 'Basic' | ||
ScanType: 'CustomScan' | ||
FileDirPath: '$(Build.BinariesDirectory)' | ||
EnableServices: true | ||
SupportLogOnError: false | ||
TreatSignatureUpdateFailureAs: 'Warning' | ||
SignatureFreshness: 'UpToDate' | ||
TreatStaleSignatureAs: 'Warning' | ||
- task: ArchiveFiles@2 | ||
displayName: Archive Artifact - Nupkg | ||
inputs: | ||
rootFolderOrFile: '$(Build.BinariesDirectory)\nuget' | ||
includeRootFolder: true | ||
archiveType: 'zip' | ||
archiveFile: '$(Build.StagingDirectory)\RecursiveExtractor_nuget_$(ReleaseVersion).zip' | ||
replaceExistingArchive: true | ||
- task: PublishBuildArtifacts@1 | ||
displayName: Store Windows, NetCoreApp, Nupkg Archives | ||
inputs: | ||
PathtoPublish: '$(Build.StagingDirectory)' | ||
ArtifactName: 'Unsigned_WinNuget' | ||
publishLocation: 'Container' | ||
|
||
- job: sign_hash_release | ||
displayName: Code Sign, Generate Hashes, Publish Public Releases | ||
dependsOn: | ||
- build_win | ||
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Manual')) | ||
pool: | ||
vmImage: 'windows-latest' | ||
steps: | ||
- task: UseDotNet@2 | ||
inputs: | ||
packageType: 'sdk' | ||
version: '3.1.x' | ||
- script: 'dotnet tool install -g nbgv' | ||
displayName: 'Install GitVersioning' | ||
- task: PowerShell@2 | ||
displayName: Set Release Version | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
$version = (nbgv get-version -v AssemblyInformationalVersion).split('+')[0] | ||
Write-Host "##vso[task.setvariable variable=ReleaseVersion;]$version" | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: Retrieve Windows, NetCoreApp, Nupkg Archives | ||
inputs: | ||
buildType: 'current' | ||
downloadType: 'specific' | ||
itemPattern: 'Unsigned_WinNuget/*.zip' | ||
downloadPath: '$(Build.BinariesDirectory)' | ||
- task: ExtractFiles@1 | ||
displayName: Extract Artifacts for Signing | ||
inputs: | ||
archiveFilePatterns: '$(Build.BinariesDirectory)\*.zip' | ||
destinationFolder: '$(Build.BinariesDirectory)' | ||
cleanDestinationFolder: false | ||
- task: AntiMalware@3 | ||
displayName: Anti-Malware Scan | ||
inputs: | ||
InputType: 'Basic' | ||
ScanType: 'CustomScan' | ||
FileDirPath: '$(Build.BinariesDirectory)' | ||
EnableServices: true | ||
SupportLogOnError: true | ||
TreatSignatureUpdateFailureAs: 'Warning' | ||
SignatureFreshness: 'UpToDate' | ||
TreatStaleSignatureAs: 'Warning' | ||
- task: UseDotNet@2 | ||
inputs: | ||
packageType: 'sdk' | ||
version: '2.1.804' | ||
- task: EsrpCodeSigning@1 | ||
displayName: Code Sign Nuget Packages | ||
inputs: | ||
ConnectedServiceName: 'OSSGadget_CodeSign' | ||
FolderPath: '$(Build.BinariesDirectory)/nuget/RecursiveExtractor_$(ReleaseVersion)' | ||
Pattern: '*.nupkg, *.snupkg' | ||
signConfigType: 'inlineSignParams' | ||
inlineOperation: | | ||
[ | ||
{ | ||
"KeyCode" : "CP-401405", | ||
"OperationCode" : "NuGetSign", | ||
"Parameters" : {}, | ||
"ToolName" : "sign", | ||
"ToolVersion" : "1.0" | ||
}, | ||
{ | ||
"KeyCode" : "CP-401405", | ||
"OperationCode" : "NuGetVerify", | ||
"Parameters" : {}, | ||
"ToolName" : "sign", | ||
"ToolVersion" : "1.0" | ||
} | ||
] | ||
SessionTimeout: '60' | ||
MaxConcurrency: '50' | ||
MaxRetryAttempts: '5' | ||
- powershell: 'Get-ChildItem -Path ''$(Build.BinariesDirectory)'' -Recurse CodeSign* | foreach { Remove-Item -Path $_.FullName }' | ||
displayName: 'Delete Code Sign Summaries' | ||
- task: PowerShell@2 | ||
displayName: Generate Hashes | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
Get-ChildItem $(Build.StagingDirectory) | Foreach-Object { | ||
$name = $_.Name | ||
$tmp = (Get-FileHash "$(Build.StagingDirectory)\$name").Hash | ||
Add-Content $(Build.StagingDirectory)\HASHES.txt "$tmp`t$name" | ||
} | ||
- task: PowerShell@2 | ||
displayName: Move Nuget Packages | ||
inputs: | ||
targetType: 'inline' | ||
script: 'mv $env:BUILD_BINARIESDIRECTORY/nuget/RecursiveExtractor_$(ReleaseVersion)/*.nupkg $env:BUILD_STAGINGDIRECTORY/' | ||
- task: PowerShell@2 | ||
displayName: Move Nuget Symbols | ||
inputs: | ||
targetType: 'inline' | ||
script: 'mv $env:BUILD_BINARIESDIRECTORY/nuget/RecursiveExtractor_$(ReleaseVersion)/*.snupkg $env:BUILD_STAGINGDIRECTORY/' | ||
- task: PublishPipelineArtifact@1 | ||
displayName: Publish Signed Artifacts to Pipeline | ||
inputs: | ||
targetPath: '$(Build.StagingDirectory)' | ||
artifact: 'Signed_Binaries' | ||
- task: GitHubRelease@1 | ||
displayName: Release to GitHub | ||
inputs: | ||
gitHubConnection: 'OSSGadget' | ||
repositoryName: 'microsoft/OSSGadget' | ||
action: 'create' | ||
target: '$(Build.SourceVersion)' | ||
tagSource: 'userSpecifiedTag' | ||
tag: 'v$(ReleaseVersion)' | ||
title: 'Release v$(ReleaseVersion) - RecursiveExtractor' | ||
assets: | | ||
$(Build.StagingDirectory)/*.zip | ||
$(Build.StagingDirectory)/HASHES.txt | ||
changeLogCompareToRelease: 'lastNonDraftRelease' | ||
changeLogType: 'commitBased' | ||
- task: NuGetCommand@2 | ||
displayName: Publish NuGet Packages | ||
inputs: | ||
command: 'push' | ||
packagesToPush: '$(Build.StagingDirectory)/*.nupkg' | ||
nuGetFeedType: 'external' | ||
publishFeedCredentials: 'CST-E Nuget CI' | ||
verbosityPush: 'Normal' |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.