Skip to content
Open
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
43 changes: 43 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI/CD
on: [push, pull_request, workflow_dispatch]
jobs:
job:
permissions: write-all
name: CI/CD
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ hashFiles('**/*.csproj') }}
- name: Get project name
id: project
run: echo "name=$(basename -s .csproj *.csproj)" >> $GITHUB_OUTPUT
- name: Build
run: dotnet build -warnaserror -o mod
- name: Get version
if: github.event_name == 'workflow_dispatch'
id: version
uses: kzrnm/get-net-sdk-project-versions-action@v2
with:
proj-path: ${{ steps.project.outputs.name }}.csproj
- name: Pack release
if: github.event_name == 'workflow_dispatch'
run: |
cd mod
zip -r ../${{ steps.project.outputs.name }}.polymod .
- name: Deploy release
if: github.event_name == 'workflow_dispatch'
run: |
if [[ "${{ steps.version.outputs.version }}" == *"-"* ]]; then
gh release create v${{ steps.version.outputs.version }} ${{ steps.project.outputs.name }}.polymod -p -t v${{ steps.version.outputs.version }}
else
gh release create v${{ steps.version.outputs.version }} ${{ steps.project.outputs.name }}.polymod -t v${{ steps.version.outputs.version }}
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -399,4 +399,7 @@ FodyWeavers.xsd
# JetBrains Rider
*.sln.iml

# End of https://www.toptal.com/developers/gitignore/api/csharp
# End of https://www.toptal.com/developers/gitignore/api/csharpmodFiles/PolyScriptTemplate.dll
*.polymod

*.dll
8 changes: 4 additions & 4 deletions Main.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using BepInEx.Logging;
using PolyMod.Api;

namespace PolyScriptTemplate;
public static class Main
public class Main : PolyScript
{
public static void Load(ManualLogSource logger)
public override void Load()
{
logger.LogMessage("Here we go!");
Logger.LogMessage("Here we go");
}
}
9 changes: 8 additions & 1 deletion PolyScriptTemplate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="PolyMod" Version="*" />
<PackageReference Include="PolyMod" Version="*" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MSBuildTasks" Version="1.5.0.235">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
5 changes: 5 additions & 0 deletions mod/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "template",
"version": "1.0.0",
"authors": ["your_name_here"]
}