fix metainfo generation & uploading
This commit is contained in:
10
.github/workflows/meta.yml
vendored
10
.github/workflows/meta.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update:
|
update:
|
||||||
@@ -26,17 +26,13 @@ jobs:
|
|||||||
run: pnpm i
|
run: pnpm i
|
||||||
|
|
||||||
- name: Update metainfo
|
- name: Update metainfo
|
||||||
run: pnpm updateMeta
|
run: pnpm generateMeta
|
||||||
|
|
||||||
- name: Commit and merge in changes
|
- name: Commit and merge in changes
|
||||||
run: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
gh release upload "${{ github.event.release.tag_name }}" meta/dev.vencord.Vesktop.metainfo.xml
|
gh release upload "${{ github.event.release.tag_name }}" dist/dev.vencord.Vesktop.metainfo.xml
|
||||||
|
|
||||||
git add meta/dev.vencord.Vesktop.metainfo.xml
|
|
||||||
git commit -m "metainfo: add entry for ${{ github.event.release.tag_name }}"
|
|
||||||
git push origin HEAD:main
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
"test": "pnpm lint && pnpm testTypes",
|
"test": "pnpm lint && pnpm testTypes",
|
||||||
"testTypes": "tsc --noEmit",
|
"testTypes": "tsc --noEmit",
|
||||||
"watch": "pnpm build --watch",
|
"watch": "pnpm build --watch",
|
||||||
"updateMeta": "tsx scripts/utils/updateMeta.mts",
|
"generateMeta": "tsx scripts/utils/generateMeta.mts",
|
||||||
"updateArrpcDB": "node ./node_modules/arrpc/update_db.js",
|
"updateArrpcDB": "node ./node_modules/arrpc/update_db.js",
|
||||||
"postinstall": "pnpm updateArrpcDB"
|
"postinstall": "pnpm updateArrpcDB"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { promises as fs } from "node:fs";
|
import { promises as fs } from "node:fs";
|
||||||
|
import { mkdir } from "node:fs/promises";
|
||||||
import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
|
import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
|
||||||
import xmlFormat from "xml-formatter";
|
import xmlFormat from "xml-formatter";
|
||||||
|
|
||||||
@@ -50,7 +50,9 @@ const latestReleaseInformation = await fetch("https://api.github.com/repos/Venco
|
|||||||
}
|
}
|
||||||
}).then(res => res.json());
|
}).then(res => res.json());
|
||||||
|
|
||||||
const metaInfo = await fs.readFile("./meta/dev.vencord.Vesktop.metainfo.xml", "utf-8");
|
const metaInfo = await fetch(
|
||||||
|
"https://github.com/Vencord/Vesktop/releases/latest/download/dev.vencord.Vesktop.metainfo.xml"
|
||||||
|
).then(res => res.text());
|
||||||
|
|
||||||
const parser = new DOMParser().parseFromString(metaInfo, "text/xml");
|
const parser = new DOMParser().parseFromString(metaInfo, "text/xml");
|
||||||
|
|
||||||
@@ -90,4 +92,7 @@ const output = xmlFormat(new XMLSerializer().serializeToString(parser), {
|
|||||||
indentation: " "
|
indentation: " "
|
||||||
});
|
});
|
||||||
|
|
||||||
await fs.writeFile("./meta/dev.vencord.Vesktop.metainfo.xml", output, "utf-8");
|
await mkdir("./dist", { recursive: true });
|
||||||
|
await fs.writeFile("./dist/dev.vencord.Vesktop.metainfo.xml", output, "utf-8");
|
||||||
|
|
||||||
|
console.log("Updated meta information written to ./dist/dev.vencord.Vesktop.metainfo.xml");
|
||||||
Reference in New Issue
Block a user