Prepare for version 0.9 #8
No files matched your search
@@ -0,0 +1,50 @@
|
||||
name: Foundry VTT System Release
|
||||
|
||||
on:
|
||||
push:
|
||||
# Der Workflow startet, sobald ein Tag gepusht wird (z.B. v1.0.4)
|
||||
# Das ist sicherer als jeder normale Merge auf Main, da du so die Versionskontrolle behältst.
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
build-and-release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Code auschecken
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Node.js einrichten
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-size: 20
|
||||
|
||||
- name: Abhängigkeiten installieren
|
||||
run: npm ci
|
||||
|
||||
# Falls du Vite/Sass nutzt, entkommentiere die nächste Zeile, um dein CSS/JS zu bauen:
|
||||
- name: System kompilieren
|
||||
run: npm run vite:build
|
||||
|
||||
- name: Release-Dateien vorbereiten (Script ausführen)
|
||||
env:
|
||||
GITEA_URL: ${{ gitea.server_url }}
|
||||
GITEA_REPOSITORY: ${{ gitea.repository }}
|
||||
GITEA_REF_NAME: ${{ gitea.ref_name }}
|
||||
GITEA_REF_TYPE: ${{ gitea.ref_type }}
|
||||
run: node release.js
|
||||
|
||||
- name: Gitea Release erstellen und Assets hochladen
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
# Dieser Token wird von Gitea automatisch bereitgestellt
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ gitea.ref_name }}
|
||||
release_name: Release ${{ gitea.ref_name }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
# Hier laden wir die bearbeitete system.json und die zip hoch
|
||||
files: |
|
||||
system.json
|
||||
system.zip
|
||||
Generated
+1
-1
@@ -18,7 +18,7 @@
|
||||
"fvtt-types": "^13.346.0-beta.20250812191140",
|
||||
"globals": "^17.7.0",
|
||||
"prettier": "^3.8.4",
|
||||
"sass": "^1.105.2",
|
||||
"sass": "^1.101.0",
|
||||
"typescript": "^5.6.0",
|
||||
"typescript-eslint": "^8.62.0",
|
||||
"vite": "^5.4.0",
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import archiver from "archiver";
|
||||
|
||||
// Pfade definieren (Passe an, falls dein Gitea-Benutzer/Repo-Name anders heißt)
|
||||
const GITEA_URL = process.env.GITEA_URL;
|
||||
const REPO = process.env.GITEA_REPOSITORY;
|
||||
const RELEASE_TAG = process.env.GITEA_REF_NAME || "v1.0.0";
|
||||
|
||||
const systemJsonPath = path.resolve("./system.json");
|
||||
|
||||
// 1. system.json einlesen und Update-Pfade für Foundry patchen
|
||||
const systemJson = JSON.parse(fs.readFileSync(systemJsonPath, "utf8"));
|
||||
|
||||
// Wenn das Script über ein Tag läuft, nehmen wir das Tag ohne das "v" als Versionsnummer
|
||||
if (process.env.GITEA_REF_TYPE === "tag") {
|
||||
systemJson.version = RELEASE_TAG.replace("v", "");
|
||||
}
|
||||
|
||||
// Update-URLs dynamisch generieren
|
||||
systemJson.manifest = `${GITEA_URL}/api/v1/repos/${REPO}/raw/system.json`;
|
||||
systemJson.download = `${GITEA_URL}/api/v1/repos/${REPO}/releases/download/${RELEASE_TAG}/system.zip`;
|
||||
|
||||
// Modifizierte system.json zurückschreiben
|
||||
fs.writeFileSync(systemJsonPath, JSON.stringify(systemJson, null, 2));
|
||||
console.log(`✅ system.json erfolgreich für Version ${systemJson.version} aktualisiert.`);
|
||||
|
||||
// 2. zip-Archiv für Foundry erstellen
|
||||
async function zipDirectory(sourceDir, outPath) {
|
||||
const archive = archiver("zip", { zlib: { level: 9 } });
|
||||
const stream = fs.createWriteStream(outPath);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
archive
|
||||
.directory(sourceDir, false)
|
||||
.on("error", (err) => reject(err))
|
||||
.pipe(stream);
|
||||
|
||||
stream.on("close", () => resolve());
|
||||
archive.finalize();
|
||||
});
|
||||
}
|
||||
|
||||
// Kopiert wichtige Dateien in einen temporären Build-Ordner (dist) und zippt ihn
|
||||
// Passe die Liste an, je nachdem was in deiner system.zip landen muss!
|
||||
const filesToInclude = ["src/system.json", "templates", "dist", "lang", "assets"];
|
||||
|
||||
const distDir = path.resolve("./dist");
|
||||
if (!fs.existsSync(distDir)) fs.mkdirSync(distDir);
|
||||
|
||||
for (const file of filesToInclude) {
|
||||
if (fs.existsSync(file)) {
|
||||
const dest = path.join(distDir, file);
|
||||
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
||||
if (fs.lstatSync(file).isDirectory()) {
|
||||
fs.cpSync(file, dest, { recursive: true });
|
||||
} else {
|
||||
fs.copyFileSync(file, dest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await zipDirectory(distDir, "./system.zip");
|
||||
console.log("✅ system.zip wurde erfolgreich generiert.");
|
||||
+1
-1
@@ -5,7 +5,7 @@ export const systemID = "midgard6-lvd";
|
||||
* @param {string} path - A path relative to the root of this repository.
|
||||
* @returns {string} The path relative to the Foundry data folder.
|
||||
*/
|
||||
export const systemPath = (path) => `systems/${systemID}/src/${path}`;
|
||||
export const systemPath = (path) => `systems/${systemID}/${path}`;
|
||||
export const assetPath = (path) => `systems/${systemID}/assets/${path}`;
|
||||
|
||||
export const swordSVG = "systems/midgard6-lvd/assets/sword.svg";
|
||||
@@ -1,6 +1,6 @@
|
||||
export const loadPartials = async function () {
|
||||
await foundry.applications.handlebars.loadTemplates([
|
||||
"systems/midgard6-lvd/src/templates/chat/chat-message-header.hbs",
|
||||
"systems/midgard6-lvd/src/templates/chat/secret-roll.hbs"
|
||||
"systems/midgard6-lvd/templates/chat/chat-message-header.hbs",
|
||||
"systems/midgard6-lvd/templates/chat/secret-roll.hbs"
|
||||
]);
|
||||
};
|
||||
@@ -8,6 +8,10 @@
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.portrait {
|
||||
padding: 0 4px;
|
||||
}
|
||||
}
|
||||
.chat-message.message {
|
||||
background-color: var(--M6-background-grey);
|
||||
@@ -69,7 +73,7 @@
|
||||
gap: 0.125rem;
|
||||
list-style-type: none;
|
||||
padding-left: 0;
|
||||
margin-bottom: 0.125rem;
|
||||
margin: 0.25rem;
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
<header class="message-header flexrow">
|
||||
<div class="portrait token">
|
||||
<div class="portrait">
|
||||
<img src="{{portrait}}" alt="{{alias}}" inert />
|
||||
</div>
|
||||
<div class="message-names flexcol">
|
||||
@@ -1,5 +1,5 @@
|
||||
<li class="chat-message message flexcol {{cssClass}}" data-message-id="{{message._id}}" {{#if borderColor}}style="border-color:{{borderColor}}"{{/if}}>
|
||||
{{> "systems/midgard6-lvd/src/templates/chat/chat-message-header.hbs"}}
|
||||
{{> "systems/midgard6-lvd/templates/chat/chat-message-header.hbs"}}
|
||||
|
||||
{{!-- <hr> --}}
|
||||
{{#if isContentVisible}}
|
||||
@@ -7,7 +7,9 @@
|
||||
{{#if isSpell}}
|
||||
<div class="tags {{#unless zeigeZauberAlsTag}}hidden{{/unless}}">
|
||||
{{#each eigenschaften as |eigenschaft|}}
|
||||
<div class="tag">{{eigenschaft}}</div>
|
||||
{{#if eigenschaft}}
|
||||
<div class="tag">{{eigenschaft}}</div>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</div>
|
||||
<div
|
||||
@@ -62,6 +64,6 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{> "systems/midgard6-lvd/src/templates/chat/secret-roll.hbs"}}
|
||||
{{> "systems/midgard6-lvd/templates/chat/secret-roll.hbs"}}
|
||||
{{/if}}
|
||||
</li>
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user