Skip to content
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

ci: Adjust publishing #18203

Merged
merged 16 commits into from
Sep 18, 2024
Merged
1 change: 0 additions & 1 deletion NuGet.Config
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
jeromelaban marked this conversation as resolved.
Show resolved Hide resolved
<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
<add key="Solution Packages" value="src/PackageCache" />
</packageSources>
Expand Down
2 changes: 1 addition & 1 deletion build/Uno.UI.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
</ItemGroup>

<Exec Command="dotnet tool install --tool-path $(MSBuildThisFileDirectory)\tools Uno.PackageDiff --version 1.1.0-dev.25" IgnoreExitCode="true" />
<Exec Command="$(MSBuildThisFileDirectory)\tools\generatepkgdiff.exe --base=%(_diffPackage.Identity) --other=%(_diffPackage.Other) --diffignore=PackageDiffIgnore.xml --outfile=$(OutputDir)\ApiDiff.%(_diffPackage.Identity).$(GITVERSION_SemVer).md" />
<Exec Command="$(MSBuildThisFileDirectory)\tools\generatepkgdiff.exe --base=%(_diffPackage.Identity) --other=%(_diffPackage.Other) --diffignore=PackageDiffIgnore.xml --outfile=$(OutputDir)\ApiDiff\ApiDiff.%(_diffPackage.Identity).$(GITVERSION_SemVer).md" />
</Target>

<Target Name="ValidatePackageReferenceAPI" AfterTargets="BuildNuGetPackage">
Expand Down
2 changes: 1 addition & 1 deletion build/ci/.azure-devops-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,5 @@ jobs:
retryCountOnTaskFailure: 3
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: NugetPackages
ArtifactName: 'Nuget Packages'
ArtifactType: Container
15 changes: 15 additions & 0 deletions build/ci/.azure-devops-publish-nuget-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
jobs:
- download: current
artifact: 'NuGet Packages'
patterns: '**/.nupkg'
displayName: Download artifact WebApp

- deployment: 'Nuget'
displayName: 'Nuget Publish Dev'
environment: 'Uno UI Development'
strategy:
runOnce:
deploy:
steps:
- template: templates/nuget-publish-dev.yml
- template: templates/nuget-publish-public.yml
14 changes: 14 additions & 0 deletions build/ci/.azure-devops-publish-nuget-prod-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
jobs:
- download: current
artifact: 'NuGet Packages'
patterns: '**/.nupkg'
displayName: Download artifact WebApp

- deployment: 'Nuget_Prod_Dev'
displayName: 'Nuget Publish Prod Dev'
environment: 'Uno UI Production'
strategy:
runOnce:
deploy:
steps:
- template: templates/nuget-publish-dev.yml
14 changes: 14 additions & 0 deletions build/ci/.azure-devops-publish-nuget-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
jobs:
- download: current
artifact: 'NuGet Packages'
patterns: '**/.nupkg'
displayName: Download artifact WebApp

- deployment: 'Nuget_Prod_Nuget_Org'
displayName: 'Nuget Publish Prod NuGet.org'
environment: 'Uno UI Production'
strategy:
runOnce:
deploy:
steps:
- template: templates/nuget-publish-public.yml
35 changes: 35 additions & 0 deletions build/ci/.azure-devops-stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@ stages:
macOSImageName: '$(macOSVMImage)'
xCodeRoot: '$(xCodeRoot)'

- stage: packages_tests
displayName: Test Packages
dependsOn:
- packages_build

jobs:
- template: .azure-devops-project-template-tests.yml
parameters:
poolName: '$(windowsScaledPool)'
vmImageWindows: $(windows2022HostedVMImage)
vmPoolLinux: '$(linuxScaledPool)'
macOSImageName: '$(macOSVMImage)'
xCodeRoot: '$(xCodeRoot)'

- stage: unit_tests
displayName: Tests - Unit
dependsOn:
Expand Down Expand Up @@ -227,3 +241,24 @@ stages:
- template: .azure-devops-screenshot-compare.yml
parameters:
poolName: '$(windowsScaledPool)'

##
## Publishing
##
- stage: Publish_Dev
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), not(eq(variables['build.reason'], 'PullRequest')))
dependsOn: packages_build
jobs:
- template: .azure-devops-publish-nuget-dev.yml

- stage: Publish_Prod_Dev
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), not(eq(variables['build.reason'], 'PullRequest')))
dependsOn: packages_build
jobs:
- template: .azure-devops-publish-nuget-prod-dev.yml

- stage: Publish_Prod_Public
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), not(eq(variables['build.reason'], 'PullRequest')))
dependsOn: Publish_Prod_Dev
jobs:
- template: .azure-devops-publish-nuget-prod.yml
9 changes: 9 additions & 0 deletions build/ci/templates/nuget-publish-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
steps:
- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '$(Pipeline.Workspace)/$(Build.DefinitionName)-Signed/**/*.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: '1dd81cbd-cb35-41de-a570-b0df3571a196/e7ce08df-613a-41a3-8449-d42784dd45ce'
allowPackageConflicts: true
verbosityPush: 'Normal'
8 changes: 8 additions & 0 deletions build/ci/templates/nuget-publish-public.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
steps:
- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '$(Pipeline.Workspace)/$(Build.DefinitionName)-Signed/**/*.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'nuget.org uno packages'
verbosityPush: 'Normal'
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"allowPrerelease": false
"allowPrerelease": true
},
"msbuild-sdks": {
"MSBuild.Sdk.Extras": "3.0.44",
Expand Down
Loading