How to use the electron-publish/out/gitHubPublisher.GitHubPublisher function in electron-publish

To help you get started, we’ve selected a few electron-publish examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / BotFramework-Emulator / packages / app / main / gulpfile.js View on Github external
function publishFiles(filelist) {
  var CancellationToken = require('electron-builder-http/out/CancellationToken').CancellationToken;
  var GitHubPublisher = require('electron-publish/out/gitHubPublisher').GitHubPublisher;
  var publishConfig = replacePublishEnvironmentVars(require('./scripts/config/publish.json'));

  const context = {
    cancellationToken: new CancellationToken(),
    progress: null
  };
  const publisher = new GitHubPublisher(
    context,
    publishConfig,
    pjson.version, {
      publish: "always",
      draft: true,
      prerelease: false
    });
  const errorlist = [];

  const uploads = filelist.map(file => {
    return publisher.upload({ file })
      .catch((err) => {
        errorlist.push(err.response ? `Failed to upload ${file}, http status code ${err.response.statusCode}` : err);
        return Promise.resolve();
      });
  });
github electron-userland / electron-builder / packages / app-builder-lib / src / publish / PublishManager.ts View on Github external
export function createPublisher(context: PublishContext, version: string, publishConfig: PublishConfiguration, options: PublishOptions, packager: Packager): Publisher | null {
  if (debug.enabled) {
    debug(`Create publisher: ${safeStringifyJson(publishConfig)}`)
  }

  const provider = publishConfig.provider
  switch (provider) {
    case "github":
      return new GitHubPublisher(context, publishConfig as GithubOptions, version, options)

    case "bintray":
      return new BintrayPublisher(context, publishConfig as BintrayOptions, version, options)

    case "generic":
      return null

    case "snapStore":
      return new SnapStorePublisher(context, publishConfig as SnapStoreOptions)

    default:
      const clazz = requireProviderClass(provider, packager)
      return clazz == null ? null : new clazz(context, publishConfig)
  }
}
github microsoft / BotFramework-Emulator / packages / app / main / gulpfile.js View on Github external
function publishFiles(filelist) {
  var CancellationToken = require('electron-builder-http/out/CancellationToken').CancellationToken;
  var GitHubPublisher = require('electron-publish/out/gitHubPublisher').GitHubPublisher;
  var publishConfig = replacePublishEnvironmentVars(require('./scripts/config/publish.json'));

  const context = {
    cancellationToken: new CancellationToken(),
    progress: null
  };
  const publisher = new GitHubPublisher(
    context,
    publishConfig,
    pjson.version, {
      publish: "always",
      draft: true,
      prerelease: false
    });
  const errorlist = [];

  const uploads = filelist.map(file => {
    return publisher.upload({ file })
      .catch((err) => {
        errorlist.push(err.response ? `Failed to upload ${file}, http status code ${err.response.statusCode}` : err);
        return Promise.resolve();
      });
  });

electron-publish

Part of [electron-builder](https://github.com/electron-userland/electron-builder).

MIT
Latest version published 2 months ago

Package Health Score

95 / 100
Full package analysis

Similar packages