Giter VIP home page Giter VIP logo

electron-simple-publisher's Introduction

logo

electron-simple-publisher

Build Status npm version

Description

This module makes easy to publish updates created by electron-builder. Now SSH, github, ftp, Amazon S3 and local release transports are supported. You can enable update feature in your application using electron-simple-updater

Installation

Install with npm:

npm install --save-dev electron-simple-publisher

Usage

  1. For windows build set the target value to squirrel in package.json:
...
"build": {
  ...
  "win": {
    "target": "squirrel"
  }
},
...
  1. Make a distributive package using electron-builder

  2. Set options: You can specify all option through command line arguments, but it's easier to store the config in publisher.js or publisher.json in the project root. Here is an example for publishing through SSH:

{
  "transport": {
    "module": "ssh",
    "host": "example.com",
    "username": "user",
    "password": "user's password",
    "remotePath": "/www/example.com/updates",
    "remoteUrl": "http://example.com/updates",
  },
  "fields": { // Additional fields which will be added to updates.json
    "readme": "The first version"
  },
  // If you've already set package.json:updater.url you can skip this option:
  "updatesJsonUrl": "http://example.com/updates/update.json"
}
  1. Run a publish command:

$ node_modules/.bin/publish - will publish the latest build for the current platform

Command line arguments

Usage: publish [command] [options] [arguments]

Commands (default is publish):
  publish [configFile] [buildId1 Id2 …|all] Publish a new build(s).
  replace [configFile] [buildId]            Replace the current build.
  remove  [configFile] [buildId1 Id2 …]     Remove one or more builds.
  list    [configFile]                      Show builds on a hosting.

BuildId has a following format: [platform]-[arch]-[channel]-v[version]
  You can specify only a part of buildId, like linux-x64, defaults:
    platform: process.platform
    arch:     process.arch
    channel:  package.json:updater.channel or prod
    version:  package.json:version

Options:
  configFile         File with json ext, defaults to ./publisher.js
  -t or --transport  Name of node module which implements Transport interface.
  --transport-{name} Specify the {name} transport option
  -p or --path       Path to distributive files (default dist).
  -d or --debug      Show debug information
  --field-{name}     Set updates.json:{buildId}.{name} field
  -h or --help       Show this message

Transports

Upload releases using SSH protocol. This transport uses ssh2 internally so you can check its documentation for all transport options.

Upload updates to github releases. You can use this transport even if you don't want to share your source code. For this purposes you just need to create a public repository which will store your releases.

Upload releases using FTP protocol. This transport uses node-ftp internally so you can check its documentation for all transport options.

Upload releases to S3 storage.

This transport allows to create file structure which can be uploaded to a server manually.

Related

License

Licensed under MIT.

electron-simple-publisher's People

Contributors

linwaiwai avatar megahertz avatar rdiazv avatar yuanfang-dev avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.