mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-06 07:43:36 +00:00
deployment: Add Modrinth deployment configuration and service integration
This commit is contained in:
27
tools/deployment/example-config.json
Normal file
27
tools/deployment/example-config.json
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"project_id": "fancyholograms",
|
||||||
|
"plugin_jar_path": "../../../plugins/fancyholograms/build/libs/FancyHolograms-*.jar",
|
||||||
|
"changelog_path": "../../../plugins/fancyholograms/CHANGELOG.md",
|
||||||
|
"version": "3.0.0",
|
||||||
|
"supported_versions":[
|
||||||
|
"1.19.4",
|
||||||
|
"1.20",
|
||||||
|
"1.20.1",
|
||||||
|
"1.20.2",
|
||||||
|
"1.20.3",
|
||||||
|
"1.20.4",
|
||||||
|
"1.20.5",
|
||||||
|
"1.20.6",
|
||||||
|
"1.21",
|
||||||
|
"1.21.1",
|
||||||
|
"1.21.2",
|
||||||
|
"1.21.3",
|
||||||
|
"1.21.4"
|
||||||
|
],
|
||||||
|
"channel": "release",
|
||||||
|
"loaders": [
|
||||||
|
"paper",
|
||||||
|
"folia"
|
||||||
|
],
|
||||||
|
"featured": true
|
||||||
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
package de.oliver.deployment;
|
package de.oliver.deployment;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
import de.oliver.deployment.modrinth.ModrinthService;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
@@ -9,6 +12,15 @@ public class Main {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
String configFilePath = args[0];
|
String configFilePath = args[0];
|
||||||
Configuration configuration = GSON.fromJson(configFilePath, Configuration.class);
|
Configuration configuration = GSON.fromJson(configFilePath, Configuration.class);
|
||||||
|
|
||||||
|
String modrinthApiKey = System.getenv("MODRINTH_API_KEY");
|
||||||
|
ModrinthService modrinthService = new ModrinthService(modrinthApiKey);
|
||||||
|
try {
|
||||||
|
modrinthService.deployPlugin(configuration);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ public record CreateVersionRequest(
|
|||||||
@SerializedName("version_type") String versionType,
|
@SerializedName("version_type") String versionType,
|
||||||
String[] loaders,
|
String[] loaders,
|
||||||
boolean featured,
|
boolean featured,
|
||||||
|
String status,
|
||||||
@SerializedName("project_id") String projectId,
|
@SerializedName("project_id") String projectId,
|
||||||
@SerializedName("file_parts") String[] fileParts,
|
@SerializedName("file_parts") String[] fileParts,
|
||||||
@SerializedName("primary_file") String primaryFile
|
@SerializedName("primary_file") String primaryFile
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public class ModrinthService {
|
|||||||
config.channel(),
|
config.channel(),
|
||||||
config.loaders(),
|
config.loaders(),
|
||||||
config.featured(),
|
config.featured(),
|
||||||
|
"draft",
|
||||||
config.projectID(),
|
config.projectID(),
|
||||||
new String[]{"plugin"},
|
new String[]{"plugin"},
|
||||||
"plugin"
|
"plugin"
|
||||||
|
|||||||
Reference in New Issue
Block a user