From b5d487ca0aa051d110b27a7702887b0176ddf661 Mon Sep 17 00:00:00 2001 From: Pat O'Neill Date: Wed, 23 Nov 2022 16:18:57 -0500 Subject: [PATCH] chore: gh-release build script no longer needed (#8020) --- build/gh-release.js | 46 --------------------------------------------- package.json | 1 - 2 files changed, 47 deletions(-) delete mode 100644 build/gh-release.js diff --git a/build/gh-release.js b/build/gh-release.js deleted file mode 100644 index 00a98ccfd..000000000 --- a/build/gh-release.js +++ /dev/null @@ -1,46 +0,0 @@ -/* eslint-disable no-console */ - -const ghrelease = require('gh-release'); -const currentChangelog = require('./current-changelog.js'); -const safeParse = require('safe-json-parse/tuple'); -const pkg = require('../package.json'); -const options = { - owner: 'videojs', - repo: 'video.js', - body: currentChangelog(), - assets: ['./dist/video-js-' + pkg.version + '.zip'], - endpoint: 'https://api.github.com', - auth: { - username: process.env.VJS_GITHUB_USER, - password: process.env.VJS_GITHUB_TOKEN - } -}; - -let i = process.argv.length; - -while (i--) { - const arg = process.argv[i]; - - if (arg === '-p' || arg === '--prerelease') { - options.prerelease = true; - } -} - -const tuple = safeParse(process.env.npm_config_argv); -const npmargs = tuple[0] ? [] : tuple[1].cooked; - -if (npmargs.some(function(arg) { - return /next/.test(arg); -})) { - options.prerelease = true; -} - -ghrelease(options, function(err, result) { - if (err) { - console.error('Unable to publish release to github'); - console.error('err:', err); - console.error('result:', result); - } else { - console.log('Publish release to github!'); - } -}); diff --git a/package.json b/package.json index 384e981c7..b28e60ad9 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,6 @@ "netlify": "node ./build/netlify.js", "netlify-docs": "node ./build/netlify-docs.js", "prepublishOnly": "run-p build", - "publish": "node build/gh-release.js", "version": "is-prerelease || npm run changelog && git add CHANGELOG.md", "zip": "cd dist && cross-env bestzip \"./video-js-${npm_package_version}.zip\" * && cd .." },