-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.props
27 lines (26 loc) · 1.42 KB
/
Directory.Build.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<Project>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Authors>MelonMesa</Authors>
<Copyright>Copyright © $([System.DateTime]::Now.Year) MelonMesa</Copyright>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<ContainerRuntimeIdentifier>linux-x64</ContainerRuntimeIdentifier>
<ContainerRegistry>ghcr.io</ContainerRegistry>
</PropertyGroup>
<Choose>
<When Condition="'$(GITHUB_SHA)' != ''">
<PropertyGroup>
<SourceRevisionId>$(GITHUB_SHA)</SourceRevisionId>
</PropertyGroup>
</When>
<When Condition="'$(SourceRevisionId)' == ''">
<PropertyGroup>
<DotGitDir>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory).git'))</DotGitDir>
<HeadFileContent Condition="Exists('$(DotGitDir)/HEAD')">$([System.IO.File]::ReadAllText('$(DotGitDir)/HEAD').Trim())</HeadFileContent>
<RefPath Condition="$(HeadFileContent.StartsWith('ref: '))">$(DotGitDir)/$(HeadFileContent.Substring(5))</RefPath>
<SourceRevisionId Condition="'$(RefPath)' != '' AND Exists('$(RefPath)')">$([System.IO.File]::ReadAllText('$(RefPath)').Trim())</SourceRevisionId>
<SourceRevisionId Condition="'$(HeadFileContent)' != '' AND '$(RefPath)' == ''">$(HeadFileContent)</SourceRevisionId>
</PropertyGroup>
</When>
</Choose>
</Project>