Skip to content

Commit a7dcf8d

Browse files
committed
Fixed nuget package build
1 parent a80030e commit a7dcf8d

5 files changed

Lines changed: 71 additions & 3 deletions

File tree

.github/workflows/BuildAndPublish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ jobs:
3737
with:
3838
dotnet-version: 3.1.202
3939

40-
- name: Build
41-
run: dotnet build FastText.NetWrapper --configuration Release -p:PackageVersion=$GIT_TAG_NAME -o .
40+
- name: Create the package
41+
run: dotnet pack FastText.NetWrapper --configuration Release -p:PackageVersion=$GIT_TAG_NAME -o .
4242

4343
- name: Push the package
4444
env:

FastText.NetWrapper.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\Unit
99
EndProject
1010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleTest", "ConsoleTest\ConsoleTest.csproj", "{8C2DFE2B-9DCE-4236-B933-0D46ED804572}"
1111
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NugetConsoleTest", "NugetConsoleTest\NugetConsoleTest.csproj", "{86AB2CB1-9F72-4BC8-8090-EE14494F5EBE}"
13+
EndProject
1214
Global
1315
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1416
Debug|x64 = Debug|x64
@@ -27,6 +29,10 @@ Global
2729
{8C2DFE2B-9DCE-4236-B933-0D46ED804572}.Debug|x64.Build.0 = Debug|Any CPU
2830
{8C2DFE2B-9DCE-4236-B933-0D46ED804572}.Release|x64.ActiveCfg = Release|Any CPU
2931
{8C2DFE2B-9DCE-4236-B933-0D46ED804572}.Release|x64.Build.0 = Release|Any CPU
32+
{86AB2CB1-9F72-4BC8-8090-EE14494F5EBE}.Debug|x64.ActiveCfg = Debug|Any CPU
33+
{86AB2CB1-9F72-4BC8-8090-EE14494F5EBE}.Debug|x64.Build.0 = Debug|Any CPU
34+
{86AB2CB1-9F72-4BC8-8090-EE14494F5EBE}.Release|x64.ActiveCfg = Release|Any CPU
35+
{86AB2CB1-9F72-4BC8-8090-EE14494F5EBE}.Release|x64.Build.0 = Release|Any CPU
3036
EndGlobalSection
3137
GlobalSection(SolutionProperties) = preSolution
3238
HideSolutionNode = FALSE

FastText.NetWrapper/FastText.NetWrapper.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
6-
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
76
<Title>FastText.NetWrapper</Title>
87
<Authors>Oleg Tarasov</Authors>
98
<Description>Crossplatform .NET wrapper for Facebook's FastText library. Works on Windows, Linux and MacOs!</Description>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<None Include="..\UnitTests\cooking.train.txt">
10+
<Link>cooking.train.txt</Link>
11+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
12+
</None>
13+
<None Include="..\UnitTests\cooking.valid.txt">
14+
<Link>cooking.valid.txt</Link>
15+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
16+
</None>
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
21+
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
22+
</ItemGroup>
23+
24+
</Project>

NugetConsoleTest/Program.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System;
2+
using System.IO;
3+
using Microsoft.Extensions.Logging;
4+
using Serilog;
5+
using Serilog.Extensions.Logging;
6+
using Serilog.Sinks.SystemConsole.Themes;
7+
using FastText.NetWrapper;
8+
9+
namespace NugetConsoleTest
10+
{
11+
class Program
12+
{
13+
static void Main(string[] args)
14+
{
15+
Log.Logger = new LoggerConfiguration()
16+
.MinimumLevel.Debug()
17+
.WriteTo.Console(theme: ConsoleTheme.None)
18+
.CreateLogger();
19+
20+
var log = Log.ForContext<Program>();
21+
var tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
22+
Directory.CreateDirectory(tempDir);
23+
24+
log.Information($"Temp dir: {tempDir}");
25+
26+
string outPath = Path.Combine(tempDir, "cooking.bin");
27+
var fastText = new FastTextWrapper(loggerFactory: new LoggerFactory(new[] {new SerilogLoggerProvider()}));
28+
29+
var ftArgs = FastTextArgs.SupervisedDefaults();
30+
ftArgs.epoch = 15;
31+
ftArgs.lr = 1;
32+
ftArgs.dim = 300;
33+
ftArgs.wordNgrams = 2;
34+
ftArgs.minn = 3;
35+
ftArgs.maxn = 6;
36+
fastText.Supervised("cooking.train.txt", outPath, ftArgs);
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)