Giter VIP home page Giter VIP logo

electron-publisher-alioss's Introduction

electron-publisher-alioss

electron-builder AliYun OSS bucket publisher

Base beyond @FNCxPro's electron-publisher-gcs

How to Use

Install electron-publisher-alioss

    npm i -D electron-publisher-alioss

OR

    yarn add -D electron-pulisher-alioss

Cause we can now only to pass the configuration to the publisher by using the "custom" provider(ISSUE#3261: Allow pass configuration to custom electron-publisher provider), so we need to create a electron-publisher-custom.js under the build-resource-folder(it should be build/ as default) , and export the alioss-publisher by ourself.

    // build/electron-publisher-custom.js
    const Publisher = require('electron-publisher-alioss')
    module.exports = Publisher;

Next, set your publish providers as below

//package.json
{
  "name": "your-app-name",
  "build": {
    "appId": "your.appId",
    "compression": "normal",
    "productName": "your App",
    "win": {
      "target": "nsis"
    },
    "publish": [
        {
          "provider": "generic",
          "url": "https:///${name}/${os}/${arch}/"
        },
        {
            "provider": "custom",
            "providerName": "alioss", 
            "path": "/${name}/${os}/${arch}/${filename}",
            "bucket": "test",
            "region": "oss-region",
            "accessKeyId": "your-ali-oss-accesskeyid",
            "accessKeySecret": "your-ali-oss-accesskeysecrect",
            "resumable": true
        }
      ]
  }
}

if you want to save your ali-oss bucket info in anther file, you can use localConfig

//package.json
{
  "name": "your-app-name",
  "build": {
    "appId": "your.appId",
    "compression": "normal",
    "productName": "your App",
    "win": {
      "target": "nsis"
    },
    "publish": [
        {
          "provider": "generic",
          "url": "https:///${name}/${os}/${arch}/"
        },
        {
            "provider": "custom",
            "providerName": "alioss", 
            "localConfig": "~/some/where/u/want/ali-oss-config.json"
        }
      ]
  }
}
// ~/some/where/u/want/ali-oss-config.json
{
    "path": "/${name}/${os}/${arch}/${filename}",
    "bucket": "test",
    "region": "oss-region",
    "accessKeyId": "your-ali-oss-accesskeyid",
    "accessKeySecret": "your-ali-oss-accesskeysecrect",
    "resumable": true
}

Basic setting is done.Enjoy the publish then.

Configurations

path

Type: string
Default: /${name}/${os}/${arch}/${filename}

  • name: the app's name (from electron-builder)
  • os: task.packager.platform.name
  • arch: Architecture
  • filename: The filename of the file being uploaded

Example:

/${name}/${os}/${arch}/${filename}

resumable

Type: boolean
Default: true

maxResume

Type: number default: 5

verbose

Type: boolean
Default: false

electron-publisher-alioss's People

Contributors

hzwzw avatar uihoh0 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.