-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.targets
28 lines (25 loc) · 1.19 KB
/
Directory.Build.targets
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
28
<Project>
<Target Name="SetSourceRevisionId" BeforeTargets="MinVer">
<ItemGroup>
<AssemblyMetadata Include="SourceRevisionId" Value="$(SourceRevisionId)"/>
</ItemGroup>
</Target>
<Target Name="SetMinVerVersionAttr" AfterTargets="MinVer">
<ItemGroup>
<AssemblyMetadata Include="MinVerVersion" Value="$(MinVerVersion)"/>
</ItemGroup>
</Target>
<Target Name="SetContainerImageTags" AfterTargets="MinVer">
<PropertyGroup>
<ContainerImageTags>$(Version);latest</ContainerImageTags>
</PropertyGroup>
</Target>
<Target Name="SetPRContainerImageTags" AfterTargets="SetContainerImageTags" Condition="'$(GITHUB_ACTIONS)'=='true' And '$(GITHUB_EVENT_NAME)'=='pull_request'">
<PropertyGroup>
<PackageVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch)-pr.$(PRNumber).$(MinVerPreRelease)</PackageVersion>
<PackageVersion Condition="'$(MinVerBuildMetadata)' != ''">$(PackageVersion)+$(MinVerBuildMetadata)</PackageVersion>
<Version>$(PackageVersion)</Version>
<ContainerImageTags>$(Version)</ContainerImageTags>
</PropertyGroup>
</Target>
</Project>