You've already forked AstralRinth
forked from didirus/AstralRinth
GH actions + finish
This commit is contained in:
28
.github/workflows/cli-build.yml
vendored
Normal file
28
.github/workflows/cli-build.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: Rust building
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Get build cache
|
||||||
|
id: cache-build
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: target/**
|
||||||
|
key: ${{ runner.os }}-build-cache
|
||||||
|
- name: Install toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
|
name: Build program
|
||||||
|
working-directory: ./theseus_cli
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
34
.github/workflows/gui-build.yml
vendored
Normal file
34
.github/workflows/gui-build.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Build + Lint
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
pull_request:
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: ./theseus_gui
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Use Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 18.x
|
||||||
|
- name: Get yarn cache
|
||||||
|
id: yarn-cache
|
||||||
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ${{ steps.yarn-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install --immutable --immutable-cache --check-cache
|
||||||
|
- name: Run Lint
|
||||||
|
run: npm run lint
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
28
.github/workflows/lib-build.yml
vendored
Normal file
28
.github/workflows/lib-build.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: Rust building
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Get build cache
|
||||||
|
id: cache-build
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: target/**
|
||||||
|
key: ${{ runner.os }}-build-cache
|
||||||
|
- name: Install toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
|
name: Build program
|
||||||
|
working-directory: ./theseus
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +0,0 @@
|
|||||||
[submodule "theseus_gui/locales"]
|
|
||||||
path = theseus_gui/locales
|
|
||||||
url = git@github.com:modrinth/translations.git
|
|
||||||
@@ -65,7 +65,7 @@ impl State {
|
|||||||
// Launcher data
|
// Launcher data
|
||||||
let (metadata, profiles) = tokio::try_join! {
|
let (metadata, profiles) = tokio::try_join! {
|
||||||
Metadata::init(&database),
|
Metadata::init(&database),
|
||||||
Profiles::init(&database),
|
Profiles::init(&database, &directories),
|
||||||
}?;
|
}?;
|
||||||
let users = Users::init(&database)?;
|
let users = Users::init(&database)?;
|
||||||
|
|
||||||
|
|||||||
@@ -234,14 +234,38 @@ impl Profiles {
|
|||||||
.collect::<HashMap<PathBuf, Option<Profile>>>()
|
.collect::<HashMap<PathBuf, Option<Profile>>>()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
// {
|
// project path, parent profile path
|
||||||
// for (path, profile_opt) in profiles.iter_mut() {
|
let mut files: HashMap<PathBuf, PathBuf> = HashMap::new();
|
||||||
// if let Some(profile) = profile_opt {
|
{
|
||||||
//
|
for (profile_path, _profile_optZA) in profiles.iter() {
|
||||||
// }
|
let mut read_paths = |path: &str| {
|
||||||
// }
|
for path in std::fs::read_dir(profile_path.join(path))? {
|
||||||
// }
|
files.insert(path?.path(), profile_path.clone());
|
||||||
// dirs.caches_dir()
|
}
|
||||||
|
|
||||||
|
Ok::<(), crate::Error>(())
|
||||||
|
};
|
||||||
|
read_paths("mods")?;
|
||||||
|
read_paths("shaders")?;
|
||||||
|
read_paths("resourcepacks")?;
|
||||||
|
read_paths("datapacks")?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let inferred = super::projects::infer_data_from_files(
|
||||||
|
files.keys().into_iter().cloned().collect(),
|
||||||
|
dirs.caches_dir(),
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
for (key, value) in inferred {
|
||||||
|
if let Some(profile_path) = files.get(&key) {
|
||||||
|
if let Some(profile) = profiles.get_mut(profile_path) {
|
||||||
|
if let Some(profile) = profile {
|
||||||
|
profile.projects.insert(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(Self(profiles))
|
Ok(Self(profiles))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -200,29 +200,36 @@ pub async fn infer_data_from_files(
|
|||||||
|
|
||||||
let mut file_str = String::new();
|
let mut file_str = String::new();
|
||||||
if file.read_to_string(&mut file_str).is_ok() {
|
if file.read_to_string(&mut file_str).is_ok() {
|
||||||
if let Ok(pack) = serde_json::from_str::<ForgeMod>(&file_str) {
|
if let Ok(pack) =
|
||||||
let icon = read_icon_from_file(pack.logo_file)?;
|
serde_json::from_str::<ForgeModInfo>(&file_str)
|
||||||
|
{
|
||||||
|
if let Some(pack) = pack.mods.first() {
|
||||||
|
let icon = read_icon_from_file(pack.logo_file.clone())?;
|
||||||
|
|
||||||
return_projects.insert(
|
return_projects.insert(
|
||||||
path.clone(),
|
path.clone(),
|
||||||
Project {
|
Project {
|
||||||
sha512: hash,
|
sha512: hash,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
metadata: ProjectMetadata::Inferred {
|
metadata: ProjectMetadata::Inferred {
|
||||||
title: Some(
|
title: Some(
|
||||||
pack.display_name.unwrap_or(pack.mod_id),
|
pack.display_name
|
||||||
),
|
.clone()
|
||||||
description: pack.description,
|
.unwrap_or(pack.mod_id.clone()),
|
||||||
authors: pack
|
),
|
||||||
.authors
|
description: pack.description.clone(),
|
||||||
.map(|x| vec![x])
|
authors: pack
|
||||||
.unwrap_or_default(),
|
.authors
|
||||||
version: pack.version,
|
.clone()
|
||||||
icon,
|
.map(|x| vec![x])
|
||||||
|
.unwrap_or_default(),
|
||||||
|
version: pack.version.clone(),
|
||||||
|
icon,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
);
|
||||||
);
|
continue;
|
||||||
continue;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,10 @@
|
|||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"tauri": "tauri"
|
"tauri": "tauri",
|
||||||
|
"lint:js": "eslint --ext .js,.vue,.ts,.jsx,.tsx,.html,.vue .",
|
||||||
|
"lint": "npm run lint:js && prettier --check .",
|
||||||
|
"fix": "eslint --fix --ext .js,.vue,.ts,.jsx,.tsx,.html,.vue ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^1.2.0",
|
"@tauri-apps/api": "^1.2.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user