mirror of
https://github.com/Nostalgica-Reverie/Content-Monorepo.git
synced 2026-05-09 00:24:15 +00:00
Compare commits
52 Commits
7a6ee73ab0
...
a2b8f424fa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2b8f424fa | ||
|
|
fac6943aef | ||
|
|
01e7b8f2ca | ||
|
|
19a61f254b | ||
|
|
c8feb12d46 | ||
|
|
0b1489a07a | ||
|
|
2002c06fe5 | ||
|
|
9b3804dc7c | ||
|
|
61a086a0c1 | ||
|
|
5b7d80d78d | ||
|
|
7e50d4d298 | ||
|
|
5a3c1a4966 | ||
|
|
eb1c35ab17 | ||
|
|
d1630bcc89 | ||
|
|
4373a9898e | ||
|
|
451eb46035 | ||
|
|
d2442425ed | ||
|
|
ce25599217 | ||
|
|
16661e1d1f | ||
|
|
e042f45eeb | ||
|
|
cf6dbd5d07 | ||
|
|
2db4e3c87d | ||
|
|
9159abef68 | ||
|
|
bd295412ec | ||
|
|
4386cd0f3c | ||
|
|
1de3b04bdb | ||
|
|
1219c61e3f | ||
|
|
b67ff493d0 | ||
|
|
a5dbd2cc7c | ||
|
|
b220dfed92 | ||
|
|
44ed9f2b6f | ||
|
|
4cba390c32 | ||
|
|
705e9e073d | ||
|
|
39527f45c1 | ||
|
|
46f1d54ddf | ||
|
|
40ae945290 | ||
|
|
06ad38d237 | ||
|
|
9c3f68ce84 | ||
|
|
b64b96c766 | ||
|
|
9d0bcf70ac | ||
|
|
50d9fa2d8a | ||
|
|
4dc7d2e260 | ||
|
|
cd0bd12c8a | ||
|
|
1f42010805 | ||
|
|
b05e5df834 | ||
|
|
5dea7ec546 | ||
|
|
f5b1ae7702 | ||
|
|
0d9c1bd0f3 | ||
|
|
5715e607a5 | ||
|
|
ecd261e01e | ||
|
|
ee2bd275cc | ||
|
|
7bc910830b |
@@ -1,173 +0,0 @@
|
||||
// this was written in 60m
|
||||
use std::{env, fs::{self, File}, io::{Write, Read}, path::Path, process::{Command, exit}};
|
||||
use std::collections::HashSet;
|
||||
use walkdir::WalkDir;
|
||||
use zip::write::SimpleFileOptions;
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = env::args().collect();
|
||||
let short_sha = args.get(1).map(|s| s.as_str()).unwrap_or("unknown");
|
||||
|
||||
println!("detecting changed files...");
|
||||
let output = Command::new("git")
|
||||
.args(["diff-tree", "--no-commit-id", "--name-only", "-r", "HEAD"])
|
||||
.output()
|
||||
.expect("Failed to get git diff");
|
||||
|
||||
let stdout = String::from_utf8_lossy(&output.stdout);
|
||||
|
||||
let mut changed_targets = HashSet::new();
|
||||
|
||||
for line in stdout.lines() {
|
||||
if line.starts_with("external/") || line.starts_with(".actions/") || line.is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let parts: Vec<&str> = line.split('/').collect();
|
||||
if parts.len() >= 2 {
|
||||
changed_targets.insert((parts[0], parts[1]));
|
||||
}
|
||||
}
|
||||
|
||||
if changed_targets.is_empty() {
|
||||
println!(no packs detected in git diff.");
|
||||
return;
|
||||
}
|
||||
|
||||
let _ = fs::create_dir_all("artifacts");
|
||||
let mut all_success = true;
|
||||
|
||||
for (category, pack_id) in changed_targets {
|
||||
match category {
|
||||
"modpacks" => {
|
||||
if !build_modpack(pack_id, short_sha) { all_success = false; }
|
||||
},
|
||||
"resourcepacks" => build_resource_pack(pack_id, short_sha),
|
||||
"datapacks" => build_datapack(pack_id, short_sha),
|
||||
_ => println!("category '{}' does not require a build.", category),
|
||||
}
|
||||
}
|
||||
|
||||
if !all_success {
|
||||
eprintln!("one or more builds failed.");
|
||||
exit(1);
|
||||
} else {
|
||||
println!("all builds completed successfully.");
|
||||
}
|
||||
}
|
||||
|
||||
fn build_modpack(pack_id: &str, sha: &str) -> bool {
|
||||
println!("building modpack: {}", pack_id);
|
||||
let base_path = format!("modpacks/{}", pack_id);
|
||||
let mut built_something = false;
|
||||
|
||||
for entry in WalkDir::new(&base_path).into_iter().filter_map(|e| e.ok()) {
|
||||
if entry.file_name() == "manifest.json" {
|
||||
let manifest_path = entry.path();
|
||||
let p_dir = manifest_path.parent().unwrap();
|
||||
|
||||
let file = match File::open(manifest_path) {
|
||||
Ok(f) => f,
|
||||
Err(e) => {
|
||||
eprintln!("hailed to open {:?}: {}", manifest_path, e);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
let json: serde_json::Value = match serde_json::from_reader(file) {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
eprintln!("invalid JSON in {:?}: {}", manifest_path, e);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
let mc_ver = json["mc_version"].as_str().unwrap_or("1.20.1");
|
||||
let p_ver = json["version"].as_str().unwrap_or("1.0.0");
|
||||
|
||||
for p in ["mr", "cf"] {
|
||||
let target_subdir = format!("{}-{}", mc_ver, p);
|
||||
let target_path = p_dir.join(&target_subdir);
|
||||
|
||||
if target_path.exists() {
|
||||
built_something = true;
|
||||
let ext = if p == "mr" { "mrpack" } else { "zip" };
|
||||
let platform = if p == "mr" { "modrinth" } else { "curseforge" };
|
||||
let output_name = format!("{}-{}-{}-{}-{}.{}", pack_id, mc_ver, p, p_ver, sha, ext);
|
||||
|
||||
let _ = Command::new("packwiz").args(["refresh", "-y"]).current_dir(&target_path).status();
|
||||
|
||||
let export = Command::new("packwiz")
|
||||
.args([platform, "export", "--output", &format!("../../../artifacts/{}", output_name)])
|
||||
.current_dir(&target_path)
|
||||
.status();
|
||||
|
||||
match export {
|
||||
Ok(s) if !s.success() => {
|
||||
eprintln!("packwiz export failed for {}", target_subdir);
|
||||
return false;
|
||||
},
|
||||
Err(e) => {
|
||||
eprintln!("failed to launch packwiz: {}", e);
|
||||
return false;
|
||||
},
|
||||
_ => println!("exported {}", output_name),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !built_something {
|
||||
println!("found no valid targets (mr/cf) or manifest for {}", pack_id);
|
||||
}
|
||||
|
||||
true
|
||||
}
|
||||
|
||||
fn build_resource_pack(pack_id: &str, sha: &str) {
|
||||
println!("building resource pack: {}", pack_id);
|
||||
let src = format!("resourcepacks/{}", pack_id);
|
||||
let dest = format!("artifacts/{}-{}.zip", pack_id, sha);
|
||||
|
||||
let status = Command::new("packsquash")
|
||||
.args(["packsquash.toml", "--pack-directory", &src, "--output-file-path", &dest])
|
||||
.status()
|
||||
.expect("Failed to execute PackSquash");
|
||||
|
||||
if !status.success() { exit(1); }
|
||||
}
|
||||
|
||||
fn build_datapack(pack_id: &str, sha: &str) {
|
||||
println!("zipping datapack: {}", pack_id);
|
||||
let src = format!("datapacks/{}", pack_id);
|
||||
let dest = format!("artifacts/{}-{}.zip", pack_id, sha);
|
||||
if let Err(e) = zip_dir(&src, &dest) {
|
||||
eprintln!("❌ Failed to zip datapack {}: {}", pack_id, e);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
fn zip_dir(src: &str, dest: &str) -> zip::result::ZipResult<()> {
|
||||
let file = File::create(dest)?;
|
||||
let mut zip = zip::ZipWriter::new(file);
|
||||
let options = SimpleFileOptions::default().compression_method(zip::CompressionMethod::Deflated);
|
||||
|
||||
for entry in WalkDir::new(src).into_iter().filter_map(|e| e.ok()) {
|
||||
let path = entry.path();
|
||||
let name = path.strip_prefix(Path::new(src)).unwrap();
|
||||
|
||||
if path.is_file() {
|
||||
zip.start_file(name.to_string_lossy(), options)?;
|
||||
let mut f = File::open(path)?;
|
||||
let mut buffer = Vec::new();
|
||||
f.read_to_end(&mut buffer)?;
|
||||
zip.write_all(&buffer)?;
|
||||
} else if !name.as_os_str().is_empty() {
|
||||
zip.add_directory(name.to_string_lossy(), options)?;
|
||||
}
|
||||
}
|
||||
zip.finish()?;
|
||||
Ok(())
|
||||
}
|
||||
// say wallahi bro make this shit work!
|
||||
@@ -1,12 +0,0 @@
|
||||
[package]
|
||||
name = "linter"
|
||||
version = "26.4.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.228", features = ["derive"] }
|
||||
serde_json = "1.0.149"
|
||||
|
||||
[[bin]]
|
||||
name = "linter"
|
||||
path = "linter.rs"
|
||||
@@ -1,44 +0,0 @@
|
||||
// this was written in like 30 minutes
|
||||
use std::fs;
|
||||
use std::process::{Command, exit};
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
let output = Command::new("git")
|
||||
.args(&["diff", "--name-only", "HEAD~1", "HEAD"])
|
||||
.output()
|
||||
.expect("Failed to execute git diff");
|
||||
|
||||
let stdout = String::from_utf8_lossy(&output.stdout);
|
||||
let mut failed = false;
|
||||
|
||||
for file_path in stdout.lines() {
|
||||
let path = Path::new(file_path);
|
||||
|
||||
if !path.exists() { continue; }
|
||||
|
||||
if file_path.ends_with(".json") || file_path.ends_with(".mcmeta") {
|
||||
if file_path.starts_with("modpacks/") ||
|
||||
file_path.starts_with("resourcepacks/") ||
|
||||
file_path.starts_with("datapacks/") {
|
||||
|
||||
println!("::group::Linting {}", file_path);
|
||||
let content = fs::read_to_string(path).expect("Read Error");
|
||||
|
||||
if let Err(e) = serde_json::from_str::<serde_json::Value>(&content) {
|
||||
eprintln!("::error file={}::INVALID JSON: {}", file_path, e);
|
||||
failed = true;
|
||||
}
|
||||
println!("::endgroup::");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if failed {
|
||||
eprintln!("Fix yo json chud...");
|
||||
exit(1);
|
||||
} else {
|
||||
println!("Lint success");
|
||||
}
|
||||
}
|
||||
// if this doesnt work i will cry bro i havent used rust since i was 11
|
||||
@@ -1,157 +0,0 @@
|
||||
use serde_json::Value;
|
||||
use std::env;
|
||||
use std::fs::{self, OpenOptions};
|
||||
use std::io::Write;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::{Command, ExitStatus};
|
||||
|
||||
fn main() {
|
||||
let diff_output = Command::new("git")
|
||||
.args(["diff-tree", "--no-commit-id", "--name-only", "-r", "HEAD"])
|
||||
.output()
|
||||
.expect("failed to run git diff");
|
||||
|
||||
let diff_str = String::from_utf8_lossy(&diff_output.stdout);
|
||||
let manifest_path_str = diff_str.lines().find(|l| l.ends_with("manifest.json"));
|
||||
|
||||
let manifest_path_str = match manifest_path_str {
|
||||
Some(p) => p,
|
||||
None => {
|
||||
println!("no manifest.json found in recent commit. skipping.");
|
||||
std::process::exit(0);
|
||||
}
|
||||
};
|
||||
|
||||
let manifest_path = Path::new(manifest_path_str);
|
||||
let p_dir = manifest_path.parent().expect("Could not find parent dir");
|
||||
|
||||
let manifest_content = fs::read_to_string(manifest_path).expect("Failed to read manifest");
|
||||
let manifest: Value = serde_json::from_str(&manifest_content).expect("Failed to parse manifest JSON");
|
||||
|
||||
let raw_name = manifest["name"].as_str().unwrap();
|
||||
let p_name = raw_name.replace(" ", "-");
|
||||
let p_ver = manifest["version"].as_str().unwrap();
|
||||
let mc_ver = manifest["mc_version"].as_str().unwrap();
|
||||
let p_type = manifest["type"].as_str().unwrap();
|
||||
let mr_id = manifest["modrinth_id"].as_str().unwrap_or("");
|
||||
let cf_id = manifest["curseforge_id"].as_str().unwrap_or("");
|
||||
let filename_base = format!("{}-{}-fabric-{}", p_name, mc_ver, p_ver);
|
||||
|
||||
let changelog_file = p_dir.join("changelog.md");
|
||||
let mut notes = if changelog_file.exists() {
|
||||
fs::read_to_string(&changelog_file).unwrap()
|
||||
} else {
|
||||
format!("update for {}", raw_name)
|
||||
};
|
||||
|
||||
let prev_bump = Command::new("git")
|
||||
.args(["log", "-n", "2", "--format=%H", "--", manifest_path_str])
|
||||
.output()
|
||||
.expect("Failed to get git log for manifest");
|
||||
|
||||
let prev_hashes = String::from_utf8_lossy(&prev_bump.stdout);
|
||||
let prev_hash = prev_hashes.lines().nth(1).unwrap_or("HEAD~1");
|
||||
|
||||
let logs = Command::new("git")
|
||||
.args(["log", &format!("{}..HEAD", prev_hash), "--format=%h %s - %an", "--", p_dir.to_str().unwrap()])
|
||||
.output()
|
||||
.expect("Failed to get commit logs");
|
||||
|
||||
let commit_lines: Vec<&str> = std::str::from_utf8(&logs.stdout)
|
||||
.unwrap()
|
||||
.lines()
|
||||
.filter(|l| l.contains(": "))
|
||||
.collect();
|
||||
|
||||
if !commit_lines.is_empty() {
|
||||
if !notes.contains("# :purple_circle: Meta-changes") {
|
||||
notes.push_str("\n\n# :purple_circle: Meta-changes\n");
|
||||
}
|
||||
notes.push_str("\n### Automated Commit Log\n");
|
||||
for line in commit_lines {
|
||||
notes.push_str(&format!("{}\n", line));
|
||||
}
|
||||
}
|
||||
|
||||
let workspace = env::var("GITHUB_WORKSPACE").unwrap_or_else(|_| ".".to_string());
|
||||
let artifacts_dir = Path::new(&workspace).join(p_dir).join("artifacts");
|
||||
|
||||
if artifacts_dir.exists() {
|
||||
fs::remove_dir_all(&artifacts_dir).unwrap();
|
||||
}
|
||||
fs::create_dir_all(&artifacts_dir).unwrap();
|
||||
|
||||
println!("::group::Building Artifacts");
|
||||
if p_type == "modpack" {
|
||||
for platform in &["mr", "cf"] {
|
||||
let target_folder = format!("{}-{}", mc_ver, platform);
|
||||
let target_path = p_dir.join(&target_folder);
|
||||
|
||||
if target_path.exists() {
|
||||
// Refresh packwiz
|
||||
run_cmd("packwiz", &["refresh"], &target_path);
|
||||
|
||||
let (export_cmd, ext) = if *platform == "mr" { ("modrinth", "mrpack") } else { ("curseforge", "zip") };
|
||||
let out_file = artifacts_dir.join(format!("{}-{}.{}", filename_base, platform, ext));
|
||||
|
||||
// Export packwiz
|
||||
run_cmd("packwiz", &[export_cmd, "export", "--output", out_file.to_str().unwrap()], &target_path);
|
||||
} else {
|
||||
println!("Skipping {}: folder {} not found", platform, target_path.display());
|
||||
}
|
||||
}
|
||||
} else if p_type == "resourcepack" || p_type == "datapack" {
|
||||
let out_file = artifacts_dir.join(format!("{}-{}.zip", manifest["id"].as_str().unwrap(), p_ver));
|
||||
let content_dir = p_dir.join("content");
|
||||
|
||||
if content_dir.exists() {
|
||||
run_cmd("zip", &["-r", out_file.to_str().unwrap(), "."], &content_dir);
|
||||
} else {
|
||||
println!("Error: content directory not found at {}", content_dir.display());
|
||||
}
|
||||
}
|
||||
println!("::endgroup::");
|
||||
|
||||
if let Ok(out_path) = env::var("GITHUB_OUTPUT") {
|
||||
let mut out_file = OpenOptions::new()
|
||||
.append(true)
|
||||
.create(true)
|
||||
.open(out_path)
|
||||
.expect("Could not open GITHUB_OUTPUT");
|
||||
|
||||
writeln!(out_file, "mr_id={}", mr_id).unwrap();
|
||||
writeln!(out_file, "cf_id={}", cf_id).unwrap();
|
||||
writeln!(out_file, "name={} {}", raw_name, p_ver).unwrap();
|
||||
writeln!(out_file, "ver={}", p_ver).unwrap();
|
||||
writeln!(out_file, "mc={}", mc_ver).unwrap();
|
||||
writeln!(out_file, "type={}", p_type).unwrap();
|
||||
writeln!(out_file, "path={}", p_dir.to_str().unwrap()).unwrap();
|
||||
|
||||
let delimiter = "EOF_NOTES_DELIMITER";
|
||||
writeln!(out_file, "notes<<{}\n{}\n{}", delimiter, notes.trim(), delimiter).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
fn run_cmd(cmd: &str, args: &[&str], dir: &PathBuf) {
|
||||
let status = Command::new(cmd)
|
||||
.args(args)
|
||||
.current_dir(dir)
|
||||
.status();
|
||||
|
||||
match status {
|
||||
Ok(s) if s.success() => (),
|
||||
Ok(s) => {
|
||||
eprintln!("Command '{} {:?}' failed with exit code: {}", cmd, args, s);
|
||||
std::process::exit(1);
|
||||
}
|
||||
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
|
||||
eprintln!("CRITICAL: Binary '{}' not found in PATH.", cmd);
|
||||
eprintln!("Ensure it is installed and added to GITHUB_PATH.");
|
||||
std::process::exit(1);
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!("Failed to execute '{}': {}", cmd, e);
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
use somnus_core::get_changed_files;
|
||||
|
||||
fn main() {
|
||||
if run() {
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn run() -> bool {
|
||||
let mut failed = false;
|
||||
|
||||
let changed_files = match get_changed_files() {
|
||||
Ok(files) => files,
|
||||
Err(e) => {
|
||||
eprintln!("::error::Failed to retrieve changed files: {}", e);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
for file_path in changed_files {
|
||||
let path = Path::new(&file_path);
|
||||
if !path.exists() { continue; }
|
||||
|
||||
if file_path.ends_with(".json") || file_path.ends_with(".mcmeta") {
|
||||
if ["modpacks/", "resourcepacks/", "datapacks/"]
|
||||
.iter()
|
||||
.any(|dir| file_path.starts_with(dir))
|
||||
{
|
||||
println!("::group::Linting {}", file_path);
|
||||
let content = fs::read_to_string(path).expect("Read Error");
|
||||
|
||||
if let Err(e) = serde_json::from_str::<serde_json::Value>(&content) {
|
||||
eprintln!("::error file={}::INVALID JSON: {}", file_path, e);
|
||||
failed = true;
|
||||
}
|
||||
println!("::endgroup::");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if failed {
|
||||
eprintln!("Fix yo json chud...");
|
||||
}
|
||||
failed
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
use somnus_core::get_changed_files;
|
||||
|
||||
fn main() {
|
||||
if run() {
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn run() -> bool {
|
||||
let mut failed = false;
|
||||
|
||||
let changed_files = match get_changed_files() {
|
||||
Ok(files) => files,
|
||||
Err(e) => {
|
||||
eprintln!("::error::Failed to retrieve changed files: {}", e);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
for file_path in changed_files {
|
||||
let path = Path::new(&file_path);
|
||||
if !path.exists() { continue; }
|
||||
|
||||
if file_path.ends_with(".toml") {
|
||||
println!("::group::Linting TOML: {}", file_path);
|
||||
let content = fs::read_to_string(path).expect("Read Error");
|
||||
|
||||
if let Err(e) = content.parse::<toml::Value>() {
|
||||
eprintln!("::error file={}::INVALID TOML: {}", file_path, e);
|
||||
failed = true;
|
||||
}
|
||||
println!("::endgroup::");
|
||||
}
|
||||
}
|
||||
|
||||
if failed {
|
||||
eprintln!("Fix yo toml chud...");
|
||||
}
|
||||
failed
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::Command;
|
||||
use walkdir::WalkDir;
|
||||
|
||||
fn main() {
|
||||
let sync_map = vec![
|
||||
("modpacks/lce-core/1.21.10-mr", vec![
|
||||
"modpacks/simply/1.21.10-mr",
|
||||
"modpacks/rc-plus/1.21.10-mr",
|
||||
]),
|
||||
("modpacks/lce-core/1.21.10-cf", vec![
|
||||
"modpacks/simply/1.21.10-cf",
|
||||
"modpacks/rc-plus/1.21.10-cf",
|
||||
]),
|
||||
];
|
||||
|
||||
for (src_str, targets) in sync_map {
|
||||
let src_path = Path::new(src_str);
|
||||
if !src_path.exists() {
|
||||
println!("Skipping source {}: Not found", src_str);
|
||||
continue;
|
||||
}
|
||||
|
||||
for target_str in targets {
|
||||
let target_path = Path::new(target_str);
|
||||
if !target_path.exists() { continue; }
|
||||
|
||||
println!("Syncing {} -> {}", src_str, target_str);
|
||||
|
||||
sync_subfolder(src_path, target_path, "mods");
|
||||
sync_subfolder(src_path, target_path, "resourcepacks");
|
||||
sync_subfolder(src_path, target_path, "resources");
|
||||
|
||||
refresh_packwiz(target_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn sync_subfolder(src_root: &Path, dst_root: &Path, folder: &str) {
|
||||
let src = src_root.join(folder);
|
||||
let dst = dst_root.join(folder);
|
||||
|
||||
if !src.exists() { return; }
|
||||
|
||||
for entry in WalkDir::new(&src)
|
||||
.into_iter()
|
||||
.filter_map(|e| e.ok())
|
||||
.filter(|e| !e.path().is_dir())
|
||||
{
|
||||
let src_file = entry.path();
|
||||
let relative = src_file.strip_prefix(src_root).unwrap();
|
||||
let target_file = dst_root.join(relative);
|
||||
|
||||
if let Some(parent) = target_file.parent() {
|
||||
fs::create_dir_all(parent).expect("Failed to create dirs");
|
||||
}
|
||||
|
||||
fs::copy(src_file, &target_file).expect("Failed to copy file");
|
||||
}
|
||||
}
|
||||
|
||||
fn refresh_packwiz(dir: &Path) {
|
||||
let _ = Command::new("packwiz")
|
||||
.arg("refresh")
|
||||
.current_dir(dir)
|
||||
.status();
|
||||
}
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
fetch-depth: 1
|
||||
sparse-checkout: |
|
||||
modpacks
|
||||
.actions
|
||||
src/actions
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
@@ -24,39 +24,42 @@ jobs:
|
||||
go-version: 'stable'
|
||||
cache: true
|
||||
|
||||
- name: Cache Packwiz Binaries
|
||||
id: cache-tooling
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: $HOME/go/bin
|
||||
key: tooling-${{ runner.os }}-packwiz
|
||||
|
||||
- name: Install Tooling
|
||||
if: steps.cache-tooling.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
mkdir -p $HOME/go/bin
|
||||
if ! command -v packwiz &> /dev/null; then
|
||||
go install github.com/packwiz/packwiz@latest
|
||||
fi
|
||||
if ! command -v pw &> /dev/null; then
|
||||
go install github.com/Merith-TK/packwiz-wrapper/cmd/pw@main
|
||||
fi
|
||||
echo "$HOME/go/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Cache Updater Binary
|
||||
- name: Add Path
|
||||
run: echo "$HOME/go/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Cache Updater
|
||||
id: cache-updater
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./updater-bin
|
||||
key: updater-v2-${{ runner.os }}-${{ hashFiles('.actions/updater/**') }}
|
||||
key: updater-v3-${{ runner.os }}-${{ hashFiles('src/actions/updater/**') }}
|
||||
|
||||
- name: Ensure Rust
|
||||
- name: Rust Cache
|
||||
if: steps.cache-updater.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
if ! command -v rustup &> /dev/null; then
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
source $HOME/.cargo/env
|
||||
fi
|
||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: "src/actions/updater -> target"
|
||||
|
||||
- name: Build Updater
|
||||
if: steps.cache-updater.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cargo build --release --manifest-path .actions/updater/Cargo.toml
|
||||
cargo build --release --manifest-path src/actions/updater/Cargo.toml
|
||||
mkdir -p ./updater-bin
|
||||
cp .actions/updater/target/release/updater ./updater-bin/updater
|
||||
cp src/actions/updater/target/release/updater ./updater-bin/updater
|
||||
|
||||
- name: Run Updater
|
||||
id: rust-update
|
||||
@@ -65,7 +68,7 @@ jobs:
|
||||
chmod +x ./updater-bin/updater
|
||||
./updater-bin/updater
|
||||
|
||||
- name: Run Shell Update (Fallback)
|
||||
- name: Run Shell Updater
|
||||
if: steps.rust-update.outcome == 'failure'
|
||||
run: |
|
||||
echo "Rust Updater failed. Falling back to Shell..."
|
||||
|
||||
@@ -5,11 +5,14 @@ on:
|
||||
branches: ["main"]
|
||||
paths:
|
||||
- 'modpacks/**'
|
||||
- 'resourcepacks/**'
|
||||
- 'datapacks/**'
|
||||
- 'packsquash.toml'
|
||||
- 'src/actions/builder/**'
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
paths:
|
||||
- 'modpacks/**'
|
||||
- 'datapacks/**'
|
||||
- 'src/actions/builder/**'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -19,72 +22,71 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 2
|
||||
fetch-depth: 0
|
||||
filter: blob:none
|
||||
sparse-checkout: |
|
||||
modpacks
|
||||
resourcepacks
|
||||
datapacks
|
||||
.actions
|
||||
src/actions/builder
|
||||
|
||||
- name: Meta
|
||||
id: meta
|
||||
run: |
|
||||
CHANGED_FILE=$(git diff-tree --no-commit-id --name-only -r HEAD | grep -E '^(modpacks|resourcepacks|datapacks)/' | head -n 1)
|
||||
if [ -z "$CHANGED_FILE" ]; then CHANGED_FILE="modpacks/simply-legacy/"; fi
|
||||
|
||||
PACK_ID=$(echo "$CHANGED_FILE" | cut -d'/' -f2)
|
||||
SHORT_SHA=$(git rev-parse --short HEAD)
|
||||
CLEAN_NAME=$(echo "$PACK_ID" | sed 's/-/ /g' | awk '{for(i=1;i<=NF;i++)sub(/./,toupper(substr($i,1,1)),$i)}1')
|
||||
|
||||
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT
|
||||
echo "pack_name=$CLEAN_NAME" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache Builder Binary
|
||||
id: cache-builder
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./builder-bin
|
||||
key: builder-v1-${{ runner.os }}-${{ hashFiles('src/actions/builder/**/*.rs', 'src/actions/builder/Cargo.toml', 'src/actions/builder/Cargo.lock') }}
|
||||
|
||||
- name: Install Rust
|
||||
if: steps.cache-builder.outputs.cache-hit != 'true'
|
||||
uses: https://github.com/dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Rust Cache
|
||||
if: steps.cache-builder.outputs.cache-hit != 'true'
|
||||
uses: https://github.com/Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: "src/actions/builder -> target"
|
||||
|
||||
- name: Build Builder
|
||||
if: steps.cache-builder.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cargo build --release --manifest-path src/actions/builder/Cargo.toml --bin builder
|
||||
mkdir -p ./builder-bin
|
||||
cp src/actions/builder/target/release/builder ./builder-bin/builder
|
||||
|
||||
- name: Cache Go Binaries
|
||||
id: cache-go
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/go/bin
|
||||
key: go-bin-v1-${{ runner.os }}
|
||||
key: go-bin-packwiz-v1-${{ runner.os }}
|
||||
|
||||
- name: Setup Go
|
||||
if: steps.cache-go.outputs.cache-hit != 'true'
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 'stable'
|
||||
cache: true
|
||||
|
||||
- name: Install Packwiz
|
||||
run: |
|
||||
if [ ! -f "$HOME/go/bin/packwiz" ]; then
|
||||
go install github.com/packwiz/packwiz@latest
|
||||
fi
|
||||
echo "$HOME/go/bin" >> $GITHUB_PATH
|
||||
if: steps.cache-go.outputs.cache-hit != 'true'
|
||||
run: go install github.com/packwiz/packwiz@latest
|
||||
|
||||
- name: Cache Builder
|
||||
id: cache-builder
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./builder
|
||||
key: builder-v26.4.0-${{ runner.os }}-${{ hashFiles('.actions/builder/src/**') }}
|
||||
|
||||
- name: Setup Builder
|
||||
if: steps.cache-builder.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
if ! command -v cargo &> /dev/null; then
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
source $HOME/.cargo/env
|
||||
fi
|
||||
cd .actions/builder
|
||||
cargo build --release
|
||||
cp target/release/builder ../../builder
|
||||
- name: Add Go bin to PATH
|
||||
run: echo "$HOME/go/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Run Build
|
||||
run: |
|
||||
chmod +x ./builder
|
||||
./builder ${{ steps.meta.outputs.short_sha }}
|
||||
chmod +x ./builder-bin/builder
|
||||
./builder-bin/builder "${{ steps.meta.outputs.short_sha }}"
|
||||
|
||||
- name: Upload
|
||||
uses: https://code.forgejo.org/actions/upload-artifact@v3
|
||||
with:
|
||||
name: "${{ steps.meta.outputs.pack_name }}-${{ steps.meta.outputs.short_sha }}"
|
||||
path: artifacts/
|
||||
name: "build-${{ steps.meta.outputs.short_sha }}"
|
||||
path: "artifacts/"
|
||||
|
||||
@@ -1,46 +1,72 @@
|
||||
name: Linter
|
||||
name: "Linter"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
paths:
|
||||
- 'modpacks/**/*.json'
|
||||
- 'modpacks/**/*.mcmeta'
|
||||
- 'modpacks/**/*.toml'
|
||||
- 'resourcepacks/**/*.json'
|
||||
- 'datapacks/**/*.json'
|
||||
- 'datapacks/**/*.mcmeta'
|
||||
- 'src/actions/somnus/**'
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
paths:
|
||||
- 'modpacks/**/*.json'
|
||||
- 'modpacks/**/*.mcmeta'
|
||||
- 'modpacks/**/*.toml'
|
||||
- 'datapacks/**/*.json'
|
||||
- 'datapacks/**/*.mcmeta'
|
||||
- 'src/actions/somnus/**'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: technocality
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 2
|
||||
filter: blob:none
|
||||
sparse-checkout: |
|
||||
modpacks
|
||||
datapacks
|
||||
src/actions/somnus
|
||||
|
||||
- name: Ensure rust
|
||||
run: |
|
||||
if ! command -v cargo &> /dev/null; then
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
fi
|
||||
|
||||
- name: Cache Cargo
|
||||
- name: Cache Linter Binaries
|
||||
id: cache-linter
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
.actions/somnus/core/target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('.actions/somnus/core/Cargo.toml') }}
|
||||
path: ./linter-bin
|
||||
key: linter-v1-${{ runner.os }}-${{ hashFiles('src/actions/somnus/core/**/*.rs', 'src/actions/somnus/core/Cargo.toml', 'src/actions/somnus/core/Cargo.lock') }}
|
||||
|
||||
- name: Run Somnus Linters
|
||||
- name: Rust Cache
|
||||
if: steps.cache-linter.outputs.cache-hit != 'true'
|
||||
uses: https://github.com/Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: "src/actions/somnus/core -> target"
|
||||
|
||||
- name: Install Rust
|
||||
if: steps.cache-linter.outputs.cache-hit != 'true'
|
||||
uses: https://github.com/dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Build Linters
|
||||
if: steps.cache-linter.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
source "$HOME/.cargo/env" || true
|
||||
cargo build --release \
|
||||
--manifest-path src/actions/somnus/core/Cargo.toml \
|
||||
--bin json-linter --bin toml-linter
|
||||
mkdir -p ./linter-bin
|
||||
cp src/actions/somnus/core/src/bin/json-linter.rs
|
||||
cp src/actions/somnus/core/src/bin/toml-linter.rs
|
||||
|
||||
echo "rnning JSON Linter..."
|
||||
cargo run --manifest-path ./.actions/somnus/core/Cargo.toml --bin json-linter
|
||||
- name: Run Linters
|
||||
run: |
|
||||
chmod +x ./linter-bin/json-linter ./linter-bin/toml-linter
|
||||
echo "Running JSON Linter..."
|
||||
./linter-bin/json-linter
|
||||
echo "Running TOML Linter..."
|
||||
./linter-bin/toml-linter
|
||||
|
||||
echo "running TOML Linter..."
|
||||
cargo run --manifest-path ./.actions/somnus/core/Cargo.toml --bin toml-linter
|
||||
45
.forgejo/workflows/png-opt.yml
Normal file
45
.forgejo/workflows/png-opt.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
name: "PNG Optimization"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
bulk-nuke:
|
||||
runs-on: technocality
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 1
|
||||
filter: blob:none
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
shared-key: "maintenance-tools"
|
||||
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Cache oxipng
|
||||
id: cache-oxipng
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cargo/bin/oxipng
|
||||
key: ${{ runner.os }}-oxipng-v1
|
||||
|
||||
- name: Install oxipng
|
||||
if: steps.cache-oxipng.outputs.cache-hit != 'true'
|
||||
run: cargo install oxipng
|
||||
|
||||
- name: Run Optimization
|
||||
run: |
|
||||
oxipng -r -o 4 -v --strip all "resourcepacks/" "modpacks/" "datapacks/"
|
||||
|
||||
- name: Commit Optimized Images
|
||||
uses: https://github.com/EndBug/add-and-commit@v9
|
||||
with:
|
||||
author_name: forgejo-actions[bot]
|
||||
author_email: omo50@noreply.nostalgica.net
|
||||
message: 'chore: bulk png optimization'
|
||||
add: '**/*.png'
|
||||
@@ -1,44 +0,0 @@
|
||||
name: "png tyhingh"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
bulk-nuke:
|
||||
runs-on: technocality
|
||||
steps:
|
||||
- name: grab
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
filter: blob:none
|
||||
|
||||
- name: install
|
||||
run: |
|
||||
if ! command -v cargo &> /dev/null; then
|
||||
echo "Rust not found. Bootstrapping..."
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
fi
|
||||
|
||||
. "$HOME/.cargo/env"
|
||||
|
||||
if ! command -v oxipng &> /dev/null; then
|
||||
echo "Installing oxipng..."
|
||||
cargo install oxipng
|
||||
fi
|
||||
|
||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: comp
|
||||
run: |
|
||||
. "$HOME/.cargo/env"
|
||||
|
||||
oxipng -r -o 4 -v --strip all "resourcepacks/"
|
||||
|
||||
- name: commit
|
||||
uses: https://github.com/EndBug/add-and-commit@v9
|
||||
with:
|
||||
author_name: forgejo-actions[bot]
|
||||
author_email: omo50@noreply.nostalgica.net
|
||||
message: 'chore: bulk'
|
||||
add: 'resourcepacks/**/*.png'
|
||||
@@ -6,53 +6,122 @@ on:
|
||||
paths:
|
||||
- 'modpacks/**/manifest.json'
|
||||
- 'datapacks/**/manifest.json'
|
||||
- 'resourcepacks/**/manifest.json'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
detect:
|
||||
runs-on: technocality
|
||||
outputs:
|
||||
manifests: ${{ steps.find.outputs.manifests }}
|
||||
has_manifests: ${{ steps.find.outputs.has_manifests }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 2
|
||||
filter: blob:none
|
||||
sparse-checkout: |
|
||||
modpacks
|
||||
datapacks
|
||||
|
||||
- name: Find changed manifests
|
||||
id: find
|
||||
run: |
|
||||
MANIFESTS=$(git diff-tree --no-commit-id --name-only -r HEAD \
|
||||
| grep -E '^(modpacks|datapacks)/.*/manifest\.json$' || true)
|
||||
if [ -z "$MANIFESTS" ]; then
|
||||
echo "has_manifests=false" >> $GITHUB_OUTPUT
|
||||
echo "manifests=[]" >> $GITHUB_OUTPUT
|
||||
echo "no changed manifests."
|
||||
else
|
||||
JSON=$(echo "$MANIFESTS" | jq -R -s -c 'split("\n") | map(select(length > 0))')
|
||||
echo "has_manifests=true" >> $GITHUB_OUTPUT
|
||||
echo "manifests=$JSON" >> $GITHUB_OUTPUT
|
||||
echo "manifests to publish: $JSON"
|
||||
fi
|
||||
|
||||
publish:
|
||||
needs: detect
|
||||
if: needs.detect.outputs.has_manifests == 'true'
|
||||
runs-on: technocality
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
manifest: ${{ fromJson(needs.detect.outputs.manifests) }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
filter: blob:none
|
||||
sparse-checkout: |
|
||||
modpacks
|
||||
datapacks
|
||||
src/actions/publish
|
||||
tools/changelog
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Generate Changelog
|
||||
id: changelog
|
||||
run: npx tsx tools/changelog/generate-changelog.ts "${{ matrix.manifest }}"
|
||||
|
||||
- name: Cache Publisher Binary
|
||||
id: cache-publisher
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./publisher-bin
|
||||
key: publisher-v1-${{ runner.os }}-${{ hashFiles('src/actions/publish/**/*.rs', 'src/actions/publish/Cargo.toml', 'src/actions/publish/Cargo.lock') }}
|
||||
|
||||
- name: Rust Cache
|
||||
if: steps.cache-publisher.outputs.cache-hit != 'true'
|
||||
uses: https://github.com/Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: "src/actions/publish -> target"
|
||||
|
||||
- name: Install Rust
|
||||
if: steps.cache-publisher.outputs.cache-hit != 'true'
|
||||
uses: https://github.com/dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Build Publisher
|
||||
if: steps.cache-publisher.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cargo build --release --manifest-path src/actions/publish/Cargo.toml --bin publish
|
||||
mkdir -p ./publisher-bin
|
||||
cp src/actions/publish/target/release/publish ./publisher-bin/publish
|
||||
|
||||
- name: Cache Packwiz Binaries
|
||||
id: cache-go
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/go/bin
|
||||
key: go-bin-packwiz-v1-${{ runner.os }}
|
||||
|
||||
- name: Setup Go
|
||||
if: steps.cache-go.outputs.cache-hit != 'true'
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 'stable'
|
||||
cache: true
|
||||
|
||||
- name: Install packwiz
|
||||
run: |
|
||||
if ! command -v packwiz &> /dev/null; then
|
||||
echo "packwiz not found, installing..."
|
||||
go install github.com/packwiz/packwiz@latest
|
||||
else
|
||||
echo "packwiz already installed."
|
||||
fi
|
||||
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||
- name: Install Packwiz
|
||||
if: steps.cache-go.outputs.cache-hit != 'true'
|
||||
run: go install github.com/packwiz/packwiz@latest
|
||||
|
||||
- name: Install Rust
|
||||
run: |
|
||||
if ! command -v cargo &> /dev/null; then
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
fi
|
||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
- name: Add Go bin to PATH
|
||||
run: echo "$HOME/go/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Build Publisher
|
||||
run: |
|
||||
. "$HOME/.cargo/env"
|
||||
cargo build --release --manifest-path .actions/publish/Cargo.toml
|
||||
|
||||
- name: Run Rust Publisher
|
||||
- name: Run Publisher
|
||||
id: meta
|
||||
run: |
|
||||
export PATH=$PATH:$(go env GOPATH)/bin:$HOME/.cargo/bin
|
||||
./.actions/publish/target/release/publish
|
||||
chmod +x ./publisher-bin/publish
|
||||
./publisher-bin/publish "${{ matrix.manifest }}"
|
||||
|
||||
- name: Upload
|
||||
if: "steps.meta.outputs.mr_id != ''"
|
||||
- name: Upload to Platforms
|
||||
if: "steps.meta.outputs.mr_id != '' || steps.meta.outputs.cf_id != ''"
|
||||
uses: https://github.com/Kir-Antipov/mc-publish@v3.3
|
||||
with:
|
||||
modrinth-id: ${{ steps.meta.outputs.mr_id }}
|
||||
@@ -63,6 +132,6 @@ jobs:
|
||||
curseforge-files: "${{ github.workspace }}/${{ steps.meta.outputs.path }}/artifacts/*.zip"
|
||||
name: "${{ steps.meta.outputs.name }}"
|
||||
version: "${{ steps.meta.outputs.ver }}"
|
||||
changelog: "${{ steps.meta.outputs.notes }}"
|
||||
loaders: ${{ steps.meta.outputs.type == 'modpack' && 'fabric' || 'minecraft' }}
|
||||
changelog: "${{ steps.changelog.outputs.notes }}"
|
||||
loaders: ${{ steps.meta.outputs.type == 'modpack' && steps.meta.outputs.loader || 'minecraft' }}
|
||||
game-versions: "${{ steps.meta.outputs.mc }}"
|
||||
@@ -1,4 +1,4 @@
|
||||
name: "Core Sync"
|
||||
name: "Sync"
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -6,6 +6,8 @@ on:
|
||||
paths:
|
||||
- 'modpacks/lce-core/**/mods/**'
|
||||
- 'modpacks/lce-core/**/resourcepacks/**'
|
||||
- 'modpacks/lce-core/**/resources/**'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
@@ -14,23 +16,67 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-depth: 1
|
||||
filter: blob:none
|
||||
sparse-checkout: |
|
||||
modpacks
|
||||
src/actions/coresync
|
||||
|
||||
- name: Setup Environment
|
||||
|
||||
- name: Cache CoreSync Binary
|
||||
id: cache-coresync
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./coresync-bin
|
||||
key: coresync-v1-${{ runner.os }}-${{ hashFiles('src/actions/coresync/**/*.rs', 'src/actions/coresync/Cargo.toml', 'src/actions/coresync/Cargo.lock') }}
|
||||
|
||||
- name: Install Rust
|
||||
if: steps.cache-coresync.outputs.cache-hit != 'true'
|
||||
uses: https://github.com/dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Rust Cache
|
||||
if: steps.cache-coresync.outputs.cache-hit != 'true'
|
||||
uses: https://github.com/Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: "src/actions/coresync -> target"
|
||||
|
||||
- name: Build CoreSync
|
||||
if: steps.cache-coresync.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
[ -f "$HOME/.cargo/env" ] && . "$HOME/.cargo/env"
|
||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||
cargo build --release --manifest-path src/actions/coresync/Cargo.toml --bin coresync
|
||||
mkdir -p ./coresync-bin
|
||||
cp src/actions/coresync/target/release/coresync ./coresync-bin/coresync
|
||||
|
||||
- name: Cache Packwiz Binaries
|
||||
id: cache-go
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/go/bin
|
||||
key: go-bin-packwiz-v1-${{ runner.os }}
|
||||
|
||||
- name: Setup Go
|
||||
if: steps.cache-go.outputs.cache-hit != 'true'
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 'stable'
|
||||
cache: true
|
||||
|
||||
- name: Install Packwiz
|
||||
if: steps.cache-go.outputs.cache-hit != 'true'
|
||||
run: go install github.com/packwiz/packwiz@latest
|
||||
|
||||
- name: Add Go bin to PATH
|
||||
run: echo "$HOME/go/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Run CoreSync
|
||||
run: |
|
||||
export PATH=$PATH:$(go env GOPATH)/bin:$HOME/.cargo/bin
|
||||
cargo run --release --manifest-path .actions/coresync/Cargo.toml
|
||||
chmod +x ./coresync-bin/coresync
|
||||
./coresync-bin/coresync
|
||||
|
||||
- name: Commit and Push
|
||||
uses: https://github.com/EndBug/add-and-commit@v9
|
||||
with:
|
||||
author_name: forgejo-actions[bot]
|
||||
author_email: omo50@noreply.nostalgica.net
|
||||
message: 'actions: auto-update (${{ github.workflow }})'
|
||||
message: 'actions: sync'
|
||||
add: 'modpacks'
|
||||
@@ -764,7 +764,7 @@ metafile = true
|
||||
|
||||
[[files]]
|
||||
file = "mods/ixeris.pw.toml"
|
||||
hash = "9a60ae33d2c7ad85ea7c334522ccc1c0be8ab1bec9a3e934608605bfca9db14e"
|
||||
hash = "9e6a3fb54ebb13ea95ced681d270cfa83134e95bb7111de140208db7160fffa7"
|
||||
metafile = true
|
||||
|
||||
[[files]]
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
name = "Ixeris"
|
||||
filename = "Ixeris-4.1.9+1.21.11-fabric.jar"
|
||||
filename = "Ixeris-4.1.10+1.21.11-fabric.jar"
|
||||
side = "client"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/p8RJPJIC/versions/sJv6IIti/Ixeris-4.1.9%2B1.21.11-fabric.jar"
|
||||
url = "https://cdn.modrinth.com/data/p8RJPJIC/versions/5VdrF7hS/Ixeris-4.1.10%2B1.21.11-fabric.jar"
|
||||
hash-format = "sha512"
|
||||
hash = "6602319ea0a9f476091fd6142ca86ed3aa362c0a3801c0850332113d357c760f870500643e110280d58a222ec4b30525f224e90e44fddc61b12116d32a9f48f9"
|
||||
hash = "38093de218550151db1ee0c9a6178d69f58db8886877c7744948b3e627455d6ebd25b173e2cf513376b0aac32329f50a8d1427a5bd513b72439ac5ae0ae98632"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "p8RJPJIC"
|
||||
version = "sJv6IIti"
|
||||
version = "5VdrF7hS"
|
||||
|
||||
@@ -6,7 +6,7 @@ pack-format = "packwiz:1.1.0"
|
||||
[index]
|
||||
file = "index.toml"
|
||||
hash-format = "sha256"
|
||||
hash = "cc709cd195e139558f167bbead4c6e6c804f32f9132d9d27158cc66b6c74cf5a"
|
||||
hash = "7f680a809484314a0dd155615e10a8394bcd05eaff5a8bcc07800d6c6c33c045"
|
||||
|
||||
[versions]
|
||||
fabric = "0.18.5"
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
name = "Better Block Entities"
|
||||
filename = "bbe-1.3.1.jar"
|
||||
side = "client"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/ONZm0H7Y/versions/lex0PhIz/bbe-1.3.1.jar"
|
||||
hash-format = "sha512"
|
||||
hash = "ebc65de7d9996af78b91cc61fe71b483a98f2635a166382124574470a3769776efcb2db7b7d7bce9d62fb1b8ef8616b3c4e7216b457b863bc721ed7ba3ebd1c5"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "ONZm0H7Y"
|
||||
version = "lex0PhIz"
|
||||
@@ -1,13 +0,0 @@
|
||||
name = "Crash Assistant"
|
||||
filename = "CrashAssistant-fabric-26.1-1.11.6.jar"
|
||||
side = "client"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/ix1qq8Ux/versions/FMH9oihL/CrashAssistant-fabric-26.1-1.11.6.jar"
|
||||
hash-format = "sha512"
|
||||
hash = "09ee91f011fcde9287d20ae002a386fc95c0af7028ca5759b04e812eaa976d1443d8ae874049bcb112e9f641f15669078f465fea66eec4909975916b8563be4d"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "ix1qq8Ux"
|
||||
version = "FMH9oihL"
|
||||
@@ -1,13 +0,0 @@
|
||||
name = "[EMF] Entity Model Features"
|
||||
filename = "entity_model_features_26.1-fabric-3.0.17.jar"
|
||||
side = "client"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/4I1XuqiY/versions/WCq0oMm6/entity_model_features_26.1-fabric-3.0.17.jar"
|
||||
hash-format = "sha512"
|
||||
hash = "1ed697d64f9773ca1b70da3d64c8ea04d880aff18d716b36a6164e1d243461330975c38a6135c49466b5e125d6c84a72d38d45a2eb1a0676dc74f1ef3737f111"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "4I1XuqiY"
|
||||
version = "WCq0oMm6"
|
||||
@@ -1,13 +0,0 @@
|
||||
name = "Entity Culling"
|
||||
filename = "entityculling-fabric-1.10.0-mc26.1.jar"
|
||||
side = "client"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/NNAgCjsB/versions/YSbzFHRt/entityculling-fabric-1.10.0-mc26.1.jar"
|
||||
hash-format = "sha512"
|
||||
hash = "325be6ce1f4c3a975ca45a85bd210c836f043f8c68a68087b39c29e7e8940f05bb850419afb038a995e90b2d06cbfe2e09fa18050440ba68890015ebaf20340d"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "NNAgCjsB"
|
||||
version = "YSbzFHRt"
|
||||
@@ -1,13 +0,0 @@
|
||||
name = "[ETF] Entity Texture Features"
|
||||
filename = "entity_texture_features_26.1-fabric-7.0.13.jar"
|
||||
side = "client"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/BVzZfTc1/versions/ZGRPXhJ6/entity_texture_features_26.1-fabric-7.0.13.jar"
|
||||
hash-format = "sha512"
|
||||
hash = "bbc4ae0ff73ebf3395ab50fbd2d519dc3faeae7fe5e51aeb24305c124b6b9d57d4bf29e40f39ac93c1e71d40d40df818cebe87f6aa9c62cbeed7bb8af0d4a246"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "BVzZfTc1"
|
||||
version = "ZGRPXhJ6"
|
||||
@@ -1,13 +0,0 @@
|
||||
name = "Fabric API"
|
||||
filename = "fabric-api-0.145.4+26.1.1.jar"
|
||||
side = "both"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/P7dR8mSH/versions/E1uEPd5j/fabric-api-0.145.4%2B26.1.1.jar"
|
||||
hash-format = "sha512"
|
||||
hash = "5cbf5c07c25ddc48affc2d67a7b911df6fe263ac4cafa7baeddab4dbc8e47c785a892cb7ea5181909c1703121eeed77e6b9459d61a78616621fc31142cc0d019"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "P7dR8mSH"
|
||||
version = "E1uEPd5j"
|
||||
@@ -1,13 +0,0 @@
|
||||
name = "ImmediatelyFast"
|
||||
filename = "ImmediatelyFast-Fabric-1.15.1+26.1.1.jar"
|
||||
side = "client"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/5ZwdcRci/versions/UM3jWaXo/ImmediatelyFast-Fabric-1.15.1%2B26.1.1.jar"
|
||||
hash-format = "sha512"
|
||||
hash = "3e7253defa73110883d0685ba2e5321228b627aa0206277fec26b5d332e1b372b93e1c053a6fd3be938188f110307a6716a2f80dd97c205231aa8900bdf7641d"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "5ZwdcRci"
|
||||
version = "UM3jWaXo"
|
||||
@@ -1,13 +0,0 @@
|
||||
name = "Ixeris"
|
||||
filename = "Ixeris-4.1.8+26.1.1-fabric.jar"
|
||||
side = "client"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/p8RJPJIC/versions/3zCbd4Se/Ixeris-4.1.8%2B26.1.1-fabric.jar"
|
||||
hash-format = "sha512"
|
||||
hash = "04f0a37d8c9373e5466b29dce9dab1690eb3988f3d3a807511d613fe8591651d2852e72e774e09c8fc5d6893842ecca33ec5a4676f53d7ae9a20eceee58c9cc0"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "p8RJPJIC"
|
||||
version = "3zCbd4Se"
|
||||
@@ -1,13 +0,0 @@
|
||||
name = "LambDynamicLights - Dynamic Lights"
|
||||
filename = "lambdynamiclights-4.10.0+26.1.jar"
|
||||
side = "client"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/yBW8D80W/versions/Nttq3ROe/lambdynamiclights-4.10.0%2B26.1.jar"
|
||||
hash-format = "sha512"
|
||||
hash = "d36584e3d20ee219767305f2c2a5ece6e8942e6497f29e08a2845493e912a4ad535a9b1fac1ac977e6cf2e821ec975b66603d868ed1cd26197d777041bc6299f"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "yBW8D80W"
|
||||
version = "Nttq3ROe"
|
||||
@@ -1,13 +0,0 @@
|
||||
name = "ModernFix-mVUS"
|
||||
filename = "modernfix-5.26.2-build.1.jar"
|
||||
side = "both"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/TjSm1wrD/versions/dqQ7mabN/modernfix-5.26.2-build.1.jar"
|
||||
hash-format = "sha512"
|
||||
hash = "fbef93c2dabf7bcd0ccd670226dfc4958f7ebe5d8c2b1158e88a65e6954a40f595efd58401d2a3dbb224660dca5952199cf64df29100e7bd39b1b1941290b57b"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "TjSm1wrD"
|
||||
version = "dqQ7mabN"
|
||||
@@ -1,13 +0,0 @@
|
||||
name = "Ok Zoomer"
|
||||
filename = "ok_zoomer-universal-17.0.0-beta.3.jar"
|
||||
side = "client"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/aXf2OSFU/versions/yXRfcOfY/ok_zoomer-universal-17.0.0-beta.3.jar"
|
||||
hash-format = "sha512"
|
||||
hash = "2e6aefc9919c9b453d3c1a145608dc3da1981bcbbb215be9c38262d220457c7a2c789d68d155928c1a13a0f654722d35a2eb236663fd251dbe172a8e6df5fed1"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "aXf2OSFU"
|
||||
version = "yXRfcOfY"
|
||||
@@ -1,13 +0,0 @@
|
||||
name = "Stfu"
|
||||
filename = "Stfu-2.9.0-26.1.jar"
|
||||
side = "client"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/Rg9WdvvR/versions/z55rnFWS/Stfu-2.9.0-26.1.jar"
|
||||
hash-format = "sha512"
|
||||
hash = "89c2f23244120997c5080deaa277b7e3c84dba5215bfa05cfbf4c2e8a1c8f383c2a00c2f98522248237fa3f54ee1064d7fed807e02ab6c72a6c6d11dace954ca"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "Rg9WdvvR"
|
||||
version = "z55rnFWS"
|
||||
@@ -1,13 +0,0 @@
|
||||
name = "Skyboxify"
|
||||
filename = "skyboxify-2.7+26.1-fabric.jar"
|
||||
side = "client"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/DWuwk8aA/versions/aK1qWuhY/skyboxify-2.7%2B26.1-fabric.jar"
|
||||
hash-format = "sha512"
|
||||
hash = "917bb4f54cda39342a600cee6daef3682e6fa2670d9a608d3ea254bfefa820ed34db58e02bbd174861c2726de8b3277ecfd7b2fff2b03fdb5f07f465fcdd9080"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "DWuwk8aA"
|
||||
version = "aK1qWuhY"
|
||||
@@ -1,13 +0,0 @@
|
||||
name = "Golden Days Base"
|
||||
filename = "golden-days-base-1.21.x-1.15.2.zip"
|
||||
side = "client"
|
||||
|
||||
[download]
|
||||
url = "https://cdn.modrinth.com/data/BFzJ6aQL/versions/H1DWjNVe/golden-days-base-1.21.x-1.15.2.zip"
|
||||
hash-format = "sha512"
|
||||
hash = "ec5b8bae315586a5fad051d055c61e45cbbc033c5a063f6f4f836f8c466bdd69d902fb492da3451f3f1bba37ade37f12fbfda9a9c5f8acf6b52917cc51789b86"
|
||||
|
||||
[update]
|
||||
[update.modrinth]
|
||||
mod-id = "BFzJ6aQL"
|
||||
version = "H1DWjNVe"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user