Skip to content

Commit 4a7cd46

Browse files
authored
Merge pull request #27 from KSP2Community/dev
0.8.0 -> Main
2 parents 8e4d280 + 3702eb4 commit 4a7cd46

65 files changed

Lines changed: 3246 additions & 1532 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/on-release.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Publish NuGet and upload release
2-
2+
env:
3+
MOD_ID: 3482
4+
LATEST_GAME_VERSION: 0.2.0
5+
36
on:
47
release:
58
types: [ "published" ]
@@ -32,6 +35,7 @@ jobs:
3235
echo "artifact_name=PatchManager-$version.zip" >> $GITHUB_ENV
3336
echo "zip=$(ls -1 dist/PatchManager-*.zip | head -n 1)" >> $GITHUB_ENV
3437
echo "upload_url=$(wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq '.[0].upload_url' | tr -d \")" >> $GITHUB_ENV
38+
echo "changelog=$(wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq '.[0].body' | tr -d \")" >> $GITHUB_ENV
3539
3640
- name: Check if version exists
3741
id: check-version
@@ -63,3 +67,18 @@ jobs:
6367
asset_name: ${{ env.artifact_name }}
6468
asset_content_type: application/zip
6569

70+
- name: Log in to spacedock
71+
run: |
72+
login_response=$(curl -F username=${{ secrets.SPACEDOCK_USER }} -F password=${{ secrets.SPACEDOCK_PASSWORD }} -c ./cookies "https://spacedock.info/api/login")
73+
login_errored=$(echo $login_response | jq .error)
74+
if [ "$login_errored" = "true" ]; then
75+
echo "Login to space dock errored: $(echo $login_response | jq .reason)"
76+
exit 1
77+
else
78+
echo "Login to space dock successful"
79+
fi
80+
81+
- name: Update mod on spacedock
82+
run: |
83+
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"
84+

PatchManager.sln

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PatchManager.Generic", "src
2020
EndProject
2121
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PatchManager.Resources", "src\PatchManager.Resources\PatchManager.Resources.csproj", "{39580E16-E50B-468A-BFAA-06FBF663AD98}"
2222
EndProject
23-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PatchManager.Planets", "src\PatchManager.Planets\PatchManager.Planets.csproj", "{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}"
24-
EndProject
2523
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PatchManager.Science", "src\PatchManager.Science\PatchManager.Science.csproj", "{E6AD9C2A-D53E-47DD-B48F-7A9AF6ACDC55}"
2624
EndProject
2725
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PatchManager.Missions", "src\PatchManager.Missions\PatchManager.Missions.csproj", "{67F415B1-5651-4426-8D4C-F607CA31A338}"
@@ -114,14 +112,6 @@ Global
114112
{39580E16-E50B-468A-BFAA-06FBF663AD98}.Deploy|Any CPU.Build.0 = Deploy|Any CPU
115113
{39580E16-E50B-468A-BFAA-06FBF663AD98}.DeployAndRun|Any CPU.ActiveCfg = DeployAndRun|Any CPU
116114
{39580E16-E50B-468A-BFAA-06FBF663AD98}.DeployAndRun|Any CPU.Build.0 = DeployAndRun|Any CPU
117-
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
118-
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.Debug|Any CPU.Build.0 = Debug|Any CPU
119-
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.Release|Any CPU.ActiveCfg = Release|Any CPU
120-
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.Release|Any CPU.Build.0 = Release|Any CPU
121-
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU
122-
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.Deploy|Any CPU.Build.0 = Deploy|Any CPU
123-
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.DeployAndRun|Any CPU.ActiveCfg = DeployAndRun|Any CPU
124-
{CDD0B166-F1E1-4EE1-8D1B-D47E269DA981}.DeployAndRun|Any CPU.Build.0 = DeployAndRun|Any CPU
125115
{E6AD9C2A-D53E-47DD-B48F-7A9AF6ACDC55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
126116
{E6AD9C2A-D53E-47DD-B48F-7A9AF6ACDC55}.Debug|Any CPU.Build.0 = Debug|Any CPU
127117
{E6AD9C2A-D53E-47DD-B48F-7A9AF6ACDC55}.Release|Any CPU.ActiveCfg = Release|Any CPU

plugin_template/swinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "Patch Manager",
66
"description": "A mod for generic patching needs similar to KSP 1's Module Manager.",
77
"source": "https://github.com/KSP2Community/PatchManager",
8-
"version": "0.7.3",
8+
"version": "0.8.0",
99
"version_check": "https://raw.githubusercontent.com/KSP2Community/PatchManager/main/plugin_template/swinfo.json",
1010
"ksp2_version": {
1111
"min": "0.2.0",

src/PatchManager.Core/Assets/PatchingManager.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Collections;
22
using KSP.Game;
33
using KSP.Game.Flow;
4+
using MonoMod.Utils;
45
using PatchManager.Core.Cache;
56
using PatchManager.Core.Cache.Json;
67
using PatchManager.Core.Patches.Runtime;
@@ -127,8 +128,11 @@ public static void ImportModPatches(string modName, string modFolder)
127128
}
128129
}
129130

130-
public static void ImportSinglePatch(FileInfo fileInfo)
131-
=> Universe.LoadSinglePatchFile(fileInfo,new DirectoryInfo(BepInEx.Paths.GameRootPath));
131+
public static void ImportSinglePatch(FileInfo fileInfo)
132+
{
133+
Universe.LoadSinglePatchFile(fileInfo, new DirectoryInfo(BepInEx.Paths.GameRootPath));
134+
CurrentPatchHashes.Patches.Add(fileInfo.FullName, Hash.FromFile(fileInfo.FullName));
135+
}
132136

133137
public static void RegisterPatches()
134138
{

src/PatchManager.Generic/SassyPatching/Rulesets/JsonRuleset.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public bool Matches(string label)
2222
/// <inheritdoc />
2323
public ISelectable ConvertToSelectable(string type, string name, string jsonData)
2424
{
25-
Console.WriteLine($"Converting to JTokenSelectable {type}:{name}");
2625
return new JTokenSelectable(() => { }, JToken.Parse(jsonData), name, type);
2726
}
2827

src/PatchManager.Planets/PatchManager.Planets.csproj

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/PatchManager.Planets/PlanetsModule.cs

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)