Skip to content

Commit

Permalink
First commit with csproj and CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjcowan committed Aug 26, 2024
1 parent b355bbd commit 1ecef4a
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8
source-url: https://nuget.pkg.github.com/mjczone/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} #github action provided token

- name: Set VERSION_NUMBER variable from tag
run: echo "VERSION_NUMBER=${GITHUB_REF_NAME/v/}" >> $GITHUB_ENV

- name: Build
run: dotnet build --configuration Release /p:Version=${VERSION_NUMBER}

- name: Test
run: dotnet test --configuration Release /p:Version=${VERSION_NUMBER} --no-build

- name: Pack
run: dotnet pack --configuration Release /p:Version=${VERSION_NUMBER} --no-build --output nupkgs

- name: Push
run: dotnet nuget push nupkgs/${PACKAGE_ID}.${VERSION_NUMBER}.nupkg
env:
PACKAGE_ID: "DapperMatic"
36 changes: 36 additions & 0 deletions DapperMatic.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{80E77F84-7DB0-4CBF-9E43-4A6E9F1758B2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DapperMatic", "src\DapperMatic\DapperMatic.csproj", "{48C04108-798F-4CED-8874-D146500778EB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{C1CEAB9E-CD38-4AA7-B004-B0248F7C39A7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DapperMatic.Tests", "tests\DapperMatic.Tests\DapperMatic.Tests.csproj", "{9FF5A12B-6617-4492-9BD0-434C58051054}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{48C04108-798F-4CED-8874-D146500778EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{48C04108-798F-4CED-8874-D146500778EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{48C04108-798F-4CED-8874-D146500778EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{48C04108-798F-4CED-8874-D146500778EB}.Release|Any CPU.Build.0 = Release|Any CPU
{9FF5A12B-6617-4492-9BD0-434C58051054}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9FF5A12B-6617-4492-9BD0-434C58051054}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9FF5A12B-6617-4492-9BD0-434C58051054}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9FF5A12B-6617-4492-9BD0-434C58051054}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{48C04108-798F-4CED-8874-D146500778EB} = {80E77F84-7DB0-4CBF-9E43-4A6E9F1758B2}
{9FF5A12B-6617-4492-9BD0-434C58051054} = {C1CEAB9E-CD38-4AA7-B004-B0248F7C39A7}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions src/DapperMatic/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace DapperMatic;

public class Class1
{

}
23 changes: 23 additions & 0 deletions src/DapperMatic/DapperMatic.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PackageId>DapperMatic</PackageId>
<Version>0.0.1</Version>
<Authors>MJC</Authors>
<Company>MJCZone Inc.</Company>
<Description>
Additional extensions leveraging Dapper.
</Description>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.35" />
</ItemGroup>

</Project>
27 changes: 27 additions & 0 deletions tests/DapperMatic.Tests/DapperMatic.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
</ItemGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\DapperMatic\DapperMatic.csproj" />
</ItemGroup>

</Project>
10 changes: 10 additions & 0 deletions tests/DapperMatic.Tests/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace DapperMatic.Tests;

public class UnitTest1
{
[Fact]
public void Test1()
{

}
}

0 comments on commit 1ecef4a

Please sign in to comment.