Skip to content

Commit

Permalink
Code Quality: Add conditional package reference to console project (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lamparter authored Feb 2, 2025
1 parent 173a9a0 commit da051f9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
dotnet-version: '9.0.x'

- name: Restore dependencies
run: dotnet restore
run: dotnet restore /p:GITHUB_ACTIONS=true

- name: Build
run: dotnet build --configuration ${{ matrix.configuration }} --no-restore
run: dotnet build --configuration ${{ matrix.configuration }} --no-restore /p:GITHUB_ACTIONS=true

test:
name: Test
Expand All @@ -52,4 +52,4 @@ jobs:
dotnet-version: '9.0.x'

- name: Test
run: dotnet test --configuration Release --verbosity normal
run: dotnet test --configuration Release --verbosity normal /p:GITHUB_ACTIONS=true
7 changes: 6 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@
<DisplayVersion Condition="'$(ReleaseLevel)' != 'final'">$(DisplayVersion)-$(ReleaseLevel)$(BetaVersion)</DisplayVersion>
<Version>$(DisplayVersion)</Version>
</PropertyGroup>
</Project>

<!-- Deterministic build -->
<PropertyGroup Condition="'$(TF_BUILD)' == 'true' or '$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,13 @@
<PackageReference Include="Riverside.JsonBinder" Version="$(DisplayVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(ContinuousIntegrationBuild)' == 'true'">
<ProjectReference Include="..\Riverside.JsonBinder\Riverside.JsonBinder.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(ContinuousIntegrationBuild)' != 'true'">
<ProjectReference Condition="'$(Configuration)' == 'Debug'" Include="..\Riverside.JsonBinder\Riverside.JsonBinder.csproj" />
<PackageReference Condition="'$(Configuration)' == 'Release'" Include="Riverside.JsonBinder" Version="$(DisplayVersion)" />
</ItemGroup>

</Project>

0 comments on commit da051f9

Please sign in to comment.