Skip to content

Commit

Permalink
Merge pull request #42 from ekonbenefits/build-stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jbtule authored Nov 1, 2024
2 parents 414321a + b3fd6ca commit 923d365
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 18 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build .net core

on: [push]

jobs:
build:
name: Test ${{ matrix.os }} for dotnet ${{ matrix.dotnet }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
dotnet: [ '8.0.x' ]
os: [ubuntu-latest, macOS-latest]

steps:
- uses: actions/checkout@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Build with dotnet core
run: dotnet build --configuration Release
- name: Tests
run: dotnet test DotNetDBF.Test/DotNetDBF.Test.csproj --configuration Release --no-build --no-restore
29 changes: 29 additions & 0 deletions .github/workflows/dotnet48.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: .net framework Windows

on: [push]

jobs:
build:
name: Test Windows .net Framework Only
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: NuGet/setup-nuget@v2
- uses: microsoft/setup-msbuild@v2
with:
dotnet-version: 4.7.2

- name: Restore
run: nuget restore DotNetDBF.sln
- name: Build
run: msbuild DotNetDBF.sln -t:rebuild -property:Configuration=Release
- name: Test
uses: josepho0918/vstest-action@0e887de8dcfab5ce3eecaf4ad6320bb9b3ecf633
with:
testAssembly: DotNetDBF.Test.dll
searchFolder: .\DotNetDBF.Test\bin\Release\*\
runInParallel: true
platform: x64
- name: Publish
run:
dotnet nuget push '${{ github.workspace }}\publish\*.nupkg' --source https://nuget.pkg.github.com/ekonbenefits/index.json --api-key ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
bin
obj
/packages
/publish

*.suo

*.user
.idea/*
.vs/*
.vs/*
6 changes: 6 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>7.0.1</VersionPrefix>
<VersionSuffix Condition=" '$(GITHUB_RUN_NUMBER)' != '' ">preview$(GITHUB_RUN_NUMBER)</VersionSuffix>
</PropertyGroup>
</Project>
8 changes: 8 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<Target Name="CopyPackage" AfterTargets="Pack">
<Copy
SourceFiles="$(OutputPath)$(PackageId).$(PackageVersion).nupkg"
DestinationFolder="$(SolutionDir)\publish"
/>
</Target>
</Project>
9 changes: 4 additions & 5 deletions DotNetDBF.Enumerable/DotNetDBF.Enumerable.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net40;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
<PackageId>dotnetdbf.enumerable</PackageId>
Expand All @@ -12,21 +12,20 @@
<PackageTags>clipper xbase dbf linq</PackageTags>
<PackageLicenseExpression>LGPL-2.1-or-later</PackageLicenseExpression>
<PackageIconUrl>https://github.com/ekonbenefits/dotnetdbf</PackageIconUrl>
<RepositoryUrl>https://github.com/ekonbenefits/dotnetdbf.git</RepositoryUrl>
<RepositoryUrl>https://github.com/ekonbenefits/dotnetdbf</RepositoryUrl>
<RepositoryType>gits</RepositoryType>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<Version>6.0.0.2</Version>
<IncludeSymbols>True</IncludeSymbols>
<IncludeSource>True</IncludeSource>
</PropertyGroup>
<ItemGroup>
<None Include="..\Copying.txt" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="ImpromptuInterface" Version="7.0.1" />
Expand All @@ -35,4 +34,4 @@
<ProjectReference Include="..\DotNetDBF\DotNetDBF.csproj" />
</ItemGroup>

</Project>
</Project>
8 changes: 4 additions & 4 deletions DotNetDBF.Test/DotNetDBF.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net462</TargetFrameworks>
<OutputType Condition="'$(TargetFramework)'!='netcoreapp2.0'">Exe</OutputType>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
<OutputType Condition="'$(TargetFramework)'=='net472'">Exe</OutputType>
<Copyright>Copyright © 2017</Copyright>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.7.1" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.*" />
</ItemGroup>
Expand Down Expand Up @@ -40,4 +40,4 @@
<EmbeddedResource Include="dbfs\dbase_8b_summary.txt" />
<EmbeddedResource Include="dbfs\dbase_f5_summary.txt" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion DotNetDBF.Test/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace DotNetDBF.Test
{
#if !NETCOREAPP2_0
#if NET472
public class Program
{
public static void Main()
Expand Down
9 changes: 6 additions & 3 deletions DotNetDBF.Test/Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -480,14 +480,17 @@ public void ShowPaths()
[Test]
public void Test()
{
string test_dir = @"f:\st\dev\testdata";
if (!System.IO.Directory.Exists(test_dir))
Assert.Ignore();
using (
Stream fis =
File.Open(@"f:\st\dev\testdata\p.dbf",
File.Open($@"{test_dir}\p.dbf" ,
FileMode.OpenOrCreate,
FileAccess.ReadWrite))
using (var reader = new DBFReader(fis)
{
DataMemoLoc = Path.ChangeExtension(@"f:\st\dev\testdata\p.dbf", "DBT")
DataMemoLoc = Path.ChangeExtension($@"{test_dir}\p.dbf", "DBT")
})
{
var readValues = reader.NextRecord();
Expand Down Expand Up @@ -541,4 +544,4 @@ public void ReadSample([CallerMemberName] string name = null)
}
}
}
}
}
7 changes: 3 additions & 4 deletions DotNetDBF/DotNetDBF.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net35;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
<Version>7.0.0.0</Version>
<Company>Ekon Benefits</Company>
<Copyright>Copyright 2009-2017</Copyright>
<Description>This is a basic file parser for reading and writing xBase DBF files particularlly Clipper. Code originally derived from javadbf.</Description>
Expand All @@ -12,7 +11,7 @@
<Authors>Anil Kumar, Jay Tuley</Authors>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<RepositoryUrl>https://github.com/ekonbenefits/dotnetdbf.git</RepositoryUrl>
<RepositoryUrl>https://github.com/ekonbenefits/dotnetdbf</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<IncludeSymbols>True</IncludeSymbols>
<IncludeSource>True</IncludeSource>
Expand All @@ -24,7 +23,7 @@
<None Include="..\Copying.txt" Pack="true" PackagePath=""/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 923d365

Please sign in to comment.