-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
137 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mode: Mainline | ||
branches: {} | ||
ignore: | ||
sha: [] | ||
merge-message-formats: {} |
17 changes: 1 addition & 16 deletions
17
TrackableEntities.Common.Core/TrackableEntities.Common.Core.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
30
TrackableEntities.EF.Core.Tests/Helpers/DbContextOptionsHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters