Skip to content

Commit

Permalink
Merge branch 'release/v8.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaben committed Feb 18, 2024
2 parents 8289a01 + 5f4391e commit 124dbc9
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 37 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build and Push to Nuget

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [8.x]
services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
SA_PASSWORD: trackable_core!@44
ACCEPT_EULA: 'Y'
ports:
- 1433:1433
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'

- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true

- name: Run Tests
run: dotnet test
env:
ConnectionString: Data Source=localhost;User ID=sa;Password=trackable_core!@44;MultipleActiveResultSets=True;Encrypt=False;

- name: Pack
run: dotnet build -c Release -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg

- name: Publish
if: github.event_name != 'pull_request' && (github.ref_name == 'master')
run: |
dotnet nuget push **/*.nupkg --source 'https://api.nuget.org/v3/index.json' -k ${{ secrets.NUGETKEY }} --skip-duplicate
dotnet nuget push **/*.snupkg --source 'https://api.nuget.org/v3/index.json' -k ${{ secrets.NUGETKEY }} --skip-duplicate
45 changes: 45 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<Project>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PackageVersion>8.0.0</PackageVersion>
<Authors>Tony Sneed</Authors>
<Company>Tony Sneed</Company>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/TrackableEntities/TrackableEntities.Core</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
https://github.com/TrackableEntities/TrackableEntities.Core/releases/tag/v8.0.0
</PackageReleaseNotes>
</PropertyGroup>

<PropertyGroup>
<RepositoryUrl>https://github.com/TrackableEntities/TrackableEntities.Core.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
<None Include="icon.png" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>

5 changes: 5 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mode: Mainline
branches: {}
ignore:
sha: []
merge-message-formats: {}
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PackageId>TrackableEntities.Common.Core</PackageId>
<PackageVersion>8.0.0</PackageVersion>
<Authors>Tony Sneed</Authors>
<Company>Tony Sneed</Company>
<Title>Trackable Entities Common</Title>
<Description>Assembly containing TrackingState enum and ITrackable, IMergeable interfaces.</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>https://github.com/TrackableEntities/TrackableEntities.Core/releases/tag/v8.0.0</PackageReleaseNotes>
<PackageTags>change-tracking entity-framework-core n-tier</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/TrackableEntities/TrackableEntities.Core</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<None Include="icon.png" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>


</Project>
30 changes: 30 additions & 0 deletions TrackableEntities.EF.Core.Tests/Helpers/DbContextOptionsHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;

using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;

namespace TrackableEntities.EF.Core.Tests.Helpers
{
public static class DbContextOptionsHelper
{
public static DbContextOptions<TContext> GetContextOptions<TContext>(string initialCatalog)
where TContext : DbContext
{
// default connection string for tests 'LocalDb'
var connectionString =
@"Data Source=(localdb)\MSSQLLocalDB; Initial Catalog=FamilyTest; Integrated Security=True; MultipleActiveResultSets=True";

if (Environment.GetEnvironmentVariable("ConnectionString") != null)
{
// LocalDb isn't supported in Linux. To support running tests, allow env variable for conn string
connectionString = Environment.GetEnvironmentVariable("ConnectionString");
}

var builder = new SqlConnectionStringBuilder(connectionString) { InitialCatalog = initialCatalog };

return new DbContextOptionsBuilder<TContext>()
.UseSqlServer(builder.ConnectionString)
.Options;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ public void Initialize(bool useInMemory = true, Action seedData = null)
}
else
{
_options = new DbContextOptionsBuilder<FamilyDbContext>()
.UseSqlServer(@"Data Source=(localdb)\MSSQLLocalDB; Initial Catelog=FamilyTest; Integrated Security=True; MultipleActiveResultSets=True")
.Options;
_options = DbContextOptionsHelper.GetContextOptions<FamilyDbContext>("FamilyTest");
}
_context = new FamilyDbContext(_options);
_context.Database.EnsureCreated();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public void Initialize(bool useInMemory = true, Action seedData = null)
}
else
{
_options = new DbContextOptionsBuilder<NorthwindDbContext>()
.UseSqlServer(@"Data Source=(localdb)\MSSQLLocalDB; Initial Catalog=NorthwindTest; Integrated Security=True; MultipleActiveResultSets=True")
.Options;
_options = DbContextOptionsHelper.GetContextOptions<NorthwindDbContext>("NorthwindTest");
}
_context = new NorthwindDbContext(_options);
_context.Database.EnsureCreated(); // If login error, manually create NorthwindTest database
Expand Down
16 changes: 1 addition & 15 deletions TrackableEntities.EF.Core/TrackableEntities.EF.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PackageVersion>8.0.0</PackageVersion>
<Authors>Tony Sneed</Authors>
<Company>Tony Sneed</Company>
<PackageId>TrackableEntities.EF.Core</PackageId>
<Title>Trackable Entities for EF Core</Title>
<Description>Provides an ApplyChanges extension method for DbContext that sets EntityState on trackable entities, so they can be saved by a service in a single transaction</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/TrackableEntities/TrackableEntities.Core</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
<PackageTags>change-tracking entity-framework-core n-tier</PackageTags>
<PackageReleaseNotes>https://github.com/TrackableEntities/TrackableEntities.Core/releases/tag/v7.0.0</PackageReleaseNotes>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>TrackableEntities.EF.Core</PackageId>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<None Include="icon.png" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
</ItemGroup>
Expand Down

0 comments on commit 124dbc9

Please sign in to comment.