Skip to content

Commit 12bb9f5

Browse files
committed
fix MinVer usage
1 parent 9f887fd commit 12bb9f5

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
jobs:
8+
build:
9+
name: Continuous Integration
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
filter: tree:0
17+
18+
- name: Set up .NET Core (version from global.json)
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
global-json-file: global.json
22+
23+
- name: dotnet build sources
24+
run: dotnet build src/Sotsera.Sources.Common/Sotsera.Sources.Common.csproj --configuration Release
25+
26+
- name: dotnet test
27+
run: dotnet test --configuration Release
28+
29+
- uses: actions/upload-artifact@v4
30+
with:
31+
name: artifact
32+
path: artifacts/

src/Sotsera.Sources.Common/Sotsera.Sources.Common.csproj

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
<PropertyGroup>
44
<GenerateDocumentationFile>true</GenerateDocumentationFile>
55

6-
<Version>0.0.0-local</Version>
6+
<Version Condition="'$(IsContinuousIntegrationBuild)' != 'true'">0.0.0-local</Version>
7+
<MinVerSkip Condition="'$(IsContinuousIntegrationBuild)' != 'true'">true</MinVerSkip>
8+
<MinVerTagPrefix>v</MinVerTagPrefix>
79

810
<Authors>Alessandro Ghidini</Authors>
911
<Company>Sotsera</Company>
@@ -30,13 +32,20 @@
3032
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);CustomContentTarget</TargetsForTfmSpecificContentInPackage>
3133
</PropertyGroup>
3234

33-
<ItemGroup Condition="'$(IsContinuousIntegrationBuild)' == 'true'">
35+
<ItemGroup>
3436
<PackageReference Include="MinVer">
3537
<PrivateAssets>all</PrivateAssets>
3638
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3739
</PackageReference>
3840
</ItemGroup>
3941

42+
<Target Name="MyTarget" AfterTargets="MinVer">
43+
<PropertyGroup>
44+
<GITHUB_RUN_NUMBER Condition="'$(GITHUB_RUN_NUMBER)' == ''">0</GITHUB_RUN_NUMBER>
45+
<FileVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$(GITHUB_RUN_NUMBER)</FileVersion>
46+
</PropertyGroup>
47+
</Target>
48+
4049
<ItemGroup>
4150
<None Include="../../Readme.md;../../icon.png" Pack="true" PackagePath="/" Visible="false" />
4251
<None Include="Sotsera.Sources.Common.props" Pack="true" PackagePath="build/" Visible="true" Action="Compile" />

0 commit comments

Comments
 (0)