Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move mod bundling into modbase #5

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

74 changes: 0 additions & 74 deletions .github/ISSUE_TEMPLATE/jak1-bug-report.yml

This file was deleted.

74 changes: 0 additions & 74 deletions .github/ISSUE_TEMPLATE/jak2-bug-report.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .github/schemas/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Generated via typescript definitions:

```bash
npx ts-json-schema-generator --path './*.ts' --type 'ModMetadata' > mod-schema.v1.json
```

And then some value validations added on mostly for valid semver checking
43 changes: 43 additions & 0 deletions .github/schemas/mods/v2/mod-schema.v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$ref": "#/definitions/ModMetadata",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"ModMetadata": {
"additionalProperties": false,
"properties": {
"publishedDate": {
"type": "string"
},
"schemaVersion": {
"description": "Semantic Version",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"type": "string"
},
"supportedGames": {
"items": {
"enum": [
"jak1",
"jak2",
"jak3",
"jakx"
],
"type": "string"
},
"type": "array"
},
"version": {
"description": "Semantic Version",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"type": "string"
}
},
"required": [
"schemaVersion",
"version",
"publishedDate",
"supportedGames"
],
"type": "object"
}
}
}
21 changes: 21 additions & 0 deletions .github/schemas/mods/v2/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// interface ChangelogEntry {
// summary: string,
// timestamp: string,
// authors?: string[],
// description?: string,
// }

/**
* Semantic Version
* @pattern ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
*/
type Semver = string;

type SupportedGame = "jak1" | "jak2" | "jak3" | "jakx";

export interface ModMetadata {
schemaVersion: Semver;
version: Semver;
publishedDate: string;
supportedGames: SupportedGame[];
}
27 changes: 27 additions & 0 deletions .github/scripts/create-mod-release/bundle-linux.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from common import (
create_output_dir,
download_release,
finalize_bundle,
get_args,
override_binaries_and_assets,
patch_mod_timestamp_and_version_info,
)

args = get_args("linux")

print(args)

# Create our output directory
create_output_dir(args, "linux")

# Download the Release
download_release(args, "linux", is_zip=False)

# Override any files
override_binaries_and_assets(args, "linux")

# Replace placeholder text with mod version and timestamp
patch_mod_timestamp_and_version_info(args, "linux")

# Rezip it up and prepare it for upload
finalize_bundle(args, "linux", is_zip=False)
27 changes: 27 additions & 0 deletions .github/scripts/create-mod-release/bundle-macos.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from common import (
create_output_dir,
download_release,
finalize_bundle,
get_args,
override_binaries_and_assets,
patch_mod_timestamp_and_version_info,
)

args = get_args("macos-intel")

print(args)

# Create our output directory
create_output_dir(args, "macos-intel")

# Download the Release
download_release(args, "macos-intel", is_zip=False)

# Override any files
override_binaries_and_assets(args, "macos-intel")

# Replace placeholder text with mod version and timestamp
patch_mod_timestamp_and_version_info(args, "macos-intel")

# Rezip it up and prepare it for upload
finalize_bundle(args, "macos-intel", is_zip=False)
27 changes: 27 additions & 0 deletions .github/scripts/create-mod-release/bundle-windows.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from common import (
create_output_dir,
download_release,
finalize_bundle,
get_args,
override_binaries_and_assets,
patch_mod_timestamp_and_version_info,
)

args = get_args("windows")

print(args)

# Create our output directory
create_output_dir(args, "windows")

# Download or Build the Release
download_release(args, "windows", is_zip=True)

# Override any files
override_binaries_and_assets(args, "windows")

# Replace placeholder text with mod version and timestamp
patch_mod_timestamp_and_version_info(args, "windows")

# Rezip it up and prepare it for upload
finalize_bundle(args, "windows", is_zip=True)
Loading