GetToken/.github/postbuild.js

20 lines
633 B
JavaScript
Raw Permalink Normal View History

2022-11-23 06:30:13 +00:00
const fs = require("fs")
const utils = require("./utils");
(async () => {
try {
const latestVersionInfo = await utils.getAppVersion()
let releaseInfo = await utils.getLatestRelease()
if (releaseInfo.name !== latestVersionInfo["package_version"]) {
releaseInfo = await utils.createRelease(latestVersionInfo["package_version"], undefined)
}
for (const path of fs.readdirSync("out")) {
console.log(`upload ${path}...`)
2022-11-23 06:40:57 +00:00
await utils.uploadReleaseAsset(releaseInfo["upload_url"], `out/${path}`)
2022-11-23 06:30:13 +00:00
}
} catch (e) {
console.log(e)
}
})()
2022-11-23 06:40:57 +00:00