mirror of
https://github.com/open-goal/jak-project
synced 2026-07-11 07:25:37 -04:00
release: include error metadata file for launcher purposes (#1463)
* release: include error metadata file for launcher purposes * release: put release assets in the top level of the 7z/tarball (no out/ dir) * extractor: ensure critical directories are created * extractor: handle weird Win32 path prefix `\\?\` by stripping it out * release: avoid using `-C` with `tar`
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"4000": {
|
||||
"msg": "Validation Failed: Cannot locate ELF"
|
||||
},
|
||||
"4001": {
|
||||
"msg": "Validation Failed: Game serial missing from valid game database"
|
||||
},
|
||||
"4002": {
|
||||
"msg": "Validation Failed: ELF missing from valid game database"
|
||||
},
|
||||
"4010": {
|
||||
"msg": "Validation Failed: Bad or unexpected ISO contents"
|
||||
},
|
||||
"4011": {
|
||||
"msg": "Validation Failed: Extracted an unexpected amount of files from ISO"
|
||||
},
|
||||
"4020": {
|
||||
"msg": "Validation Failed: ISO Extraction failed, output directory did not contain expected files"
|
||||
}
|
||||
}
|
||||
@@ -16,13 +16,15 @@ strip $DEST/goalc
|
||||
strip $DEST/extractor
|
||||
|
||||
mkdir -p $DEST/data
|
||||
mkdir -p $DEST/data/launcher/
|
||||
mkdir -p $DEST/data/decompiler/
|
||||
mkdir -p $DEST/data/assets
|
||||
mkdir -p $DEST/data/game
|
||||
mkdir -p $DEST/data/log
|
||||
mkdir -p $DEST/data/game/graphics/opengl_renderer/
|
||||
|
||||
cp -r $SOURCE/.github/scripts/releases/error-code-metadata.json $DEST/data/launcher/error-code-metadata.json
|
||||
cp -r $SOURCE/decompiler/config $DEST/data/decompiler/
|
||||
cp -r $SOURCE/goal_src $DEST/data
|
||||
cp -r $SOURCE/game/assets $DEST/data/game/
|
||||
cp -r $SOURCE/game/graphics/opengl_renderer/shaders $DEST/data/game/graphics/opengl_renderer
|
||||
cp -r $SOURCE/game/graphics/opengl_renderer/shaders $DEST/data/game/graphics/opengl_renderer
|
||||
|
||||
@@ -12,12 +12,14 @@ cp $SOURCE/build/bin/goalc.exe $DEST
|
||||
cp $SOURCE/build/bin/extractor.exe $DEST
|
||||
|
||||
mkdir -p $DEST/data
|
||||
mkdir -p $DEST/data/launcher/
|
||||
mkdir -p $DEST/data/decompiler/
|
||||
mkdir -p $DEST/data/assets
|
||||
mkdir -p $DEST/data/game
|
||||
mkdir -p $DEST/data/log
|
||||
mkdir -p $DEST/data/game/graphics/opengl_renderer/
|
||||
|
||||
cp -r $SOURCE/.github/scripts/releases/error-code-metadata.json $DEST/data/launcher/error-code-metadata.json
|
||||
cp -r $SOURCE/decompiler/config $DEST/data/decompiler/
|
||||
cp -r $SOURCE/goal_src $DEST/data
|
||||
cp -r $SOURCE/game/assets $DEST/data/game/
|
||||
|
||||
@@ -114,9 +114,8 @@ jobs:
|
||||
run: |
|
||||
mkdir -p ./ci-artifacts/out
|
||||
./.github/scripts/releases/extract_build_linux.sh ./ci-artifacts/out ./
|
||||
pushd ci-artifacts
|
||||
tar czf linux.tar.gz ./out
|
||||
popd
|
||||
cd ci-artifacts/out
|
||||
tar czf ../linux.tar.gz .
|
||||
|
||||
- name: Upload Assets and Potential Publish Release
|
||||
if: github.repository == 'open-goal/jak-project' && startsWith(github.ref, 'refs/tags/') && matrix.compiler == 'clang'
|
||||
|
||||
@@ -85,7 +85,7 @@ jobs:
|
||||
run: |
|
||||
mkdir -p ./ci-artifacts/out
|
||||
./.github/scripts/releases/extract_build_windows.sh ./ci-artifacts/out ./
|
||||
7z a -tzip ./ci-artifacts/windows.zip ./ci-artifacts/out
|
||||
7z a -tzip ./ci-artifacts/windows.zip ./ci-artifacts/out/*
|
||||
|
||||
- name: Upload Assets and Potential Publish Release
|
||||
if: github.repository == 'open-goal/jak-project' && startsWith(github.ref, 'refs/tags/') && matrix.compiler == 'clang'
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
#include "common/util/Assert.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
|
||||
namespace lg {
|
||||
struct Logger {
|
||||
@@ -79,6 +80,7 @@ void log_message(level log_level, LogTime& now, const char* message) {
|
||||
|
||||
void set_file(const std::string& filename) {
|
||||
ASSERT(!gLogger.fp);
|
||||
file_util::create_dir_if_needed_for_file(filename);
|
||||
gLogger.fp = fopen(filename.c_str(), "w");
|
||||
ASSERT(gLogger.fp);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <cstring>
|
||||
#endif
|
||||
#include "common/util/Assert.h"
|
||||
#include <common/log/log.h>
|
||||
|
||||
namespace file_util {
|
||||
std::filesystem::path get_user_home_dir() {
|
||||
@@ -70,7 +71,11 @@ std::string get_current_executable_path() {
|
||||
#ifdef _WIN32
|
||||
char buffer[FILENAME_MAX];
|
||||
GetModuleFileNameA(NULL, buffer, FILENAME_MAX);
|
||||
return std::string(buffer);
|
||||
std::string file_path(buffer);
|
||||
if (file_path.rfind("\\\\?\\", 0) == 0) {
|
||||
return file_path.substr(4);
|
||||
}
|
||||
return file_path;
|
||||
#else
|
||||
// do Linux stuff
|
||||
char buffer[FILENAME_MAX + 1];
|
||||
@@ -201,7 +206,7 @@ void write_rgba_png(const std::string& name, void* data, int w, int h) {
|
||||
void write_text_file(const std::string& file_name, const std::string& text) {
|
||||
FILE* fp = fopen(file_name.c_str(), "w");
|
||||
if (!fp) {
|
||||
printf("Failed to fopen %s\n", file_name.c_str());
|
||||
lg::error("Failed to fopen {}\n", file_name);
|
||||
throw std::runtime_error("Failed to open file");
|
||||
}
|
||||
fprintf(fp, "%s\n", text.c_str());
|
||||
|
||||
@@ -261,6 +261,9 @@ void decompile(std::filesystem::path jak1_input_files) {
|
||||
db.find_code(config);
|
||||
db.process_labels();
|
||||
|
||||
// ensure asset dir exists
|
||||
file_util::create_dir_if_needed(file_util::get_file_path({"assets"}));
|
||||
|
||||
// text files
|
||||
{
|
||||
auto result = db.process_game_text_files(config);
|
||||
|
||||
Reference in New Issue
Block a user