-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use arcade infra for DEB and RPM build #45047
Merged
NikolaMilosavljevic
merged 8 commits into
dotnet:main
from
NikolaMilosavljevic:new.installer.infra
Dec 5, 2024
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e50b4b7
Use arcade infra for DEB and RPM build
NikolaMilosavljevic 67515d8
New tasks target location
NikolaMilosavljevic b14ec19
Address PR comments
NikolaMilosavljevic bbba2ab
Remove unused task
NikolaMilosavljevic 8a8da87
Condition debian-specific task
NikolaMilosavljevic 469ffd5
Merge branch 'main' into new.installer.infra
NikolaMilosavljevic 0301e6b
Few small tweaks
NikolaMilosavljevic dfb7abc
Inline CalculateLinuxNativeInstallerDependencyVersions target
NikolaMilosavljevic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
<Project Sdk="Microsoft.Build.NoTargets"> | ||
|
||
<PropertyGroup> | ||
<SkipBuild Condition="'$(BuildSdkDeb)' != 'true' and '$(IsRPMBasedDistro)' != 'true'">true</SkipBuild> | ||
<TargetFramework>$(SdkTargetFramework)</TargetFramework> | ||
<RuntimeIdentifier>$(NETCoreSdkRuntimeIdentifier)</RuntimeIdentifier> | ||
<GenerateInstallers>true</GenerateInstallers> | ||
<BuildDebPackage Condition="'$(BuildSdkDeb)' == 'true'">true</BuildDebPackage> | ||
<BuildRpmPackage Condition="'$(IsRPMBasedDistro)' == 'true'">true</BuildRpmPackage> | ||
<UseArcadeRpmTooling>true</UseArcadeRpmTooling> | ||
<ProductBrandPrefix>Microsoft .NET</ProductBrandPrefix> | ||
<LicenseFile>$(RepoRoot)LICENSE.TXT</LicenseFile> | ||
<InstallerName>dotnet-sdk</InstallerName> | ||
<PackageBrandNameSuffix>SDK</PackageBrandNameSuffix> | ||
<!-- | ||
Installer infra requires MajorVersion and MinorVersion, which triggers reevaluation of Arcade's | ||
VersionPrefix property. This requires PatchVersion to be set in order to produce the correct SDK version. | ||
--> | ||
<MajorVersion>$(VersionMajor)</MajorVersion> | ||
<MinorVersion>$(VersionMinor)</MinorVersion> | ||
<PatchVersion>$(VersionPrefix.Split('.')[2])</PatchVersion> | ||
<!-- | ||
All supported installer runtime identifiers should be specified here. | ||
New arcade infra is only used for Linux installers, at the moment. | ||
--> | ||
<InstallerRuntimeIdentifiers>linux-$(Architecture)</InstallerRuntimeIdentifiers> | ||
<IsShippingPackage>true</IsShippingPackage> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\redist-installer\redist-installer.csproj" ReferenceOutputAssembly="false" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" /> | ||
</ItemGroup> | ||
|
||
<Import Project="$(RepoRoot)src\Tasks\sdk-tasks\sdk-tasks.InTree.targets" /> | ||
|
||
<PropertyGroup> | ||
<RedistLayoutPath>$(ArtifactsBinDir)redist-installer\$(Configuration)\dotnet\</RedistLayoutPath> | ||
<ManpagesDirectory>$(RepoRoot)documentation/manpages/sdk</ManpagesDirectory> | ||
<CLISdkRoot>$(RedistLayoutPath)sdk/</CLISdkRoot> | ||
<TemplatesRoot>$(RedistLayoutPath)templates/</TemplatesRoot> | ||
</PropertyGroup> | ||
|
||
<Target Name="PublishToDisk"> | ||
<Error Condition="'$(OutputPath)' == ''" Text="Publishing to disk requires the OutputPath to be set to the root of the path to write to." /> | ||
|
||
<ItemGroup> | ||
<CLISdkFiles Include="$(CLISdkRoot)**/*" /> | ||
<TemplatesFiles Include="$(TemplatesRoot)**/*" /> | ||
<ManifestFiles Include="$(RedistLayoutPath)sdk-manifests/**/*" /> | ||
</ItemGroup> | ||
|
||
<!-- Create layout: Binaries --> | ||
<Copy | ||
DestinationFiles="@(CLISdkFiles->'$(OutputPath)/sdk/%(RecursiveDir)%(Filename)%(Extension)')" | ||
SourceFiles="@(CLISdkFiles)" | ||
OverwriteReadOnlyFiles="True" | ||
SkipUnchangedFiles="False" | ||
UseHardlinksIfPossible="False" /> | ||
|
||
<!-- Create layout: Templates --> | ||
<Copy | ||
DestinationFiles="@(TemplatesFiles->'$(OutputPath)/templates/%(RecursiveDir)%(Filename)%(Extension)')" | ||
SourceFiles="@(TemplatesFiles)" | ||
OverwriteReadOnlyFiles="True" | ||
SkipUnchangedFiles="False" | ||
UseHardlinksIfPossible="False" /> | ||
|
||
<!-- Create layout: Workload Manifests --> | ||
<Copy | ||
DestinationFiles="@(ManifestFiles->'$(OutputPath)/sdk-manifests/%(RecursiveDir)%(Filename)%(Extension)')" | ||
SourceFiles="@(ManifestFiles)" | ||
OverwriteReadOnlyFiles="True" | ||
SkipUnchangedFiles="False" | ||
UseHardlinksIfPossible="False" /> | ||
</Target> | ||
|
||
<Target Name="SetCustomPackagingProperties" AfterTargets="_GetInstallerProperties"> | ||
<PropertyGroup> | ||
<PackageSummary>Microsoft .NET SDK $(PackageVersion)</PackageSummary> | ||
<!-- Clear PackageDescription to have it correctly set by Arcade. --> | ||
<PackageDescription></PackageDescription> | ||
</PropertyGroup> | ||
|
||
<!-- | ||
Manpages are not installed atm, tracked with https://github.com/dotnet/sdk/issues/44833 | ||
Arcade infra expects the following items, but the installation path is TBD. | ||
Tracked in https://github.com/dotnet/arcade/issues/15243 | ||
|
||
<ItemGroup> | ||
<Manpage Include="$(ManpagesDirectory)**/*" /> | ||
</ItemGroup> | ||
--> | ||
|
||
</Target> | ||
|
||
<Target Name="AddLinuxPackageInformation" | ||
BeforeTargets="GetDebInstallerJsonProperties;GetRpmInstallerJsonProperties" | ||
DependsOnTargets="CalculateLinuxNativeInstallerDependencyVersions"> | ||
|
||
<PropertyGroup> | ||
<DebianPostinstTemplateFile>$(MSBuildThisFileDirectory)../redist-installer/packaging/deb/postinst</DebianPostinstTemplateFile> | ||
<DebianPostinstFile>$(BaseIntermediateOutputPath)debian/postinst</DebianPostinstFile> | ||
</PropertyGroup> | ||
|
||
<!-- Generate postinst file --> | ||
<ReplaceFileContents | ||
InputFiles="$(DebianPostinstTemplateFile)" | ||
DestinationFiles="$(DebianPostinstFile)" | ||
ReplacementPatterns="%SDK_VERSION%" | ||
ReplacementStrings="$(Version)" | ||
Condition="'$(BuildDebPackage)' == 'true'" /> | ||
|
||
<ItemGroup> | ||
<LinuxPackageDependency Include="dotnet-runtime-$(MicrosoftNETCoreAppMajorMinorVersion)" Version="$(MicrosoftNETCoreAppRuntimePackageVersionWithTilde)" /> | ||
<LinuxPackageDependency Include="dotnet-targeting-pack-$(MicrosoftNETCoreAppMajorMinorVersion)" Version="$(MicrosoftNETCoreAppRefPackageVersionWithTilde)" /> | ||
<LinuxPackageDependency Include="dotnet-apphost-pack-$(MicrosoftNETCoreAppMajorMinorVersion)" Version="$(MicrosoftNETCoreAppRuntimePackageVersionWithTilde)" /> | ||
<LinuxPackageDependency Include="netstandard-targeting-pack-$(NetStandardTargetingPackMajorMinorVersion)" Version="$(NetStandardTargetingPackPackageVersionWithTilde)" /> | ||
<LinuxPackageDependency Include="aspnetcore-runtime-$(AspNetCoreMajorMinorVersion)" Version="$(AspNetCoreRuntimeVersionWithTilde)" /> | ||
<LinuxPackageDependency Include="aspnetcore-targeting-pack-$(AspNetCoreMajorMinorVersion)" Version="$(AspNetCoreRefVersionWithTilde)" /> | ||
<LinuxPostInstallScript Include="$(DebianPostinstFile)" Condition="'$(BuildDebPackage)' == 'true'" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="CalculateLinuxNativeInstallerDependencyVersions"> | ||
<GetLinuxNativeInstallerDependencyVersions PackageVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)"> | ||
<Output TaskParameter="VersionWithTilde" PropertyName="MicrosoftNETCoreAppRuntimePackageVersionWithTilde" /> | ||
<Output TaskParameter="MajorMinorVersion" PropertyName="MicrosoftNETCoreAppMajorMinorVersion" /> | ||
<Output TaskParameter="MajorMinorPatchVersion" PropertyName="MicrosoftNETCoreAppMajorMinorPatchVersion" /> | ||
</GetLinuxNativeInstallerDependencyVersions> | ||
|
||
<GetLinuxNativeInstallerDependencyVersions PackageVersion="$(MicrosoftNETCoreAppRefPackageVersion)"> | ||
<Output TaskParameter="VersionWithTilde" PropertyName="MicrosoftNETCoreAppRefPackageVersionWithTilde" /> | ||
</GetLinuxNativeInstallerDependencyVersions> | ||
|
||
<GetLinuxNativeInstallerDependencyVersions PackageVersion="$(MicrosoftAspNetCoreAppRuntimePackageVersion)"> | ||
<Output TaskParameter="VersionWithTilde" PropertyName="AspNetCoreRuntimeVersionWithTilde" /> | ||
<Output TaskParameter="MajorMinorVersion" PropertyName="AspNetCoreMajorMinorVersion" /> | ||
<Output TaskParameter="MajorMinorVersion" PropertyName="AspNetCoreMajorMinorPatchVersion" /> | ||
</GetLinuxNativeInstallerDependencyVersions> | ||
|
||
<GetLinuxNativeInstallerDependencyVersions PackageVersion="$(MicrosoftAspNetCoreAppRefPackageVersion)"> | ||
<Output TaskParameter="VersionWithTilde" PropertyName="AspNetCoreRefVersionWithTilde" /> | ||
</GetLinuxNativeInstallerDependencyVersions> | ||
|
||
<GetLinuxNativeInstallerDependencyVersions PackageVersion="$(HostFxrVersion)"> | ||
<Output TaskParameter="MajorMinorVersion" PropertyName="HostFxrMajorMinorVersion" /> | ||
</GetLinuxNativeInstallerDependencyVersions> | ||
|
||
<GetLinuxNativeInstallerDependencyVersions PackageVersion="$(NETStandardLibraryRefPackageVersion)"> | ||
<Output TaskParameter="VersionWithTilde" PropertyName="NetStandardTargetingPackPackageVersionWithTilde" /> | ||
<Output TaskParameter="MajorMinorVersion" PropertyName="NetStandardTargetingPackMajorMinorVersion" /> | ||
<Output TaskParameter="MajorMinorPatchVersion" PropertyName="NetStandardTargetingPackMajorMinorPatchVersion" /> | ||
</GetLinuxNativeInstallerDependencyVersions> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you set
<UseBrandingNameInLinuxPackageDescription>true</UseBrandingNameInLinuxPackageDescription>
in the property group on the top of the project, you'll get a package summary likeMicrosoft .NET SDK - 10.0.101
instead ofMicrosoft .NET SDK 10.0.101
and (in combination with dotnet/arcade#15308) not need this custom target.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, it's worth waiting for arcade to flow to sdk, to be able to utilize that change and get rid of this target.
Or we can do this as a follow-up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with either waiting or doing this as a follow-up cleanup.