Sign files appropriate before and after publish · microsoft/VSConfigFinder@207d0f3 (original) (raw)
3 files changed
lines changed
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -6,4 +6,22 @@ | ||
| 6 | 6 | <Version>3.5.119</Version> |
| 7 | 7 | </PackageReference> |
| 8 | 8 | </ItemGroup> |
| 9 | + | |
| 10 | + <Target Name="SignPublishFiles" | |
| 11 | +Condition=" '$(MicroBuild_SigningEnabled)' == 'true' " | |
| 12 | +AfterTargets="Publish"> | |
| 13 | + <ItemGroup> | |
| 14 | + <FilesToSign Include="$(PublishDir)$(TargetName)$(TargetExt)"> | |
| 15 | + <PublishOnly>true</PublishOnly> | |
| 16 | + </FilesToSign> | |
| 17 | + </ItemGroup> | |
| 18 | + <SignFiles Files="@(FilesToSign)" | |
| 19 | +Type="$(SignType)" | |
| 20 | +BinariesDirectory="$(OutDir)" | |
| 21 | +IntermediatesDirectory="$(IntermediateOutputPath)" | |
| 22 | +Condition=" '%(FilesToSign.PublishOnly)' == 'true' " /> | |
| 23 | + <ItemGroup> | |
| 24 | + <FilesToSign Remove="@(FilesToSign)" Condition=" '%(FilesToSign.PublishOnly)' == 'true' " /> | |
| 25 | + </ItemGroup> | |
| 26 | + </Target> | |
| 9 | 27 | </Project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -19,6 +19,16 @@ | ||
| 19 | 19 | </PackageReference> |
| 20 | 20 | </ItemGroup> |
| 21 | 21 | |
| 22 | + <ItemGroup> | |
| 23 | + <FilesToSign Include="$(PublishPath)VSConfigFinder.dll"> | |
| 24 | + <Authenticode>Microsoft400</Authenticode> | |
| 25 | + <StrongName>StrongName</StrongName> | |
| 26 | + </FilesToSign> | |
| 27 | + <FilesToSign Include="$(PublishPath)VSConfigFinder.exe" Condition=" Exists('$(PublishPath)VSConfigFinder.exe') "> | |
| 28 | + <Authenticode>Microsoft400</Authenticode> | |
| 29 | + </FilesToSign> | |
| 30 | + </ItemGroup> | |
| 31 | + | |
| 22 | 32 | <ItemGroup> |
| 23 | 33 | <EditorConfigFiles Remove="C:\Users\sknam\source\repos\VSConfigFinder\VSConfigFinder\.editorconfig" /> |
| 24 | 34 | </ItemGroup> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -3,6 +3,8 @@ | ||
| 3 | 3 | |
| 4 | 4 | variables: |
| 5 | 5 | BuildConfiguration: Release |
| 6 | +SignType: test | |
| 7 | +TeamName: vssetup | |
| 6 | 8 | |
| 7 | 9 | trigger: |
| 8 | 10 | batch: true |
| @@ -23,6 +25,13 @@ steps: | ||
| 23 | 25 | - checkout: self |
| 24 | 26 | fetchDepth: 0 # avoid shallow clone so nbgv can do its work. |
| 25 | 27 | |
| 28 | +- task: MicroBuildSigningPlugin@4 | |
| 29 | +inputs: | |
| 30 | +signType: '$(SignType)' | |
| 31 | +feedSource: 'https://devdiv.pkgs.visualstudio.com/DefaultCollection/\_packaging/MicroBuildToolset/nuget/v3/index.json' | |
| 32 | +env: | |
| 33 | +TeamName: '$(TeamName)' | |
| 34 | + | |
| 26 | 35 | - task: UseDotNet@2 |
| 27 | 36 | displayName: 'Install .NET Core SDK' |
| 28 | 37 | inputs: |