Skip to content

Commit

Permalink
Merge pull request #27 from KSP2Community/dev
Browse files Browse the repository at this point in the history
0.8.0 -> Main
  • Loading branch information
cheese3660 authored Jan 1, 2024
2 parents 8e4d280 + 3702eb4 commit 4a7cd46
Show file tree
Hide file tree
Showing 65 changed files with 3,246 additions and 1,532 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Publish NuGet and upload release

env:
MOD_ID: 3482
LATEST_GAME_VERSION: 0.2.0

on:
release:
types: [ "published" ]
Expand Down Expand Up @@ -32,6 +35,7 @@ jobs:
echo "artifact_name=PatchManager-$version.zip" >> $GITHUB_ENV
echo "zip=$(ls -1 dist/PatchManager-*.zip | head -n 1)" >> $GITHUB_ENV
echo "upload_url=$(wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq '.[0].upload_url' | tr -d \")" >> $GITHUB_ENV
echo "changelog=$(wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq '.[0].body' | tr -d \")" >> $GITHUB_ENV
- name: Check if version exists
id: check-version
Expand Down Expand Up @@ -63,3 +67,18 @@ jobs:
asset_name: ${{ env.artifact_name }}
asset_content_type: application/zip

- name: Log in to spacedock
run: |
login_response=$(curl -F username=${{ secrets.SPACEDOCK_USER }} -F password=${{ secrets.SPACEDOCK_PASSWORD }} -c ./cookies "https://spacedock.info/api/login")
login_errored=$(echo $login_response | jq .error)
if [ "$login_errored" = "true" ]; then
echo "Login to space dock errored: $(echo $login_response | jq .reason)"
exit 1
else
echo "Login to space dock successful"
fi
- name: Update mod on spacedock
run: |
curl -b ./cookies -F "version=${{ env.version }}" -F "changelog=${{ env.changelog }}" -F "game-version=${{ env.LATEST_GAME_VERSION}}" -F "notify-followers=yes" -F "zipball=@${{ env.zip }}" "https://spacedock.info/api/mod/${{ env.MOD_ID }}/update"
10 changes: 0 additions & 10 deletions PatchManager.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PatchManager.Generic", "src
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PatchManager.Resources", "src\PatchManager.Resources\PatchManager.Resources.csproj", "{39580E16-E50B-468A-BFAA-06FBF663AD98}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PatchManager.Planets", "src\PatchManager.Planets\PatchManager.Planets.csproj", "{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PatchManager.Science", "src\PatchManager.Science\PatchManager.Science.csproj", "{E6AD9C2A-D53E-47DD-B48F-7A9AF6ACDC55}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PatchManager.Missions", "src\PatchManager.Missions\PatchManager.Missions.csproj", "{67F415B1-5651-4426-8D4C-F607CA31A338}"
Expand Down Expand Up @@ -114,14 +112,6 @@ Global
{39580E16-E50B-468A-BFAA-06FBF663AD98}.Deploy|Any CPU.Build.0 = Deploy|Any CPU
{39580E16-E50B-468A-BFAA-06FBF663AD98}.DeployAndRun|Any CPU.ActiveCfg = DeployAndRun|Any CPU
{39580E16-E50B-468A-BFAA-06FBF663AD98}.DeployAndRun|Any CPU.Build.0 = DeployAndRun|Any CPU
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.Release|Any CPU.Build.0 = Release|Any CPU
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.Deploy|Any CPU.Build.0 = Deploy|Any CPU
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.DeployAndRun|Any CPU.ActiveCfg = DeployAndRun|Any CPU
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.DeployAndRun|Any CPU.Build.0 = DeployAndRun|Any CPU
{E6AD9C2A-D53E-47DD-B48F-7A9AF6ACDC55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6AD9C2A-D53E-47DD-B48F-7A9AF6ACDC55}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6AD9C2A-D53E-47DD-B48F-7A9AF6ACDC55}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
2 changes: 1 addition & 1 deletion plugin_template/swinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Patch Manager",
"description": "A mod for generic patching needs similar to KSP 1's Module Manager.",
"source": "https://github.com/KSP2Community/PatchManager",
"version": "0.7.3",
"version": "0.8.0",
"version_check": "https://raw.githubusercontent.com/KSP2Community/PatchManager/main/plugin_template/swinfo.json",
"ksp2_version": {
"min": "0.2.0",
Expand Down
8 changes: 6 additions & 2 deletions src/PatchManager.Core/Assets/PatchingManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections;
using KSP.Game;
using KSP.Game.Flow;
using MonoMod.Utils;
using PatchManager.Core.Cache;
using PatchManager.Core.Cache.Json;
using PatchManager.Core.Patches.Runtime;
Expand Down Expand Up @@ -127,8 +128,11 @@ public static void ImportModPatches(string modName, string modFolder)
}
}

public static void ImportSinglePatch(FileInfo fileInfo)
=> Universe.LoadSinglePatchFile(fileInfo,new DirectoryInfo(BepInEx.Paths.GameRootPath));
public static void ImportSinglePatch(FileInfo fileInfo)
{
Universe.LoadSinglePatchFile(fileInfo, new DirectoryInfo(BepInEx.Paths.GameRootPath));
CurrentPatchHashes.Patches.Add(fileInfo.FullName, Hash.FromFile(fileInfo.FullName));
}

public static void RegisterPatches()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public bool Matches(string label)
/// <inheritdoc />
public ISelectable ConvertToSelectable(string type, string name, string jsonData)
{
Console.WriteLine($"Converting to JTokenSelectable {type}:{name}");
return new JTokenSelectable(() => { }, JToken.Parse(jsonData), name, type);
}

Expand Down
12 changes: 0 additions & 12 deletions src/PatchManager.Planets/PatchManager.Planets.csproj

This file was deleted.

25 changes: 0 additions & 25 deletions src/PatchManager.Planets/PlanetsModule.cs

This file was deleted.

Loading

0 comments on commit 4a7cd46

Please sign in to comment.