Skip to content

Commit 100422f

Browse files
KaBooMaomar-akermi
andauthored
Initial release & deployment for ts (#8)
* PhoneApp * * Implementation of new interfaces to help us internally * Misc internal additions for il2cpp / mono compatibility * Fixes to save and load processes * initial workflow deployment (#2) * initial workflow deployment * Added additional reruns for workflow * Updated assembly references * Updated assembly references * Updated proj path in workflow * Resolved PhoneApp deps * Disabled BuildUI in PhoneApp til @omar-akermi can review * Removed local post-build scripts * Fixed casing on deps * feat(semantic-verisioning): Added initial deployment functionality using semantic versioning Initial prep work for release deployment * Setup plugin to dynamically load S1API based on Il2Cpp/Mono (#6) * Added new S1APILoader.cs MelonPlugin. Mod now is intended to go inside Plugins/S1API. The plugin will load the correct version. * Added automated deployment while editing csproj files * Updated to build entire solution * Publishing (#7) publishing automation for stable * * Implementation of new interfaces to help us internally * Misc internal additions for il2cpp / mono compatibility * Fixes to save and load processes * PhoneApp * initial workflow deployment (#2) * initial workflow deployment * Added additional reruns for workflow * Updated assembly references * Updated assembly references * Updated proj path in workflow * Resolved PhoneApp deps * Disabled BuildUI in PhoneApp til @omar-akermi can review * Removed local post-build scripts * Fixed casing on deps * feat(semantic-verisioning): Added initial deployment functionality using semantic versioning Initial prep work for release deployment * Setup plugin to dynamically load S1API based on Il2Cpp/Mono (#6) * Added new S1APILoader.cs MelonPlugin. Mod now is intended to go inside Plugins/S1API. The plugin will load the correct version. * Added automated deployment while editing csproj files * Updated to build entire solution * Publishing (#7) publishing automation for stable * Added icon for ts deploy * Removed example phone app from mod init --------- Co-authored-by: Omar Akermi <mrakermi@gmail.com>
1 parent 73356bf commit 100422f

File tree

13 files changed

+215
-25
lines changed

13 files changed

+215
-25
lines changed

.github/workflows/deploy-build.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Deploy Build
2+
3+
on:
4+
push:
5+
branches:
6+
- stable
7+
8+
jobs:
9+
build:
10+
name: Build and Release
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
id-token: write
15+
16+
steps:
17+
- name: Checkout Repo
18+
uses: actions/checkout@v4
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v4
22+
23+
- name: Clone game assemblies from private repo
24+
run: |
25+
git clone https://x-access-token:${{ secrets.GH_PAT }}@github.com/KaBooMa/ScheduleOneAssemblies.git ./ScheduleOneAssemblies
26+
27+
- name: Restore .NET dependencies
28+
run: dotnet restore
29+
30+
# Install Node.js and semantic-release
31+
- name: Set up Node.js
32+
uses: actions/setup-node@v4
33+
34+
- name: Install semantic-release via NPM
35+
run: |
36+
npm install -g semantic-release
37+
38+
# Run semantic-release to handle versioning, changelog, and release
39+
- name: Run semantic-release
40+
id: semantic-release
41+
uses: cycjimmy/semantic-release-action@v4
42+
with:
43+
branches: |
44+
[
45+
'stable'
46+
]
47+
extra_plugins: |
48+
@semantic-release/changelog
49+
@semantic-release/exec
50+
@semantic-release/git
51+
env:
52+
GH_TOKEN: ${{ secrets.GH_PAT }}
53+
54+
- name: Update MelonInfo version for S1API and S1APILoader
55+
run: |
56+
sed -i "s/{VERSION_NUMBER}/${{ steps.semantic-release.outputs.new_release_version }}/" ./S1API/S1API.cs
57+
sed -i "s/{VERSION_NUMBER}/${{ steps.semantic-release.outputs.new_release_version }}/" ./S1APILoader/S1APILoader.cs
58+
59+
- name: Run .NET build for Mono
60+
run: dotnet build ./S1API.sln -c Mono -f netstandard2.1
61+
62+
- name: Run .NET build for Il2Cpp
63+
run: dotnet build ./S1API.sln -c Il2Cpp -f netstandard2.1
64+
65+
- name: Build artifact zip for Thunderstore
66+
run: |
67+
mkdir -p ./artifacts/thunderstore/Plugins/S1API
68+
cp ./S1APILoader/bin/Mono/netstandard2.1/S1APILoader.dll ./artifacts/thunderstore/Plugins/S1APILoader.dll
69+
cp ./S1API/bin/Il2Cpp/netstandard2.1/S1API.dll ./artifacts/thunderstore/Plugins/S1API/S1API.Il2Cpp.dll
70+
cp ./S1API/bin/Mono/netstandard2.1/S1API.dll ./artifacts/thunderstore/Plugins/S1API/S1API.Mono.dll
71+
72+
- name: Publish artifact to Thunderstore
73+
uses: GreenTF/upload-thunderstore-package@v4.3
74+
with:
75+
namespace: KaBooMa
76+
description: S1API
77+
token: ${{ secrets.TS_TOKEN }}
78+
name: s1api
79+
version: ${{ steps.semantic-release.outputs.new_release_version }}
80+
community: schedule-i
81+
icon: https://github.com/KaBooMa/S1API/blob/stable/Public/logo_compressed.png?raw=true
82+
deps: LavaGang-MelonLoader-0.7.0
83+
path: ./artifacts/thunderstore
84+
categories: |
85+
mono
86+
il2cpp
87+
libraries

.github/workflows/verify-build.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
- synchronize
99
branches:
1010
- bleeding-edge
11-
- stable
1211

1312
jobs:
1413
build:
@@ -30,7 +29,7 @@ jobs:
3029
run: dotnet restore
3130

3231
- name: Run .NET Build for Mono
33-
run: dotnet build ./S1API/S1API.csproj -c Mono -f netstandard2.1
32+
run: dotnet build ./S1API.sln -c Mono -f netstandard2.1
3433

3534
- name: Run .NET Build for Il2Cpp
36-
run: dotnet build ./S1API/S1API.csproj -c Il2Cpp -f netstandard2.1
35+
run: dotnet build ./S1API.sln -c Il2Cpp -f netstandard2.1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ obj/
55
bin/
66
*.user
77

8+
Directory.Build.props
9+
810
# Local assembly references
911
ScheduleOneAssemblies/

.releaserc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
"@semantic-release/changelog",
6+
"@semantic-release/github"
7+
],
8+
"branches": [
9+
"stable"
10+
]
11+
}

Example.Directory.Build.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project>
2+
<PropertyGroup>
3+
<AutomateLocalDeployment>true</AutomateLocalDeployment>
4+
<LocalIl2CppDeploymentPath>C:\Program Files (x86)\Steam\steamapps\common\Schedule I</LocalIl2CppDeploymentPath>
5+
<LocalMonoDeploymentPath>C:\Program Files (x86)\Steam\steamapps\common\Schedule I</LocalMonoDeploymentPath>
6+
</PropertyGroup>
7+
</Project>

Public/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
![logo](https://github.com/KaBooMa/S1API/tree/stable/Public/logo.png)
2+
3+
# A Schedule One Mono / Il2Cpp Cross Compatibility Layer
4+
S1API is an open source collaboration project to help standardize Schedule One modding processes.
5+
The goal is to provide a standard place for common functionalities so you can focus on making content versus reverse engineering the game.
6+
7+
## Do I need this?
8+
If you're using or plan to use any mods that depend on S1API, then yes.
9+
10+
## How do I use this to make mods?
11+
Go check out the extremely helpful resources on our [GitHub](https://github.com/KaBooMa/S1API).
12+
13+
## I'm getting errors from S1API, what do I do?
14+
Please head over to the [GitHub](https://github.com/KaBooMa/S1API) page and create a new issue for us.
15+
You can also post in the modding Discord under our thread 😀.
16+
17+
___
18+
19+
# Drop us an endorsement ❤️
20+
21+
It's not easy being an API. Content is always king, not the backend glue!
22+
Endorsements are free and really helps drive our motivation for this project.

Public/logo.png

1.78 MB
Loading

Public/logo_compressed.png

93.2 KB
Loading

S1API.sln

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@
22
Microsoft Visual Studio Solution File, Format Version 12.00
33
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "S1API", "S1API\S1API.csproj", "{D2C9A6B1-B9E0-4E6D-AE65-B5264C2A4E04}"
44
EndProject
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "S1APILoader", "S1APILoader\S1APILoader.csproj", "{B97277C2-27FE-4BB9-AB5A-D479C8DF6827}"
6+
EndProject
57
Global
68
GlobalSection(SolutionConfigurationPlatforms) = preSolution
79
Mono|Any CPU = Mono|Any CPU
8-
IL2CPP|Any CPU = IL2CPP|Any CPU
10+
Il2Cpp|Any CPU = Il2Cpp|Any CPU
911
EndGlobalSection
1012
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1113
{D2C9A6B1-B9E0-4E6D-AE65-B5264C2A4E04}.Mono|Any CPU.ActiveCfg = Mono|Any CPU
1214
{D2C9A6B1-B9E0-4E6D-AE65-B5264C2A4E04}.Mono|Any CPU.Build.0 = Mono|Any CPU
13-
{D2C9A6B1-B9E0-4E6D-AE65-B5264C2A4E04}.IL2CPP|Any CPU.ActiveCfg = IL2CPP|Any CPU
14-
{D2C9A6B1-B9E0-4E6D-AE65-B5264C2A4E04}.IL2CPP|Any CPU.Build.0 = IL2CPP|Any CPU
15+
{D2C9A6B1-B9E0-4E6D-AE65-B5264C2A4E04}.Il2Cpp|Any CPU.ActiveCfg = Il2Cpp|Any CPU
16+
{D2C9A6B1-B9E0-4E6D-AE65-B5264C2A4E04}.Il2Cpp|Any CPU.Build.0 = Il2Cpp|Any CPU
17+
{B97277C2-27FE-4BB9-AB5A-D479C8DF6827}.Mono|Any CPU.ActiveCfg = Mono|Any CPU
18+
{B97277C2-27FE-4BB9-AB5A-D479C8DF6827}.Mono|Any CPU.Build.0 = Mono|Any CPU
19+
{B97277C2-27FE-4BB9-AB5A-D479C8DF6827}.Il2Cpp|Any CPU.ActiveCfg = Il2Cpp|Any CPU
20+
{B97277C2-27FE-4BB9-AB5A-D479C8DF6827}.Il2Cpp|Any CPU.Build.0 = Il2Cpp|Any CPU
1521
EndGlobalSection
1622
EndGlobal

S1API/S1API.cs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,10 @@
11
using MelonLoader;
2-
using S1API.PhoneApp;
3-
[assembly: MelonInfo(typeof(S1API.S1API), "S1API", "1.0.0", "KaBooMa")]
2+
3+
[assembly: MelonInfo(typeof(S1API.S1API), "S1API", "{VERSION_NUMBER}", "KaBooMa")]
44

55
namespace S1API
66
{
77
public class S1API : MelonMod
88
{
9-
public override void OnApplicationStart()
10-
{
11-
PhoneAppManager.Register(new MyAwesomeApp());
12-
}
13-
private bool _isInGame;
14-
15-
public override void OnSceneWasInitialized(int buildIndex, string sceneName)
16-
{
17-
bool nowInGame = sceneName != null && sceneName.Contains("Main");
18-
19-
if (!_isInGame && nowInGame)
20-
{
21-
MelonLogger.Msg("Game scene loaded. Initializing phone apps...");
22-
PhoneAppManager.InitAll(LoggerInstance);
23-
}
24-
}
259
}
2610
}

0 commit comments

Comments
 (0)