Skip to content

Add RuntimeIdentifiers to each project. #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 6, 2021
38 changes: 27 additions & 11 deletions Pipelines/core-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ stages:
- template: templates/dotnet-test-job.yml
parameters:
projectPath: 'src/oss-tests/oss-tests.csproj'
arguments: '--runtime win-x64'

- stage: SDL
dependsOn: Test
Expand All @@ -52,6 +53,7 @@ stages:
projectName: 'OSSGadget'
preBuild:
- template: templates/nbgv-set-version-steps.yml
buildArguments: '-p:SelfContained=false -p:PublishSingleFile=false'

- stage: Release
dependsOn:
Expand All @@ -62,7 +64,7 @@ stages:
- job: sign_hash_release
displayName: Code Sign, Generate Hashes, Publish Public Releases
pool:
vmImage: 'windows-latest'
vmImage: 'ubuntu-latest'
steps:
- task: UseDotNet@2
inputs:
Expand All @@ -77,18 +79,31 @@ stages:
$version = (nbgv get-version -v AssemblyInformationalVersion).split('+')[0]
Write-Host "##vso[task.setvariable variable=ReleaseVersion;]$version"
- task: DownloadBuildArtifacts@0
displayName: Download Unsigned Archives
displayName: Download Unsigned Win/Netcoreapp Archives
inputs:
buildType: 'current'
downloadType: 'specific'
itemPattern: 'Unsigned_Binaries/*.zip'
downloadPath: '$(Build.BinariesDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download Unsigned Nix Archives
inputs:
buildType: 'current'
downloadType: 'specific'
itemPattern: 'Unsigned_Binaries/*.tar.gz'
downloadPath: '$(Build.BinariesDirectory)'
- task: ExtractFiles@1
displayName: Extract Artifacts for Signing
displayName: Extract Win/Netcoreapp Artifacts for Signing
inputs:
archiveFilePatterns: '$(Build.BinariesDirectory)\Unsigned_Binaries\*.zip'
destinationFolder: '$(Build.BinariesDirectory)'
cleanDestinationFolder: false
- task: ExtractFiles@1
displayName: Extract Nix Artifacts for Signing
inputs:
archiveFilePatterns: '$(Build.BinariesDirectory)\Unsigned_Binaries\*.tar.gz'
destinationFolder: '$(Build.BinariesDirectory)'
cleanDestinationFolder: false
- task: AntiMalware@3
displayName: Anti-Malware Scan
inputs:
Expand All @@ -109,7 +124,7 @@ stages:
inputs:
ConnectedServiceName: 'OSSGadget_CodeSign'
FolderPath: '$(Build.BinariesDirectory)/linux/OSSGadget_linux_$(ReleaseVersion)'
Pattern: 'oss-characteristic.dll, oss-defog.dll, oss-detect-backdoor.dll, oss-download.dll, oss-find-source.dll, oss-health.dll, RecursiveExtractor.dll'
Pattern: 'oss-characteristic.dll, oss-defog.dll, oss-detect-backdoor.dll, oss-detect-cryptography.dll, oss-diff.dll, oss-download.dll, oss-find-domain-squats.dll, oss-find-source.dll, oss-find-squats.dll, oss-health.dll, oss-metadata.dll, oss-risk-calculator.dll, Shared.dll'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
Expand Down Expand Up @@ -142,7 +157,7 @@ stages:
inputs:
ConnectedServiceName: 'OSSGadget_CodeSign'
FolderPath: '$(Build.BinariesDirectory)/macos/OSSGadget_macos_$(ReleaseVersion)'
Pattern: 'oss-characteristic.dll, oss-defog.dll, oss-detect-backdoor.dll, oss-download.dll, oss-find-source.dll, oss-health.dll, RecursiveExtractor.dll'
Pattern: 'oss-characteristic.dll, oss-defog.dll, oss-detect-backdoor.dll, oss-detect-cryptography.dll, oss-diff.dll, oss-download.dll, oss-find-domain-squats.dll, oss-find-source.dll, oss-find-squats.dll, oss-health.dll, oss-metadata.dll, oss-risk-calculator.dll, Shared.dll'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
Expand Down Expand Up @@ -175,7 +190,7 @@ stages:
inputs:
ConnectedServiceName: 'OSSGadget_CodeSign'
FolderPath: '$(Build.BinariesDirectory)/win/OSSGadget_win_$(ReleaseVersion)'
Pattern: 'oss-characteristic.exe, oss-characteristic.dll, oss-defog.exe, oss-defog.dll, oss-detect-backdoor.exe, oss-detect-backdoor.dll, oss-download.exe, oss-download.dll, oss-find-source.exe, oss-find-source.dll, oss-health.exe, oss-health.dll, RecursiveExtractor.dll'
Pattern: 'oss-characteristic.dll, oss-defog.dll, oss-detect-backdoor.dll, oss-detect-cryptography.dll, oss-diff.dll, oss-download.dll, oss-find-domain-squats.dll, oss-find-source.dll, oss-find-squats.dll, oss-health.dll, oss-metadata.dll, oss-risk-calculator.dll, Shared.dll'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
Expand Down Expand Up @@ -208,7 +223,7 @@ stages:
inputs:
ConnectedServiceName: 'OSSGadget_CodeSign'
FolderPath: '$(Build.BinariesDirectory)/netcoreapp/OSSGadget_netcoreapp_$(ReleaseVersion)'
Pattern: 'oss-characteristic.exe, oss-characteristic.dll, oss-defog.exe, oss-defog.dll, oss-detect-backdoor.exe, oss-detect-backdoor.dll, oss-download.exe, oss-download.dll, oss-find-source.exe, oss-find-source.dll, oss-health.exe, oss-health.dll, RecursiveExtractor.dll'
Pattern: 'oss-characteristic.dll, oss-defog.dll, oss-detect-backdoor.dll, oss-detect-cryptography.dll, oss-diff.dll, oss-download.dll, oss-find-domain-squats.dll, oss-find-source.dll, oss-find-squats.dll, oss-health.dll, oss-metadata.dll, oss-risk-calculator.dll, Shared.dll'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
Expand Down Expand Up @@ -243,16 +258,16 @@ stages:
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)/linux/OSSGadget_linux_$(ReleaseVersion)'
includeRootFolder: true
archiveType: 'zip'
archiveFile: '$(Build.StagingDirectory)/OSSGadget_linux_$(ReleaseVersion).zip'
archiveType: 'tar'
archiveFile: '$(Build.StagingDirectory)/OSSGadget_linux_$(ReleaseVersion).tar.gz'
replaceExistingArchive: true
- task: ArchiveFiles@2
displayName: Archive Artifact - MacOS
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)/macos/OSSGadget_macos_$(ReleaseVersion)'
includeRootFolder: true
archiveType: 'zip'
archiveFile: '$(Build.StagingDirectory)/OSSGadget_macos_$(ReleaseVersion).zip'
archiveType: 'tar'
archiveFile: '$(Build.StagingDirectory)/OSSGadget_macos_$(ReleaseVersion).tar.gz'
replaceExistingArchive: true
- task: ArchiveFiles@2
displayName: Archive Artifact - Windows
Expand Down Expand Up @@ -296,6 +311,7 @@ stages:
tag: 'v$(ReleaseVersion)'
title: 'OSS Gadget v$(ReleaseVersion)'
assets: |
$(Build.StagingDirectory)/*.tar.gz
$(Build.StagingDirectory)/*.zip
$(Build.StagingDirectory)/HASHES.txt
changeLogCompareToRelease: 'lastNonDraftRelease'
Expand Down
4 changes: 2 additions & 2 deletions Pipelines/templates/dotnet-publish-linux-mac-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ jobs:
inputs:
rootFolderOrFile: 'bin'
includeRootFolder: false
archiveType: 'zip'
archiveFile: 'Archives/${{ parameters.projectName }}_Nix.zip'
archiveType: 'tar'
archiveFile: 'Archives/${{ parameters.projectName }}_Nix.tar.gz'
replaceExistingArchive: true
- task: PublishBuildArtifacts@1
displayName: Pipeline Publish Archive
Expand Down
12 changes: 10 additions & 2 deletions Pipelines/templates/dotnet-publish-win-netcore-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ parameters:
- name: artifactName
type: string
default: 'Unsigned_Binaries'
# Additional 'dotnet publish' arguments
- name: publishArguments
type: string
default: ''
# Additional 'dotnet build' arguments
- name: buildArguments
type: string
default: ''

jobs:
- job: ${{ parameters.jobName }}
Expand Down Expand Up @@ -67,14 +75,14 @@ jobs:
displayName: Publish Win x64
inputs:
command: 'publish'
arguments: '${{ parameters.projectPath }} -c ${{ parameters.buildConfiguration }} -o bin/win/${{ parameters.projectName }}_win_$(ReleaseVersion) -r win-x64'
arguments: '${{ parameters.projectPath }} -c ${{ parameters.buildConfiguration }} -o bin/win/${{ parameters.projectName }}_win_$(ReleaseVersion) -r win-x64 ${{ parameters.publishArguments }}'
publishWebProjects: false
zipAfterPublish: false
- task: DotNetCoreCLI@2
displayName: Build .NET Core App
inputs:
command: 'build'
arguments: '${{ parameters.projectPath }} -c ${{ parameters.buildConfiguration }} -o bin/netcoreapp/${{ parameters.projectName }}_netcoreapp_$(ReleaseVersion)'
arguments: '${{ parameters.projectPath }} -c ${{ parameters.buildConfiguration }} -o bin/netcoreapp/${{ parameters.projectName }}_netcoreapp_$(ReleaseVersion) ${{ parameters.buildArguments }}'
publishWebProjects: false
zipAfterPublish: false
- task: AntiMalware@3
Expand Down
5 changes: 5 additions & 0 deletions Pipelines/templates/dotnet-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ parameters:
- name: projectPath
type: string
default: ''
# Additional 'dotnet test' arguments
- name: arguments
type: string
default: ''

jobs:
- job: ${{ parameters.jobName }}
Expand All @@ -39,3 +43,4 @@ jobs:
inputs:
command: 'test'
projects: ${{ parameters.projectPath }}
arguments: ${{ parameters.arguments }}
2 changes: 2 additions & 0 deletions src/Shared/Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<AssemblyName>Shared</AssemblyName>
<LangVersion>9.0</LangVersion>
<Nullable>Enable</Nullable>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
2 changes: 2 additions & 0 deletions src/oss-characteristics/oss-characteristic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<Configurations>Debug;Release</Configurations>
<LangVersion>9.0</LangVersion>
<Nullable>Enable</Nullable>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/oss-defog/oss-defog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<Configurations>Debug;Release</Configurations>
<LangVersion>9.0</LangVersion>
<Nullable>Enable</Nullable>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
2 changes: 2 additions & 0 deletions src/oss-detect-backdoor/oss-detect-backdoor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<Configurations>Debug;Release</Configurations>
<LangVersion>9.0</LangVersion>
<Nullable>Enable</Nullable>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/oss-detect-cryptography/oss-detect-cryptography.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<StartupObject>Microsoft.CST.OpenSource.DetectCryptographyTool</StartupObject>
<LangVersion>9.0</LangVersion>
<Nullable>Enable</Nullable>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/oss-diff/oss-diff.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<RootNamespace>Microsoft.CST.OpenSource</RootNamespace>
<Nullable>enable</Nullable>
<LangVersion>9.0</LangVersion>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/oss-download/oss-download.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<StartupObject>Microsoft.CST.OpenSource.DownloadTool</StartupObject>
<LangVersion>9.0</LangVersion>
<Nullable>Enable</Nullable>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
2 changes: 2 additions & 0 deletions src/oss-find-domain-squats/oss-find-domain-squats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<RootNamespace>Microsoft.CST.OpenSource.FindDomainSquats</RootNamespace>
<Nullable>enable</Nullable>
<LangVersion>9.0</LangVersion>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/oss-find-source/oss-find-source.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<Configurations>Debug;Release</Configurations>
<LangVersion>9.0</LangVersion>
<Nullable>Enable</Nullable>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
2 changes: 2 additions & 0 deletions src/oss-find-squats/oss-find-squats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<Configurations>Debug;Release</Configurations>
<LangVersion>9.0</LangVersion>
<Nullable>Enable</Nullable>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/oss-health/oss-health.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<Configurations>Debug;Release</Configurations>
<LangVersion>9.0</LangVersion>
<Nullable>Enable</Nullable>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
2 changes: 2 additions & 0 deletions src/oss-metadata/oss-metadata.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<LangVersion>9.0</LangVersion>
<RepositoryUrl>https://github.com/Microsoft/OSSGadget</RepositoryUrl>
<RepositoryType>Github</RepositoryType>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down
2 changes: 2 additions & 0 deletions src/oss-risk-calculator/oss-risk-calculator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<Configurations>Debug;Release</Configurations>
<LangVersion>9.0</LangVersion>
<Nullable>Enable</Nullable>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/oss-tests/oss-tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
<LangVersion>8.0</LangVersion>
<Nullable>Enable</Nullable>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down