Skip to content

Commit

Permalink
Include manifest in release
Browse files Browse the repository at this point in the history
  • Loading branch information
asportnoy committed Jan 28, 2023
1 parent dabb7ef commit 57e8968
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:

- uses: ncipollo/release-action@v1
with:
artifacts: "*.asar"
artifacts: "bundle/*"
makeLatest: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ dist
# TernJS port file
.tern-port

/*.asar
/bundle
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"discordID": "489484338514100234",
"github": "asportnoy"
},
"version": "1.0.2",
"version": "1.0.3",
"updater": {
"type": "github",
"id": "asportnoy/no-nitro-upsell"
Expand Down
12 changes: 8 additions & 4 deletions scripts/bundle.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import asar from "@electron/asar";
import { readFileSync } from "fs";
import { copyFileSync, existsSync, mkdirSync, readFileSync } from "fs";
import { PluginManifest } from "replugged/dist/types/addon";

const manifest = JSON.parse(readFileSync("manifest.json", "utf-8")) as PluginManifest;
const outputName = `${manifest.id}.asar`;
const manifest = JSON.parse(readFileSync("dist/manifest.json", "utf-8")) as PluginManifest;
const outputName = `bundle/${manifest.id}`;

asar.createPackage("dist", outputName);
if (!existsSync("bundle")) {
mkdirSync("bundle");
}
asar.createPackage("dist", `${outputName}.asar`);
copyFileSync("dist/manifest.json", `${outputName}.json`);

0 comments on commit 57e8968

Please sign in to comment.