Update the manifest uploading to use the environment variable
This commit is contained in:
parent
3fa0aa7873
commit
e22278d9db
1 changed files with 15 additions and 2 deletions
|
|
@ -1,5 +1,12 @@
|
||||||
import { createReadStream } from "fs";
|
import { createReadStream } from "fs";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { config } from "dotenv";
|
||||||
|
import { assertEnvKey } from "./utils.mjs";
|
||||||
|
|
||||||
|
config({ quiet: true });
|
||||||
|
assertEnvKey("MANIFEST");
|
||||||
|
|
||||||
|
const MANIFEST_FILE = process.env.MANIFEST;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
TAG,
|
TAG,
|
||||||
|
|
@ -41,9 +48,15 @@ const release = await axios.post(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const manifestName = MANIFEST_FILE.split(`/`).at(-1);
|
||||||
|
if (!manifestName) {
|
||||||
|
console.error(`Failed to parse manifest name from: ${MANIFEST_FILE}`);
|
||||||
|
process.exit(1);
|
||||||
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await addReleaseAsset(release.data.id, `release.zip`);
|
await addReleaseAsset(release.data.id, `release.zip`, `release.zip`);
|
||||||
await addReleaseAsset(release.data.id, `system.json`);
|
await addReleaseAsset(release.data.id, manifestName, MANIFEST_FILE);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(`Failed to add assets to the release`);
|
console.error(`Failed to add assets to the release`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue