diff --git a/bin/generate-release.js b/bin/generate-release.js index 1b6593b..118d07e 100644 --- a/bin/generate-release.js +++ b/bin/generate-release.js @@ -1,12 +1,20 @@ #!/usr/bin/env node -/* eslint-disable no-console */ -require("dotenv").config(); +import "dotenv/config"; +import * as path from "path"; +import { Octokit } from "octokit"; +import { readFile } from 'fs/promises'; +import { fileURLToPath } from 'url'; + +import SentryCli from '@sentry/cli'; +const pjson = JSON.parse( + await readFile( + new URL('../package.json', import.meta.url) + ) +); + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const SentryCli = require("@sentry/cli"); -const { Octokit } = require("@octokit/rest"); -const path = require("path"); -const pjson = require(path.join(__dirname, "..", "package.json")); let opts = { auth: `token ${process.env.GITHUB_AUTH_TOKEN}` @@ -35,7 +43,7 @@ async function main() { console.log(`checking ${owner}/${repo} for ${tag_name}`); - let result = await octokit.repos.getLatestRelease({owner, repo}); + let result = await octokit.rest.repos.getLatestRelease({owner, repo}); if ( result.data.tag_name === tag_name ) { console.log("release already created!"); } @@ -43,7 +51,7 @@ async function main() { console.log(release); // Create a release - result = await octokit.repos.createRelease(release); + result = await octokit.rest.repos.createRelease(release); console.log(result); } diff --git a/package-lock.json b/package-lock.json index 3d0454a..f92544d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "before-dawn", - "version": "0.28.0", + "version": "0.29.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "before-dawn", - "version": "0.28.0", + "version": "0.29.0", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -35,7 +35,7 @@ "@babel/plugin-transform-runtime": "^7.12.1", "@babel/preset-env": "^7.7.1", "@electron/rebuild": "^3.6.0", - "@sentry/cli": "^2.1.0", + "@sentry/cli": "^2.30.0", "@sentry/webpack-plugin": "^1.18.9", "babel-loader": "^9.1.2", "babel-plugin-transform-object-rest-spread": "^6.26.0", @@ -4239,15 +4239,14 @@ } }, "node_modules/@sentry/cli": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.1.0.tgz", - "integrity": "sha512-RTT8rD2Z1UoGHLsLdvwztDoP8zWR9TZk6JHDuRZAZbvgCPjlFOUENkRgM9hOOp+nYI/oUy6ZMi/NDe8lVeiLHA==", + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.30.0.tgz", + "integrity": "sha512-GTO5e98vy2QwEYQvhE/ZtGUiVrUu4XungLioJbazm+ZOen8cyac8YOapZfozN5mtxjWOWMOwhOqoTeCU3Q8YKQ==", "dev": true, "hasInstallScript": true, "dependencies": { "https-proxy-agent": "^5.0.0", "node-fetch": "^2.6.7", - "npmlog": "^6.0.1", "progress": "^2.0.3", "proxy-from-env": "^1.1.0", "which": "^2.0.2" @@ -4256,7 +4255,131 @@ "sentry-cli": "bin/sentry-cli" }, "engines": { - "node": ">= 12" + "node": ">= 10" + }, + "optionalDependencies": { + "@sentry/cli-darwin": "2.30.0", + "@sentry/cli-linux-arm": "2.30.0", + "@sentry/cli-linux-arm64": "2.30.0", + "@sentry/cli-linux-i686": "2.30.0", + "@sentry/cli-linux-x64": "2.30.0", + "@sentry/cli-win32-i686": "2.30.0", + "@sentry/cli-win32-x64": "2.30.0" + } + }, + "node_modules/@sentry/cli-darwin": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.30.0.tgz", + "integrity": "sha512-JVesQ9PznbHBOOOwuej2X8/onfXdmAEjBH6fTyWxBl6K8mB4KmBX/aHunXWMBX+VR9X32XZghIqj7acwaFUMPA==", + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-arm": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.30.0.tgz", + "integrity": "sha512-MDB3iS31WKg4krCcLo520yxbUERPeA2DCtk9Qs9vSDbQl6Er64dteHllOdx1SDOyX/7GKcxrQEQ6SMmbnOo6wg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-arm64": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.30.0.tgz", + "integrity": "sha512-JNXPkkMubKoZVlcFIoClSmTb9C/I6Bz08DuAZm2jnjRaaOMiCBxI/l50H3dmfVZ6apjEguG9JkjFdb0kqKB90w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-i686": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.30.0.tgz", + "integrity": "sha512-WhVVziFQw/fO0Cc53pY8goPAzJtIs6ORTR89fVbKwa3ZDNkX++mEOECbP7RkmD87kuRxyKzN543RPV971PcAHw==", + "cpu": [ + "x86", + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-x64": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.30.0.tgz", + "integrity": "sha512-QkiVDeSfspotZ0Au5Yauv2DAm/BC1fL9BwPek/WwddM18I2HqnDp6l4TA4bQeEY++o0KEuNF53cPahpepltPjw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-win32-i686": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.30.0.tgz", + "integrity": "sha512-xLY9B1EEGuNYPKpK6M9PMmcu2PzofdvRtbraTcU6Ck2zALS5oXB9kmWc4dDKucZ/uu9JB0m+Lo4ebaNlca45qQ==", + "cpu": [ + "x86", + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-win32-x64": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.30.0.tgz", + "integrity": "sha512-CiXuxnpJI0zho0XE5PVqIS9CwjDEYoMnHQRIr4Jj9OzlGTJ2iSSU6Zp3Ykd7lgo2iK4P6MfxIBm30gFQPnSvVA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" } }, "node_modules/@sentry/core": { @@ -22145,19 +22268,74 @@ } }, "@sentry/cli": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.1.0.tgz", - "integrity": "sha512-RTT8rD2Z1UoGHLsLdvwztDoP8zWR9TZk6JHDuRZAZbvgCPjlFOUENkRgM9hOOp+nYI/oUy6ZMi/NDe8lVeiLHA==", - "dev": true, - "requires": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.30.0.tgz", + "integrity": "sha512-GTO5e98vy2QwEYQvhE/ZtGUiVrUu4XungLioJbazm+ZOen8cyac8YOapZfozN5mtxjWOWMOwhOqoTeCU3Q8YKQ==", + "dev": true, + "requires": { + "@sentry/cli-darwin": "2.30.0", + "@sentry/cli-linux-arm": "2.30.0", + "@sentry/cli-linux-arm64": "2.30.0", + "@sentry/cli-linux-i686": "2.30.0", + "@sentry/cli-linux-x64": "2.30.0", + "@sentry/cli-win32-i686": "2.30.0", + "@sentry/cli-win32-x64": "2.30.0", "https-proxy-agent": "^5.0.0", "node-fetch": "^2.6.7", - "npmlog": "^6.0.1", "progress": "^2.0.3", "proxy-from-env": "^1.1.0", "which": "^2.0.2" } }, + "@sentry/cli-darwin": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.30.0.tgz", + "integrity": "sha512-JVesQ9PznbHBOOOwuej2X8/onfXdmAEjBH6fTyWxBl6K8mB4KmBX/aHunXWMBX+VR9X32XZghIqj7acwaFUMPA==", + "dev": true, + "optional": true + }, + "@sentry/cli-linux-arm": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.30.0.tgz", + "integrity": "sha512-MDB3iS31WKg4krCcLo520yxbUERPeA2DCtk9Qs9vSDbQl6Er64dteHllOdx1SDOyX/7GKcxrQEQ6SMmbnOo6wg==", + "dev": true, + "optional": true + }, + "@sentry/cli-linux-arm64": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.30.0.tgz", + "integrity": "sha512-JNXPkkMubKoZVlcFIoClSmTb9C/I6Bz08DuAZm2jnjRaaOMiCBxI/l50H3dmfVZ6apjEguG9JkjFdb0kqKB90w==", + "dev": true, + "optional": true + }, + "@sentry/cli-linux-i686": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.30.0.tgz", + "integrity": "sha512-WhVVziFQw/fO0Cc53pY8goPAzJtIs6ORTR89fVbKwa3ZDNkX++mEOECbP7RkmD87kuRxyKzN543RPV971PcAHw==", + "dev": true, + "optional": true + }, + "@sentry/cli-linux-x64": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.30.0.tgz", + "integrity": "sha512-QkiVDeSfspotZ0Au5Yauv2DAm/BC1fL9BwPek/WwddM18I2HqnDp6l4TA4bQeEY++o0KEuNF53cPahpepltPjw==", + "dev": true, + "optional": true + }, + "@sentry/cli-win32-i686": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.30.0.tgz", + "integrity": "sha512-xLY9B1EEGuNYPKpK6M9PMmcu2PzofdvRtbraTcU6Ck2zALS5oXB9kmWc4dDKucZ/uu9JB0m+Lo4ebaNlca45qQ==", + "dev": true, + "optional": true + }, + "@sentry/cli-win32-x64": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.30.0.tgz", + "integrity": "sha512-CiXuxnpJI0zho0XE5PVqIS9CwjDEYoMnHQRIr4Jj9OzlGTJ2iSSU6Zp3Ykd7lgo2iK4P6MfxIBm30gFQPnSvVA==", + "dev": true, + "optional": true + }, "@sentry/core": { "version": "7.92.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.92.0.tgz", diff --git a/package.json b/package.json index 90f86dc..188b21b 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "@babel/preset-env": "^7.7.1", "@electron/rebuild": "^3.6.0", "octokit": "^3.1.2", - "@sentry/cli": "^2.1.0", + "@sentry/cli": "^2.30.0", "@sentry/webpack-plugin": "^1.18.9", "babel-loader": "^9.1.2", "babel-plugin-transform-object-rest-spread": "^6.26.0",