aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternDump.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternDump.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternDump.kt30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternDump.kt b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternDump.kt
new file mode 100644
index 000000000..6cacb9a53
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternDump.kt
@@ -0,0 +1,30 @@
+package at.hannibal2.skyhanni.utils.repopatterns
+
+import at.hannibal2.skyhanni.utils.KSerializable
+
+/**
+ * A class containing a dump of all regexes that are defined using [RepoPattern].
+ *
+ * # Generating a dump
+ * This dump is generated by the `.github/workflows/generate-constants.yaml` using the gradle task `generateRepoPatterns`.
+ * Said gradle task then launches Minecraft headless with environment variables set so that [RepoPatternManager.onPreInitFinished]
+ * calls [RepoPatternManager.dump] and closes afterward. The GitHub action then looks at the current branch and repo,
+ * and if it finds itself to be running on hannibal002/SkyHanni:beta, it commits that generated dump to the SkyHanni REPO.
+ *
+ * # Using the dump
+ * All clients upon launching will then look at that dump generated by the latest beta version, even if they themselves
+ * run an older SkyHanni version. The regexes generated by the dump will then take precedence over the ones found in the
+ * running JAR.
+ *
+ * # Setting up the `generate-constants.yaml` workflow
+ * The GitHub action workflow needs to be configured properly. For that it needs to have the
+ * `env.data_repo` key adjusted to be the live repo.
+ * It also needs a [repository GitHub action secret](https://github.com/nea89o/SkyHanni/settings/secrets/actions)
+ * called `REPO_PAT`, which contains a [personal access token](https://github.com/settings/tokens/new) with repo write
+ * access to the live repo.
+ */
+@KSerializable
+data class RepoPatternDump(
+ val sourceLabel: String = "anonymous",
+ val regexes: Map<String, String> = mapOf(),
+)