Skip to content

Commit c82cc7a

Browse files
committed
fix metainfo generation & uploading
1 parent 6a43e13 commit c82cc7a

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

.github/workflows/meta.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
permissions:
10-
contents: write
10+
contents: write
1111

1212
jobs:
1313
update:
@@ -26,17 +26,13 @@ jobs:
2626
run: pnpm i
2727

2828
- name: Update metainfo
29-
run: pnpm updateMeta
29+
run: pnpm generateMeta
3030

3131
- name: Commit and merge in changes
3232
run: |
3333
git config user.name "github-actions[bot]"
3434
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
3535
36-
gh release upload "${{ github.event.release.tag_name }}" meta/dev.vencord.Vesktop.metainfo.xml
37-
38-
git add meta/dev.vencord.Vesktop.metainfo.xml
39-
git commit -m "metainfo: add entry for ${{ github.event.release.tag_name }}"
40-
git push origin HEAD:main
36+
gh release upload "${{ github.event.release.tag_name }}" dist/dev.vencord.Vesktop.metainfo.xml
4137
env:
4238
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"test": "pnpm lint && pnpm testTypes",
2323
"testTypes": "tsc --noEmit",
2424
"watch": "pnpm build --watch",
25-
"updateMeta": "tsx scripts/utils/updateMeta.mts",
25+
"generateMeta": "tsx scripts/utils/generateMeta.mts",
2626
"updateArrpcDB": "node ./node_modules/arrpc/update_db.js",
2727
"postinstall": "pnpm updateArrpcDB"
2828
},
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { promises as fs } from "node:fs";
8-
8+
import { mkdir } from "node:fs/promises";
99
import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
1010
import xmlFormat from "xml-formatter";
1111

@@ -50,7 +50,9 @@ const latestReleaseInformation = await fetch("https://api.github.com/repos/Venco
5050
}
5151
}).then(res => res.json());
5252

53-
const metaInfo = await fs.readFile("./meta/dev.vencord.Vesktop.metainfo.xml", "utf-8");
53+
const metaInfo = await fetch(
54+
"https://github.com/Vencord/Vesktop/releases/latest/download/dev.vencord.Vesktop.metainfo.xml"
55+
).then(res => res.text());
5456

5557
const parser = new DOMParser().parseFromString(metaInfo, "text/xml");
5658

@@ -90,4 +92,7 @@ const output = xmlFormat(new XMLSerializer().serializeToString(parser), {
9092
indentation: " "
9193
});
9294

93-
await fs.writeFile("./meta/dev.vencord.Vesktop.metainfo.xml", output, "utf-8");
95+
await mkdir("./dist", { recursive: true });
96+
await fs.writeFile("./dist/dev.vencord.Vesktop.metainfo.xml", output, "utf-8");
97+
98+
console.log("Updated meta information written to ./dist/dev.vencord.Vesktop.metainfo.xml");

0 commit comments

Comments
 (0)