Skip to content

Commit

Permalink
add github actions for test
Browse files Browse the repository at this point in the history
  • Loading branch information
kookxiang committed May 5, 2024
1 parent 8d2480e commit ba8377f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/jellyfin-unstable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'Jellyfin (unstable) Plugin'

on:
push:
branches:
- next

permissions:
contents: read
packages: read

jobs:
build:
name: Build Plugin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8
- name: Restore NuGet Packages
run: |
dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name jellyfin-unstable "https://nuget.pkg.github.com/jellyfin/index.json"
dotnet restore
- name: .NET Test
run: dotnet test --configuration Release Jellyfin.Plugin.Bangumi.Test
- name: .NET Publish
run: dotnet publish --configuration Release --output publish Jellyfin.Plugin.Bangumi
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Jellyfin.Plugin.Bangumi
path: publish/*.dll
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0"/>
<PackageReference Include="Jellyfin.Controller" Version="10.9.0-*"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0"/>
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2"/>
<PackageReference Include="MSTest.TestAdapter" Version="3.3.1"/>
<PackageReference Include="MSTest.TestFramework" Version="3.0.2"/>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<ProjectReference Include="..\Jellyfin.Plugin.Bangumi\Jellyfin.Plugin.Bangumi.csproj"/>
</ItemGroup>

Expand Down
12 changes: 1 addition & 11 deletions Jellyfin.Plugin.Bangumi/Jellyfin.Plugin.Bangumi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AnitomySharp" Version="0.2.0"/>
<PackageReference Include="Fastenshtein" Version="1.0.0.8"/>
<PackageReference Include="Jellyfin.Controller" IncludeAssets="compile" Version="10.9.0-*"/>
<PackageReference Include="Newtonsoft.Json" IncludeAssets="compile" Version="13.0.3"/>
</ItemGroup>

<ItemGroup>
Expand All @@ -23,14 +23,4 @@
<ItemGroup>
<InternalsVisibleTo Include="Jellyfin.Plugin.Bangumi.Test"/>
</ItemGroup>

<Target Name="Release" AfterTargets="Build" Condition="'$(Configuration)'=='Release'">
<ItemGroup>
<AssemblyDependencies Include="$(OutputPath)*.dll"/>
</ItemGroup>
<MakeDir Directories="$(OutputPath)zip"/>
<Copy SourceFiles="@(AssemblyDependencies)" DestinationFolder="$(OutputPath)\zip"/>
<ZipDirectory SourceDirectory="$(OutputPath)zip" DestinationFile="$(MSBuildProjectDirectory)\..\$(AssemblyName).zip" Overwrite="true"/>
<RemoveDir Directories="$(OutputPath)zip"/>
</Target>
</Project>

0 comments on commit ba8377f

Please sign in to comment.