Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
name: Deploy

on:
workflow_dispatch:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v1
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: |
3.1.x
6.0.x
7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Set Assembly Version
run: ./build.sh --task=GitVersion --configuration=Release
- name: Build Library
run: dotnet build --configuration Release --no-restore
- name: Update Version
run: sed -i "s/<Version><\/Version>/<Version>${{ github.event.release.name }}<\/Version>/" ./Float.TinCan.LocalLRSServer/Float.TinCan.LocalLRSServer.csproj
- name: Pack and Upload
run: dotnet pack --configuration Release --no-restore
- name: Deploy to NuGet
env:
FLOAT_NUGET_TOKEN: ${{ secrets.FLOAT_NUGET_TOKEN }}
run: ./build.sh --task=Deploy --configuration=Release --nugetUrl="https://api.nuget.org/v3/index.json" --nugetToken="${FLOAT_NUGET_TOKEN}"
run: dotnet nuget push ./Float.TinCan.LocalLRSServer/bin/Release/Float.TinCan.LocalLRSServer.${{ github.event.release.name }}.nupkg --api-key "${FLOAT_NUGET_TOKEN}" --source https://api.nuget.org/v3/index.json
19 changes: 14 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,23 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: |
3.1.x
6.0.x
7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
run: dotnet test --configuration Release --no-build --verbosity normal --logger:"trx;"
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
**/TestResults/*.trx
4 changes: 3 additions & 1 deletion Float.TinCan.LocalLRSServer.Tests/AgentProfile.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Float.TinCan.LocalLRSServer.Tests
{
public class TestAgentProfile
public sealed class TestAgentProfile: IDisposable
{
class StubServerDelegate : ILRSServerDelegate
{
Expand Down Expand Up @@ -136,5 +136,7 @@ public async Task TestCanGetAgentProfile()
{
localLRS.Close();
}

public void Dispose() => localLRS.Dispose();
}
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<ItemGroup>
<AdditionalFiles Include="../stylecop.json" />
</ItemGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>../stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="NunitXml.TestLogger" Version="3.0.117" />
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0'">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('netcoreapp'))">
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Float.TinCan" Version="1.0.3.29" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="NunitXml.TestLogger" Version="3.0.117" />
<PackageReference Include="Float.TinCan" Version="1.0.3.30" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Float.TinCan.LocalLRSServer\Float.TinCan.LocalLRSServer.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2;net6.0;net7.0</TargetFrameworks>
<AssemblyName>Float.TinCan.LocalLRSServer</AssemblyName>
<AssemblyAuthor>Float</AssemblyAuthor>
<AssemblyDescription>A local LRS server for xAPI.</AssemblyDescription>
Expand All @@ -11,6 +11,8 @@
<Title>$(AssemblyName)</Title>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<LangVersion>9.0</LangVersion>
<ReleaseVersion>1.0.0</ReleaseVersion>
<Version></Version>
</PropertyGroup>
<ItemGroup>
<AdditionalFiles Include="$(SolutionDir)\stylecop.json" />
Expand All @@ -29,13 +31,13 @@
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Float.TinCan" Version="1.0.3.29" />
<PackageReference Include="Float.TinCan" Version="1.0.3.30" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None Include="../readme.md" Pack="true" PackagePath="\"/>
<None Include="../readme.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ Task("GitVersion")
});

Task("Build")
.IsDependentOn("RestorePackages")
.IsDependentOn("GitVersion")
.Does(() =>
{
Expand Down
6 changes: 0 additions & 6 deletions global.json

This file was deleted.

4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ A local LRS server for xAPI.

## Building

First you must restore the nuget libraries

dotnet restore

This project can be built using [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/) or [Cake](https://cakebuild.net/). It is recommended that you build this project by invoking the bootstrap script:

./build.sh
Expand Down