Skip to content

Commit db2a8f3

Browse files
committed
Simplified build.
1 parent d32566a commit db2a8f3

13 files changed

Lines changed: 16 additions & 212 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ on:
1010
branches: [ "main" ]
1111

1212
jobs:
13-
build-nuget-and-tests:
14-
name: Build Nuget and Run Tests
13+
build-and-test:
14+
name: Build and Run Tests
1515
strategy:
1616
fail-fast: false
1717
matrix:
@@ -64,15 +64,6 @@ jobs:
6464
name: Cobertura-${{ matrix.os }}
6565
path: ${{ github.workspace }}/report/Cobertura.xml
6666
# TODO: Publish github comment with code coverage
67-
- name: Pack NuGet
68-
if: ${{ matrix.os == 'ubuntu-latest' }}
69-
run: dotnet pack MSStore.API --no-build -c Release
70-
- name: Upload Artifact - NuGet
71-
if: ${{ matrix.os == 'ubuntu-latest' }}
72-
uses: actions/upload-artifact@v6
73-
with:
74-
name: NuGet
75-
path: MSStore.API/bin/Release/*.nupkg
7667

7768
build-cli:
7869
strategy:
@@ -110,12 +101,8 @@ jobs:
110101
run: dotnet tool install --tool-path . nbgv
111102
- name: Set Version
112103
run: ./nbgv cloud
113-
- name: Restore CLI
114-
run: dotnet restore MSStore.CLI -r ${{ matrix.dotnet-os }}-${{ matrix.dotnet-arch }} /p:Configuration=Release
115-
- name: Build CLI
116-
run: dotnet build MSStore.CLI --no-restore --self-contained -r ${{ matrix.dotnet-os }}-${{ matrix.dotnet-arch }} -f ${{ matrix.dotnet-framework }} /p:Configuration=Release
117104
- name: Publish SelfContained CLI
118-
run: dotnet publish MSStore.CLI --no-build --self-contained -r ${{ matrix.dotnet-os }}-${{ matrix.dotnet-arch }} -f ${{ matrix.dotnet-framework }} /p:Configuration=Release /p:PublishProfile=${{ matrix.dotnet-os }}-${{ matrix.dotnet-arch }}
105+
run: dotnet publish MSStore.CLI --self-contained -r ${{ matrix.dotnet-os }}-${{ matrix.dotnet-arch }} -f ${{ matrix.dotnet-framework }} /p:Configuration=Release /p:PublishProfile=${{ matrix.dotnet-os }}-${{ matrix.dotnet-arch }}
119106
- run: |
120107
New-Item -ItemType File -Path ".\MSStore.CLI.MSIX\obj\${{ matrix.dotnet-arch }}\appxmanifest.xml" -Force
121108
Copy-Item ".\MSStore.CLI.MSIX\Package.appxmanifest" -Destination ".\MSStore.CLI.MSIX\obj\${{ matrix.dotnet-arch }}\appxmanifest.xml" -Force

.pipelines/build.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ parameters:
1616
type: object
1717
default:
1818
- Release
19-
- name: buildPlatforms
20-
type: object
21-
default:
22-
- x64
23-
- arm64
2419
- name: pools
2520
type: object
2621
default:
@@ -71,9 +66,7 @@ extends:
7166
- task: NuGetAuthenticate@1
7267
- script: dotnet restore MSStore.CLI.sln /p:Configuration=${{ dotnet_config }}
7368
displayName: Restore dependencies
74-
- template: ./.pipelines/templates/build-nuget.yaml@self
69+
- template: ./.pipelines/templates/build-and-tests.yaml@self
7570
parameters:
7671
dotnet_configuration: ${{ dotnet_config }}
77-
AgentOS: $(Agent.OS)
78-
DoEsrp: false
79-
signingIdentity: {}
72+
AgentOS: $(Agent.OS)

.pipelines/release.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ extends:
7171
binSkim:
7272
AnalyzeTargetGlob: '$(System.DefaultWorkingDirectory)\MSStore.API\bin\**\net10.0\MSStore.API.dll'
7373
stages:
74-
- stage: NuGet
74+
- stage: Build_And_Tests
7575
jobs:
7676
- ${{ each pool in parameters.pools }}:
7777
- ${{ each dotnet_config in parameters.dotnet_configurations }}:
78-
- job: Build_Nuget_And_Tests_${{ pool.os }}_${{ dotnet_config }}
79-
displayName: Build Nuget and Run Tests (${{ pool.os }}_${{ dotnet_config }})
78+
- job: Build_And_Tests_${{ pool.os }}_${{ dotnet_config }}
79+
displayName: Build and Run Tests (${{ pool.os }}_${{ dotnet_config }})
8080
pool:
8181
name: ${{ pool.name }}
8282
image: ${{ pool.image }}
@@ -87,33 +87,18 @@ extends:
8787
displayName: Setup .NET 10
8888
inputs:
8989
version: 10.0.x
90-
- ${{ if eq(parameters.DoEsrp, 'true') }}:
91-
- task: UseDotNet@2
92-
displayName: Setup .NET 6.0 (For ESRP Task)
93-
condition: startsWith(variables['Agent.OS'], 'Linux')
94-
inputs:
95-
packageType: runtime
96-
version: 6.0.x
9790
- script: mv -f $(Build.SourcesDirectory)/.pipelines/release-nuget.config ./nuget.config
9891
displayName: Add release package source
9992
- task: NuGetAuthenticate@1
10093
- script: dotnet restore MSStore.CLI.sln /p:Configuration=${{ dotnet_config }}
10194
displayName: Restore dependencies
102-
- template: ./.pipelines/templates/build-nuget.yaml@self
103-
parameters:
104-
dotnet_configuration: ${{ dotnet_config }}
105-
AgentOS: $(Agent.OS)
106-
DoEsrp: ${{ parameters.DoEsrp }}
107-
signingIdentity: ${{ parameters.signingIdentity }}
108-
- template: ./.pipelines/templates/pack-nuget.yaml@self
95+
- template: ./.pipelines/templates/build-and-tests.yaml@self
10996
parameters:
11097
dotnet_configuration: ${{ dotnet_config }}
11198
AgentOS: $(Agent.OS)
112-
DoEsrp: ${{ parameters.DoEsrp }}
113-
signingIdentity: ${{ parameters.signingIdentity }}
11499

115100
- stage: CLI
116-
dependsOn: NuGet
101+
dependsOn: Build_And_Tests
117102
jobs:
118103
- ${{ each pool in parameters.pools }}:
119104
- ${{ each dotnet_config in parameters.dotnet_configurations }}:
Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ parameters:
66
- name: AgentOS
77
type: string
88
default: ''
9-
- name: DoEsrp
10-
type: boolean
11-
default: false
12-
- name: signingIdentity
13-
type: object
14-
default: {}
159

1610
steps:
1711
- bash: |
@@ -75,57 +69,6 @@ steps:
7569
inputs:
7670
codeCoverageTool: 'Cobertura'
7771
summaryFileLocation: '$(Build.SourcesDirectory)/report/Cobertura.xml'
78-
- ${{ if eq(parameters['DoEsrp'], 'true') }}:
79-
- task: EsrpCodeSigning@5
80-
displayName: Code Sign ESRP - API DLL
81-
condition: startsWith(variables.AgentOS, 'Linux')
82-
inputs:
83-
ConnectedServiceName: ${{ parameters.signingIdentity.serviceName }}
84-
AppRegistrationClientId: ${{ parameters.signingIdentity.appId }}
85-
AppRegistrationTenantId: ${{ parameters.signingIdentity.tenantId }}
86-
AuthAKVName: ${{ parameters.signingIdentity.akvName }}
87-
AuthCertName: ${{ parameters.signingIdentity.authCertName }}
88-
AuthSignCertName: ${{ parameters.signingIdentity.signCertName }}
89-
FolderPath: '$(System.DefaultWorkingDirectory)/MSStore.API/bin/${{ parameters.dotnet_configuration }}/net10.0'
90-
Pattern: 'MSStore.API.dll'
91-
signConfigType: inlineSignParams
92-
inlineOperation: |
93-
[
94-
{
95-
"KeyCode": "CP-233863-SN",
96-
"OperationCode": "StrongNameSign",
97-
"Parameters": { },
98-
"ToolName": "sign",
99-
"ToolVersion": "1.0"
100-
},
101-
{
102-
"KeyCode": "CP-233863-SN",
103-
"OperationCode": "StrongNameVerify",
104-
"Parameters": { },
105-
"ToolName": "sign",
106-
"ToolVersion": "1.0"
107-
},
108-
{
109-
"KeyCode": "CP-230012",
110-
"OperationCode": "SigntoolSign",
111-
"Parameters": {
112-
"OpusName": "Microsoft Store CLI",
113-
"OpusInfo": "https://github.com/Microsoft/msstore-cli",
114-
"FileDigest": "/fd \"SHA256\"",
115-
"PageHash": "/PH",
116-
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
117-
},
118-
"ToolName": "sign",
119-
"ToolVersion": "1.0"
120-
},
121-
{
122-
"KeyCode": "CP-230012",
123-
"OperationCode": "SigntoolVerify",
124-
"Parameters": {},
125-
"ToolName": "sign",
126-
"ToolVersion": "1.0"
127-
}
128-
]
12972
- task: ComponentGovernanceComponentDetection@0
13073
displayName: 'Component Governance Detection'
13174
inputs:

.pipelines/templates/build-cli.yaml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,8 @@ steps:
2828
- script: nbgv cloud
2929
condition: not(startsWith(variables.AgentOS, 'Darwin'))
3030
displayName: Set Version
31-
- script: dotnet build MSStore.CLI --no-restore --self-contained -r ${{ parameters.dotnet_runtime }}-${{ parameters.dotnet_arch }} -f ${{ parameters.dotnet_framework }} /p:Configuration=${{ parameters.dotnet_configuration }}
32-
displayName: Build CLI
33-
- task: DownloadPipelineArtifact@2
34-
inputs:
35-
buildType: 'current'
36-
artifactName: 'NuGetDLLs'
37-
targetPath: '$(System.DefaultWorkingDirectory)/MSStore.CLI/bin/${{ parameters.dotnet_configuration }}/${{ parameters.dotnet_framework }}/${{ parameters.dotnet_runtime }}-${{ parameters.dotnet_arch }}'
38-
- script: dotnet publish MSStore.CLI --no-build --self-contained -r ${{ parameters.dotnet_runtime }}-${{ parameters.dotnet_arch }} -f ${{ parameters.dotnet_framework }} /p:Configuration=${{ parameters.dotnet_configuration }} /p:PublishProfile=${{ parameters.dotnet_runtime }}-${{ parameters.dotnet_arch }}
39-
displayName: Publish NoSelfContained CLI
31+
- script: dotnet publish MSStore.CLI --self-contained -r ${{ parameters.dotnet_runtime }}-${{ parameters.dotnet_arch }} -f ${{ parameters.dotnet_framework }} /p:Configuration=${{ parameters.dotnet_configuration }} /p:PublishProfile=${{ parameters.dotnet_runtime }}-${{ parameters.dotnet_arch }}
32+
displayName: Publish CLI
4033
- ${{ if eq(parameters['DoEsrp'], 'true') }}:
4134
- task: EsrpCodeSigning@5
4235
displayName: Code Sign ESRP - CLI - 3rd Party Dependencies
@@ -50,9 +43,8 @@ steps:
5043
AuthSignCertName: ${{ parameters.signingIdentity.signCertName }}
5144
FolderPath: '$(System.DefaultWorkingDirectory)/MSStore.CLI/bin/${{ parameters.dotnet_configuration }}/${{ parameters.dotnet_framework }}/${{ parameters.dotnet_runtime }}-${{ parameters.dotnet_arch }}/publish'
5245
Pattern: |
53-
Meziantou.Framework.Win32.CredentialManager.dll,
54-
Spectre.Console.dll,
55-
SkiaSharp.dll,
46+
libSkiaSharp.dll,
47+
msalruntime_${{ parameters.dotnet_arch }}.dll,
5648
signConfigType: inlineSignParams
5749
inlineOperation: |
5850
[
@@ -91,12 +83,6 @@ steps:
9183
FolderPath: '$(System.DefaultWorkingDirectory)/MSStore.CLI/bin/${{ parameters.dotnet_configuration }}/${{ parameters.dotnet_framework }}/${{ parameters.dotnet_runtime }}-${{ parameters.dotnet_arch }}/publish'
9284
Pattern: |
9385
msstore.exe
94-
msstore.dll
95-
MSStore.API.dll
96-
Microsoft.*.dll
97-
!Microsoft.Windows.SDK.NET.dll
98-
System.CommandLine*.dll
99-
!System.CommandLine.resources.dll
10086
UseMinimatch: true
10187
signConfigType: inlineSignParams
10288
inlineOperation: |

.pipelines/templates/pack-nuget.yaml

Lines changed: 0 additions & 75 deletions
This file was deleted.

MSStore.CLI/MSStore.CLI.csproj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88
<AssemblyName>msstore</AssemblyName>
99
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1010
<IsAotCompatible>true</IsAotCompatible>
11-
</PropertyGroup>
12-
13-
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
1411
<PublishTrimmed>true</PublishTrimmed>
15-
<PublishAot Condition="'$(PublishAot)' == ''">true</PublishAot>
16-
<PublishSingleFile Condition="'$(PublishSingleFile)' == ''">true</PublishSingleFile>
12+
<PublishAot>true</PublishAot>
13+
<PublishSingleFile>true</PublishSingleFile>
1714
</PropertyGroup>
1815

1916
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">

MSStore.CLI/Properties/PublishProfiles/linux-arm64.pubxml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
1212
<TargetFramework>net10.0</TargetFramework>
1313
<RuntimeIdentifier>linux-arm64</RuntimeIdentifier>
1414
<SelfContained>true</SelfContained>
15-
<PublishSingleFile>true</PublishSingleFile>
16-
<PublishAot>true</PublishAot>
1715
</PropertyGroup>
1816
</Project>

MSStore.CLI/Properties/PublishProfiles/linux-x64.pubxml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
1212
<TargetFramework>net10.0</TargetFramework>
1313
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
1414
<SelfContained>true</SelfContained>
15-
<PublishSingleFile>true</PublishSingleFile>
16-
<PublishAot>true</PublishAot>
1715
</PropertyGroup>
1816
</Project>

MSStore.CLI/Properties/PublishProfiles/osx-arm64.pubxml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
1212
<TargetFramework>net10.0</TargetFramework>
1313
<RuntimeIdentifier>osx-arm64</RuntimeIdentifier>
1414
<SelfContained>true</SelfContained>
15-
<PublishSingleFile>true</PublishSingleFile>
16-
<PublishAot>true</PublishAot>
1715
</PropertyGroup>
1816
</Project>

0 commit comments

Comments
 (0)