Skip to content

Commit

Permalink
Merge pull request #708 from unoplatform/dev/ds/sdk-updater-automation
Browse files Browse the repository at this point in the history
Adjust gitversion
  • Loading branch information
jeromelaban authored Jun 3, 2024
2 parents 070581e + 05a7f54 commit ac8f9f2
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 55 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/uno-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,33 @@ on:
default: 'main'

jobs:
update:
manifest-update:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.300'

- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v0.9.9
with:
versionSpec: '5.10.3'

- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.9
with:
useConfigFile: true
configFilePath: build/gitversion.yml

- name: Run Uno Sdk Updater
run: dotnet run --project tools/Uno.Sdk.Updater
run: dotnet run -c Release --project tools/Uno.Sdk.Updater

- name: Create Pull Request
if: github.event_name != 'pull_request'
Expand Down
138 changes: 85 additions & 53 deletions tools/Uno.Sdk.Updater/Uno.Sdk.Updater.csproj
Original file line number Diff line number Diff line change
@@ -1,57 +1,89 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TemplatesSourceDirectory>$([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)', '..', '..', 'src'))</TemplatesSourceDirectory>
<UnoSdkDirectory>$([MSBuild]::NormalizePath('$(TemplatesSourceDirectory)', 'Uno.Sdk'))</UnoSdkDirectory>
<GitVersion_ToolArgments> /config $([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)', '..', '..', 'build', 'gitversion.yml'))</GitVersion_ToolArgments>
</PropertyGroup>

<ItemGroup>
<None Update="ReadMe.md" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NuGet.Packaging" Version="6.10.0" />
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<Target Name="GenerateLocalFileSystem" BeforeTargets="BeforeCompile">
<PropertyGroup>
<TemplateVersion Condition=" $(TemplateVersion) == '' ">$(Version)</TemplateVersion>
</PropertyGroup>
<ItemGroup>
<_LocalFileSystem Include="$(IntermediateOutputPath)\LocalFileSystem.cs" />
<_FileSystemLine Include="//------------------------------------------------------------------------------" />
<_FileSystemLine Include="// &lt;auto-generated&gt;" />
<_FileSystemLine Include="// This code was auto generated by the build. Changes to this file will be lost." />
<_FileSystemLine Include="// &lt;/auto-generated&gt;" />
<_FileSystemLine Include="//------------------------------------------------------------------------------" />
<_FileSystemLine Include="using Uno.Sdk.Models%3b" />
<_FileSystemLine Include="namespace Uno.Sdk.Updater%3b" />
<_FileSystemLine Include="[global::System.Runtime.CompilerServices.CompilerGenerated]" />
<_FileSystemLine Include="[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]" />
<_FileSystemLine Include="internal static partial class LocalFileSystem" />
<_FileSystemLine Include="{" />
<_FileSystemLine Include="public const string TemplatesSourceDirectory = @&quot;$(TemplatesSourceDirectory)&quot;%3b" />
<_FileSystemLine Include="public const string UnoSdkDirectory = @&quot;$(UnoSdkDirectory)&quot;%3b" />
<_FileSystemLine Include="}" />
</ItemGroup>
<WriteLinesToFile File="%(_LocalFileSystem.Identity)"
Lines="@(_FileSystemLine)"
Overwrite="true" />

<ItemGroup>
<Compile Include="%(_LocalFileSystem.Identity)" />
<_GeneratedCodeFiles Include="%(_LocalFileSystem.Identity)" />
<FileWrites Include="%(_LocalFileSystem.Identity)" />
</ItemGroup>
</Target>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TemplatesSourceDirectory>$([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)', '..', '..', 'src'))</TemplatesSourceDirectory>
<UnoSdkDirectory>$([MSBuild]::NormalizePath('$(TemplatesSourceDirectory)', 'Uno.Sdk'))</UnoSdkDirectory>
</PropertyGroup>

<ItemGroup>
<None Update="ReadMe.md" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NuGet.Packaging" Version="6.10.0" />
</ItemGroup>

<Target Name="GenerateVersion" BeforeTargets="BeforeCompile">

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<GitVersion_FullSemVer Condition="'$(GitVersion_FullSemVer)'==''">255.255.255.255</GitVersion_FullSemVer>
</PropertyGroup>

<Error Condition="'$(GitVersion_FullSemVer)'==''"
Text="The environment variable GitVersion_FullSemVer must be set" />

<ItemGroup>
<_GitVersionFileSystem Include="$(IntermediateOutputPath)\GitVersionInformation.g.cs" />
<_GitVersionFileSystemLine Include="//------------------------------------------------------------------------------" />
<_GitVersionFileSystemLine Include="// &lt;auto-generated&gt;" />
<_GitVersionFileSystemLine Include="// This code was auto generated by the build. Changes to this file will be lost." />
<_GitVersionFileSystemLine Include="// &lt;/auto-generated&gt;" />
<_GitVersionFileSystemLine Include="//------------------------------------------------------------------------------" />
<_GitVersionFileSystemLine Include="using Uno.Sdk.Models%3b" />
<_GitVersionFileSystemLine Include="namespace Uno.Sdk.Updater%3b" />
<_GitVersionFileSystemLine Include="[global::System.Runtime.CompilerServices.CompilerGenerated]" />
<_GitVersionFileSystemLine Include="[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]" />
<_GitVersionFileSystemLine Include="internal static partial class GitVersionInformation" />
<_GitVersionFileSystemLine Include="{" />
<_GitVersionFileSystemLine Include="public const string NuGetVersion = @&quot;$(GitVersion_FullSemVer)&quot;%3b" />
<_GitVersionFileSystemLine Include="}" />
</ItemGroup>
<WriteLinesToFile File="%(_GitVersionFileSystem.Identity)"
Lines="@(_GitVersionFileSystemLine)"
Overwrite="true" />

<ItemGroup>
<Compile Include="%(_GitVersionFileSystem.Identity)" />
<_GeneratedCodeFiles Include="%(_GitVersionFileSystem.Identity)" />
<FileWrites Include="%(_GitVersionFileSystem.Identity)" />
</ItemGroup>
</Target>

<Target Name="GenerateLocalFileSystem" BeforeTargets="BeforeCompile">
<PropertyGroup>
<TemplateVersion Condition=" $(TemplateVersion) == '' ">$(Version)</TemplateVersion>
</PropertyGroup>
<ItemGroup>
<_LocalFileSystem Include="$(IntermediateOutputPath)\LocalFileSystem.cs" />
<_FileSystemLine Include="//------------------------------------------------------------------------------" />
<_FileSystemLine Include="// &lt;auto-generated&gt;" />
<_FileSystemLine Include="// This code was auto generated by the build. Changes to this file will be lost." />
<_FileSystemLine Include="// &lt;/auto-generated&gt;" />
<_FileSystemLine Include="//------------------------------------------------------------------------------" />
<_FileSystemLine Include="using Uno.Sdk.Models%3b" />
<_FileSystemLine Include="namespace Uno.Sdk.Updater%3b" />
<_FileSystemLine Include="[global::System.Runtime.CompilerServices.CompilerGenerated]" />
<_FileSystemLine Include="[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]" />
<_FileSystemLine Include="internal static partial class LocalFileSystem" />
<_FileSystemLine Include="{" />
<_FileSystemLine Include="public const string TemplatesSourceDirectory = @&quot;$(TemplatesSourceDirectory)&quot;%3b" />
<_FileSystemLine Include="public const string UnoSdkDirectory = @&quot;$(UnoSdkDirectory)&quot;%3b" />
<_FileSystemLine Include="}" />
</ItemGroup>
<WriteLinesToFile File="%(_LocalFileSystem.Identity)"
Lines="@(_FileSystemLine)"
Overwrite="true" />

<ItemGroup>
<Compile Include="%(_LocalFileSystem.Identity)" />
<_GeneratedCodeFiles Include="%(_LocalFileSystem.Identity)" />
<FileWrites Include="%(_LocalFileSystem.Identity)" />
</ItemGroup>
</Target>

</Project>

0 comments on commit ac8f9f2

Please sign in to comment.