Skip to content

Commit

Permalink
new signing pipeline (part1) (#2476)
Browse files Browse the repository at this point in the history
* testing pipelines

* testing collecting build output

* test nupkg

* testing different path

* testing bin directory

* test: do artifacts support wildcards?

* testing signing DLLs

* add missing build flags

* testing two part build/pack

* testing pack cmd

* testing pack in package step

* testing different signing profile

* testing external_distribution

* cleanup

* testing placeholder for testing

* testing multiple pipelines

* rename everything

* update pipelines with custom hello world for runtime logging

* fix args

* testing unique build params

* one more to fix pack for buddy

* testing consolidating cmd files

* cleanup

* changing slashes
  • Loading branch information
TimothyMothra committed Nov 19, 2021
1 parent e8eb520 commit 4feb2cf
Show file tree
Hide file tree
Showing 11 changed files with 267 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .pipelines/00_helloworld.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd /D "%~dp0..\"

echo hello world: %* || exit /b 1
3 changes: 3 additions & 0 deletions .pipelines/00_list_versions.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd /D "%~dp0..\"

dotnet --version && dotnet --list-sdks && dotnet --list-runtimes || exit /b 1
3 changes: 3 additions & 0 deletions .pipelines/01_restore.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd /D "%~dp0..\"

dotnet restore .\ProjectsForSigning.sln || exit /b 1
3 changes: 3 additions & 0 deletions .pipelines/02_build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd /D "%~dp0..\"

dotnet build .\ProjectsForSigning.sln %* --configuration Release --no-restore || exit /b 1
3 changes: 3 additions & 0 deletions .pipelines/03_pack.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd /D "%~dp0..\"

dotnet pack .\ProjectsForSigning.sln %* --configuration Release --no-restore --no-build || exit /b 1
4 changes: 4 additions & 0 deletions .pipelines/04_test.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cd /D "%~dp0..\"

echo "TODO: VALIDATE SIGNED DLLs."
echo "TODO: VALIDATE SIGNED NUPKGs."
80 changes: 80 additions & 0 deletions .pipelines/pipeline.user.windows.buddy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
environment:
host:
os: 'windows'
flavor: 'server'
version: '2019'
runtime:
provider: 'appcontainer'
image: 'cdpxwin1809.azurecr.io/global/vse2019:latest'
source_mode: 'link'

version:
name: 'ApplicationInsights-dotnet'
major: 0
minor: 0
system: 'custom'

signing_options:
profile: 'external_distribution'

restore:
commands:
- !!defaultcommand
name: 'Hello World'
command: '.pipelines/00_helloworld.cmd'
arguments: 'buddy'
fail_on_stderr: false
- !!defaultcommand
name: 'Show .NET versions'
command: '.pipelines/00_list_versions.cmd'
fail_on_stderr: false
- !!defaultcommand
name: 'Install dependencies'
command: '.pipelines/01_restore.cmd'
fail_on_stderr: false

build:
commands:
- !!buildcommand
name: 'Dotnet Build'
command: '.pipelines/02_build.cmd'
arguments: '-p:OfficialRelease=True'
fail_on_stderr: false
artifacts:
- from: './bin/Release/src'
include:
- '**/*.dll'
signing_options:
sign_inline: true

package:
commands:
- !!buildcommand
name: 'Dotnet Pack'
command: '.pipelines/03_pack.cmd'
arguments: '-p:OfficialRelease=True'
fail_on_stderr: false
artifacts:
- from: './bin/Release/NuGet'
include:
- '*.*'
signing_options:
sign_inline: true

test:
commands:
- !!defaultcommand
name: 'Custom tests'
command: '.pipelines/04_test.cmd'
fail_on_stderr: false

static_analysis_options:
credscan_options:
fail_on_error: true
binskim_options:
fail_on_error: true
files_to_scan:
- from: 'src'
policheck_options:
scan_comments: true
fail_on_error: true
80 changes: 80 additions & 0 deletions .pipelines/pipeline.user.windows.official.redfield.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
environment:
host:
os: 'windows'
flavor: 'server'
version: '2019'
runtime:
provider: 'appcontainer'
image: 'cdpxwin1809.azurecr.io/global/vse2019:latest'
source_mode: 'link'

version:
name: 'ApplicationInsights-dotnet'
major: 0
minor: 0
system: 'custom'

signing_options:
profile: 'external_distribution'

restore:
commands:
- !!defaultcommand
name: 'Hello World'
command: '.pipelines/00_helloworld.cmd'
arguments: 'official redfield'
fail_on_stderr: false
- !!defaultcommand
name: 'Show .NET versions'
command: '.pipelines/00_list_versions.cmd'
fail_on_stderr: false
- !!defaultcommand
name: 'Install dependencies'
command: '.pipelines/01_restore.cmd'
fail_on_stderr: false

build:
commands:
- !!buildcommand
name: 'Dotnet Build'
command: '.pipelines/02_build.cmd'
arguments: '-p:PublicRelease=True -p:StableRelease=True -p:OfficialRelease=True -p:Redfield=True'
fail_on_stderr: false
artifacts:
- from: './bin/Release/src'
include:
- '**/*.dll'
signing_options:
sign_inline: true

package:
commands:
- !!buildcommand
name: 'Dotnet Pack'
command: '.pipelines/03_pack.cmd'
arguments: '-p:PublicRelease=True -p:StableRelease=True -p:OfficialRelease=True -p:Redfield=True'
fail_on_stderr: false
artifacts:
- from: './bin/Release/NuGet'
include:
- '*.*'
signing_options:
sign_inline: true

test:
commands:
- !!defaultcommand
name: 'Custom tests'
command: '.pipelines/04_test.cmd'
fail_on_stderr: false

static_analysis_options:
credscan_options:
fail_on_error: true
binskim_options:
fail_on_error: true
files_to_scan:
- from: 'src'
policheck_options:
scan_comments: true
fail_on_error: true
80 changes: 80 additions & 0 deletions .pipelines/pipeline.user.windows.official.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
environment:
host:
os: 'windows'
flavor: 'server'
version: '2019'
runtime:
provider: 'appcontainer'
image: 'cdpxwin1809.azurecr.io/global/vse2019:latest'
source_mode: 'link'

version:
name: 'ApplicationInsights-dotnet'
major: 0
minor: 0
system: 'custom'

signing_options:
profile: 'external_distribution'

restore:
commands:
- !!defaultcommand
name: 'Hello World'
command: '.pipelines/00_helloworld.cmd'
arguments: 'official'
fail_on_stderr: false
- !!defaultcommand
name: 'Show .NET versions'
command: '.pipelines/00_list_versions.cmd'
fail_on_stderr: false
- !!defaultcommand
name: 'Install dependencies'
command: '.pipelines/01_restore.cmd'
fail_on_stderr: false

build:
commands:
- !!buildcommand
name: 'Dotnet Build'
command: '.pipelines/02_build.cmd'
arguments: '-p:PublicRelease=True -p:StableRelease=True -p:OfficialRelease=True'
fail_on_stderr: false
artifacts:
- from: './bin/Release/src'
include:
- '**/*.dll'
signing_options:
sign_inline: true

package:
commands:
- !!buildcommand
name: 'Dotnet Pack'
command: '.pipelines/03_pack.cmd'
arguments: '-p:PublicRelease=True -p:StableRelease=True -p:OfficialRelease=True'
fail_on_stderr: false
artifacts:
- from: './bin/Release/NuGet'
include:
- '*.*'
signing_options:
sign_inline: true

test:
commands:
- !!defaultcommand
name: 'Custom tests'
command: '.pipelines/04_test.cmd'
fail_on_stderr: false

static_analysis_options:
credscan_options:
fail_on_error: true
binskim_options:
fail_on_error: true
files_to_scan:
- from: 'src'
policheck_options:
scan_comments: true
fail_on_error: true
4 changes: 4 additions & 0 deletions .pipelines/pipeline.user.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
artifact_publish_options:
publish_to_legacy_artifacts: false
publish_to_pipeline_artifacts: true
publish_to_cloudvault_artifacts: false
5 changes: 4 additions & 1 deletion .props/_Nupkg.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

<PropertyGroup Condition="$(OS) == 'Windows_NT'">
<!-- Automatically generate package on build https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli#automatically-generate-package-on-build -->
<!-- We want developer and nightly build to generate nupkg. Official releases need to sign DLLs before packaging. -->
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<GeneratePackageOnBuild Condition="$(OfficialRelease) == 'true'">False</GeneratePackageOnBuild>


<!-- Documenting your code with XML comments https://docs.microsoft.com/en-us/dotnet/csharp/codedoc -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down Expand Up @@ -48,7 +51,7 @@
<None Include="$(EnlistmentRoot)\.images\icon.png" Pack="true" PackagePath="\"/>
</ItemGroup>

<PropertyGroup Condition="$(BuildServer) == 'true'">
<PropertyGroup Condition="$(OfficialRelease) == 'true'">
<!-- indicate that the build executes on a build/CI server -->
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>

Expand Down

0 comments on commit 4feb2cf

Please sign in to comment.