Skip to content

Commit

Permalink
Updated project to utilise CI (from ProjectBabble mod)
Browse files Browse the repository at this point in the history
  • Loading branch information
Meister1593 committed Mar 31, 2023
1 parent 7b78d11 commit e1c4c71
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 42 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Autobuild
on: [push, pull_request]

env:
NeosPath: "${{ github.workspace }}/neos_install/"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout NML
uses: actions/checkout@v3
- name: setup build environment
uses: neos-modding-group/neos-plugin-setup-action@master
- name: get NeosModLoader.dll
uses: dsaltares/[email protected]
with:
repo: neos-modding-group/NeosModLoader
file: NeosModLoader.dll
- name: lint
run: dotnet format --verbosity detailed --verify-no-changes ./EyeTrackVR-Neos.csproj
- name: build
run: dotnet build ./EyeTrackVR-Neos.csproj --configuration Release "-property:CopyToMods=false"
- name: upload workflow artifacts
uses: actions/upload-artifact@v3
with:
name: EyeTrackVR-Neos
path: |
./EyeTrackVR-Neos/bin/Release/net462/Rug.Osc.dll
./EyeTrackVR-Neos/bin/Release/net462/EyeTrackVR-Neos.dll
if-no-files-found: error
retention-days: 5
- name: upload release artifacts
if: startsWith(github.ref, 'refs/tags/') # only publish release artifacts for pushes to tags
uses: softprops/action-gh-release@v1
with:
draft: true # if creating a new release, make it a draft
files: |
./EyeTrackVR-Neos/bin/Release/net462/EyeTrackVR-Neos.dll
./EyeTrackVR-Neos/bin/Release/net462/Rug.Osc.dll
fail_on_unmatched_files: true

60 changes: 26 additions & 34 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,61 +1,53 @@
<Project>
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TargetFramework>net462</TargetFramework>
<FileAlignment>512</FileAlignment>
<LangVersion>9</LangVersion>
<BaseOutputPath>..\bin</BaseOutputPath>
<BuildProjectReferences>false</BuildProjectReferences>
<Nullable>enable</Nullable>
<Deterministic>true</Deterministic>
<CopyLocal>false</CopyLocal>
<CopyToMods Condition="'$(CopyToMods)'==''">true</CopyToMods>
<NeosPath>$(MSBuildThisFileDirectory)NeosVR</NeosPath>
<NeosPath Condition="Exists('C:\Program Files (x86)\Steam\steamapps\common\NeosVR\')">C:\Program Files (x86)\Steam\steamapps\common\NeosVR\</NeosPath>
<NeosPath Condition="Exists('$(HOME)/.steam/steam/steamapps/common/NeosVR/')">$(HOME)/.steam/steam/steamapps/common/NeosVR/</NeosPath>
<NeosPath Condition="Exists('/home/plyshka/Games/SteamLibrary/steamapps/common/NeosVR/')">/home/plyshka/Games/SteamLibrary/steamapps/common/NeosVR/</NeosPath>
<GameRefsPath>$(NeosPath)Neos_Data\Managed\</GameRefsPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<DebugSymbols Condition="'$(Configuration)'=='Release'">false</DebugSymbols>
<DebugType Condition="'$(Configuration)'=='Release'">None</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(NeosPath)'==''">
<NeosPath>$(MSBuildThisFileDirectory)NeosVR/</NeosPath>
<NeosPath Condition="Exists('/home/plyshka/Games/SteamLibrary/steamapps/common/NeosVR/')">/home/plyshka/Games/SteamLibrary/steamapps/common/NeosVR/</NeosPath>
<NeosPath Condition="Exists('C:\Program Files (x86)\Steam\steamapps\common\NeosVR\')">C:\Program Files (x86)\Steam\steamapps\common\NeosVR\</NeosPath>
<NeosPath Condition="Exists('$(HOME)/.steam/steam/steamapps/common/NeosVR/')">$(HOME)/.steam/steam/steamapps/common/NeosVR/</NeosPath>
</PropertyGroup>

<ItemGroup>
<Reference Include="NeosModLoader">
<HintPath>$(NeosPath)Libraries\NeosModLoader.dll</HintPath>
<HintPath Condition="Exists('$(NeosPath)NeosModLoader.dll')">$(NeosPath)NeosModLoader.dll</HintPath>
</Reference>
<Reference Include="HarmonyLib">
<HintPath>$(NeosPath)nml_libs\0Harmony.dll</HintPath>
<HintPath Condition="Exists('$(NeosPath)0Harmony.dll')">$(NeosPath)0Harmony.dll</HintPath>
<PackageReference Include="Lib.Harmony" Version="2.2.2" />
<Reference Include="FrooxEngine">
<HintPath>$(NeosPath)Neos_Data\Managed\FrooxEngine.dll</HintPath>
</Reference>
<Reference Include="BaseX">
<HintPath>$(GameRefsPath)BaseX.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>$(NeosPath)Neos_Data\Managed\BaseX.dll</HintPath>
</Reference>
<Reference Include="CodeX">
<HintPath>$(GameRefsPath)CodeX.dll</HintPath>
<HintPath>$(NeosPath)Neos_Data\Managed\CodeX.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>$(GameRefsPath)Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="FrooxEngine">
<HintPath>$(GameRefsPath)FrooxEngine.dll</HintPath>
<HintPath>$(NeosPath)Neos_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>$(GameRefsPath)UnityEngine.dll</HintPath>
<HintPath>$(NeosPath)Neos_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>$(GameRefsPath)UnityEngine.CoreModule.dll</HintPath>
<HintPath>$(NeosPath)Neos_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="NeosModLoader">
<HintPath>$(NeosPath)Libraries\NeosModLoader.dll</HintPath>
<HintPath Condition="Exists('$(NeosPath)NeosModLoader.dll')">$(NeosPath)NeosModLoader.dll</HintPath>
<HintPath Condition="Exists('$(MSBuildProjectDirectory)\..\NeosModLoader.dll')">$(MSBuildProjectDirectory)\..\NeosModLoader.dll</HintPath>
</Reference>
</ItemGroup>


<!-- make all references non-private, so they won't be copied to the output folder -->
<Target Name="ClearReferenceCopyLocalPaths" AfterTargets="ResolveAssemblyReferences">
<ItemGroup>
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" />
</ItemGroup>
</Target>

<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(CopyToMods)'=='true'">
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(NeosPath)nml_mods" />
<Message Text="Copied $(TargetFileName) to $(NeosPath)nml_mods" Importance="high" />
Expand Down
1 change: 0 additions & 1 deletion EyeTrackVR-Neos.Tests/EyeTrackVR-Neos.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
<HintPath>$(NeosPath)Rug.Osc.dll</HintPath>
</Reference>
</ItemGroup>
<OutputType>exe</OutputType>
</Project>
4 changes: 4 additions & 0 deletions EyeTrackVR-Neos.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<MSBuild Projects="@(ProjectFiles)" Targets="Rebuild" />
</Target>

<Target Name="Clean">
<MSBuild Projects="@(ProjectFiles)" Targets="Clean" />
</Target>

<Target Name="Restore">
<MSBuild Projects="@(ProjectFiles)" Targets="Restore" />
</Target>
Expand Down
9 changes: 2 additions & 7 deletions EyeTrackVR-Neos/EyeTrackVR-Neos.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<Reference Include="Unity.InputSystem">
<HintPath>$(GameRefsPath)Unity.InputSystem.dll</HintPath>
</Reference>
<Reference Include="Rug.Osc, Version=1.2.5.17694, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(NeosPath)Rug.Osc.dll</HintPath>
</Reference>
<PackageReference Include="Rug.Osc" Version="1.2.5" />
</ItemGroup>
</Project>
</Project>

0 comments on commit e1c4c71

Please sign in to comment.