57 lines
5.8 KiB
JavaScript
57 lines
5.8 KiB
JavaScript
|
"use strict";
|
||
|
|
||
|
Object.defineProperty(exports, "__esModule", {
|
||
|
value: true
|
||
|
});
|
||
|
exports.default = void 0;
|
||
|
|
||
|
require("source-map-support/register");
|
||
|
|
||
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||
|
|
||
|
class Publisher {
|
||
|
constructor(config, providedPlatforms) {
|
||
|
this.config = config;
|
||
|
this.providedPlatforms = providedPlatforms;
|
||
|
|
||
|
_defineProperty(this, "name", void 0);
|
||
|
|
||
|
_defineProperty(this, "defaultPlatforms", void 0);
|
||
|
|
||
|
_defineProperty(this, "__isElectronForgePublisher", void 0);
|
||
|
|
||
|
this.config = config;
|
||
|
Object.defineProperty(this, '__isElectronForgePublisher', {
|
||
|
value: true,
|
||
|
enumerable: false,
|
||
|
configurable: false
|
||
|
});
|
||
|
}
|
||
|
|
||
|
get platforms() {
|
||
|
if (this.providedPlatforms) return this.providedPlatforms;
|
||
|
if (this.defaultPlatforms) return this.defaultPlatforms;
|
||
|
return ['win32', 'linux', 'darwin', 'mas'];
|
||
|
}
|
||
|
/**
|
||
|
* Publishers must implement this method to publish the artifacts returned from
|
||
|
* make calls. If any errors occur you must throw them, failing silently or simply
|
||
|
* logging will not propagate issues up to forge.
|
||
|
*
|
||
|
* Please note for a given version publish will be called multiple times, once
|
||
|
* for each set of "platform" and "arch". This means if you are publishing
|
||
|
* darwin and win32 artifacts to somewhere like GitHub on the first publish call
|
||
|
* you will have to create the version on GitHub and the second call will just
|
||
|
* be appending files to the existing version.
|
||
|
*/
|
||
|
|
||
|
|
||
|
async publish(opts) {
|
||
|
// eslint-disable-line @typescript-eslint/no-unused-vars
|
||
|
throw new Error(`Publisher ${this.name} did not implement the publish method`);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
exports.default = Publisher;
|
||
|
//# sourceM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