1 | /// <reference types="node" />
|
2 | import { OutgoingHttpHeaders } from "http";
|
3 | export declare type PublishProvider = "github" | "bintray" | "s3" | "spaces" | "generic" | "custom" | "snapStore" | "keygen";
|
4 | export declare type AllPublishOptions = string | GithubOptions | S3Options | SpacesOptions | GenericServerOptions | BintrayOptions | CustomPublishOptions | KeygenOptions | SnapStoreOptions;
|
5 | export interface PublishConfiguration {
|
6 | /**
|
7 | * The provider.
|
8 | */
|
9 | readonly provider: PublishProvider;
|
10 | /**
|
11 | * @private
|
12 | * win-only
|
13 | */
|
14 | publisherName?: Array<string> | null;
|
15 | /**
|
16 | * @private
|
17 | * win-only
|
18 | */
|
19 | readonly updaterCacheDirName?: string | null;
|
20 | /**
|
21 | * Whether to publish auto update info files.
|
22 | *
|
23 | * Auto update relies only on the first provider in the list (you can specify several publishers).
|
24 | * Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.
|
25 | *
|
26 | * @default true
|
27 | */
|
28 | readonly publishAutoUpdate?: boolean;
|
29 | /**
|
30 | * Any custom request headers
|
31 | */
|
32 | readonly requestHeaders?: OutgoingHttpHeaders;
|
33 | }
|
34 | export interface CustomPublishOptions extends PublishConfiguration {
|
35 | /**
|
36 | * The provider. Must be `custom`.
|
37 | */
|
38 | readonly provider: "custom";
|
39 | /**
|
40 | * The Provider to provide UpdateInfo regarding available updates. Required
|
41 | * to use custom providers with electron-updater.
|
42 | */
|
43 | updateProvider?: new (options: CustomPublishOptions, updater: any, runtimeOptions: any) => any;
|
44 | [index: string]: any;
|
45 | }
|
46 | /**
|
47 | * [GitHub](https://help.github.com/articles/about-releases/) options.
|
48 | *
|
49 | * GitHub [personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) is required. You can generate by going to [https://github.com/settings/tokens/new](https://github.com/settings/tokens/new). The access token should have the repo scope/permission.
|
50 | * Define `GH_TOKEN` environment variable.
|
51 | */
|
52 | export interface GithubOptions extends PublishConfiguration {
|
53 | /**
|
54 | * The provider. Must be `github`.
|
55 | */
|
56 | readonly provider: "github";
|
57 | /**
|
58 | * The repository name. [Detected automatically](#github-repository-and-bintray-package).
|
59 | */
|
60 | readonly repo?: string | null;
|
61 | /**
|
62 | * The owner.
|
63 | */
|
64 | readonly owner?: string | null;
|
65 | /**
|
66 | * Whether to use `v`-prefixed tag name.
|
67 | * @default true
|
68 | */
|
69 | readonly vPrefixedTagName?: boolean;
|
70 | /**
|
71 | * The host (including the port if need).
|
72 | * @default github.com
|
73 | */
|
74 | readonly host?: string | null;
|
75 | /**
|
76 | * The protocol. GitHub Publisher supports only `https`.
|
77 | * @default https
|
78 | */
|
79 | readonly protocol?: "https" | "http" | null;
|
80 | /**
|
81 | * The access token to support auto-update from private github repositories. Never specify it in the configuration files. Only for [setFeedURL](/auto-update#appupdatersetfeedurloptions).
|
82 | */
|
83 | readonly token?: string | null;
|
84 | /**
|
85 | * Whether to use private github auto-update provider if `GH_TOKEN` environment variable is defined. See [Private GitHub Update Repo](/auto-update#private-github-update-repo).
|
86 | */
|
87 | readonly private?: boolean | null;
|
88 | /**
|
89 | * The type of release. By default `draft` release will be created.
|
90 | *
|
91 | * Also you can set release type using environment variable. If `EP_DRAFT`is set to `true` — `draft`, if `EP_PRE_RELEASE`is set to `true` — `prerelease`.
|
92 | * @default draft
|
93 | */
|
94 | releaseType?: "draft" | "prerelease" | "release" | null;
|
95 | }
|
96 | /** @private */
|
97 | export declare function githubUrl(options: GithubOptions, defaultHost?: string): string;
|
98 | /**
|
99 | * Generic (any HTTP(S) server) options.
|
100 | * In all publish options [File Macros](/file-patterns#file-macros) are supported.
|
101 | */
|
102 | export interface GenericServerOptions extends PublishConfiguration {
|
103 | /**
|
104 | * The provider. Must be `generic`.
|
105 | */
|
106 | readonly provider: "generic";
|
107 | /**
|
108 | * The base url. e.g. `https://bucket_name.s3.amazonaws.com`.
|
109 | */
|
110 | readonly url: string;
|
111 | /**
|
112 | * The channel.
|
113 | * @default latest
|
114 | */
|
115 | readonly channel?: string | null;
|
116 | /**
|
117 | * Whether to use multiple range requests for differential update. Defaults to `true` if `url` doesn't contain `s3.amazonaws.com`.
|
118 | */
|
119 | readonly useMultipleRangeRequest?: boolean;
|
120 | }
|
121 | /**
|
122 | * Keygen options.
|
123 | * https://keygen.sh/
|
124 | * Define `KEYGEN_TOKEN` environment variable.
|
125 | */
|
126 | export interface KeygenOptions extends PublishConfiguration {
|
127 | /**
|
128 | * The provider. Must be `keygen`.
|
129 | */
|
130 | readonly provider: "keygen";
|
131 | /**
|
132 | * Keygen account's UUID
|
133 | */
|
134 | readonly account: string;
|
135 | /**
|
136 | * Keygen product's UUID
|
137 | */
|
138 | readonly product: string;
|
139 | /**
|
140 | * The channel.
|
141 | * @default stable
|
142 | */
|
143 | readonly channel?: "stable" | "rc" | "beta" | "alpha" | "dev" | null;
|
144 | /**
|
145 | * The target Platform. Is set programmatically explicitly during publishing.
|
146 | */
|
147 | readonly platform?: string | null;
|
148 | }
|
149 | /**
|
150 | * [Snap Store](https://snapcraft.io/) options.
|
151 | */
|
152 | export interface SnapStoreOptions extends PublishConfiguration {
|
153 | /**
|
154 | * The provider. Must be `snapStore`.
|
155 | */
|
156 | readonly provider: "snapStore";
|
157 | /**
|
158 | * snapcraft repo name
|
159 | */
|
160 | readonly repo: string;
|
161 | /**
|
162 | * The list of channels the snap would be released.
|
163 | * @default ["edge"]
|
164 | */
|
165 | readonly channels?: string | Array<string> | null;
|
166 | }
|
167 | export interface BaseS3Options extends PublishConfiguration {
|
168 | /**
|
169 | * The update channel.
|
170 | * @default latest
|
171 | */
|
172 | channel?: string | null;
|
173 | /**
|
174 | * The directory path.
|
175 | * @default /
|
176 | */
|
177 | readonly path?: string | null;
|
178 | /**
|
179 | * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).
|
180 | *
|
181 | * @default public-read
|
182 | */
|
183 | readonly acl?: "private" | "public-read" | null;
|
184 | }
|
185 | export interface S3Options extends BaseS3Options {
|
186 | /**
|
187 | * The provider. Must be `s3`.
|
188 | */
|
189 | readonly provider: "s3";
|
190 | /**
|
191 | * The bucket name.
|
192 | */
|
193 | readonly bucket: string;
|
194 | /**
|
195 | * The region. Is determined and set automatically when publishing.
|
196 | */
|
197 | region?: string | null;
|
198 | /**
|
199 | * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).
|
200 | *
|
201 | * Please see [required permissions for the S3 provider](https://github.com/electron-userland/electron-builder/issues/1618#issuecomment-314679128).
|
202 | *
|
203 | * @default public-read
|
204 | */
|
205 | readonly acl?: "private" | "public-read" | null;
|
206 | /**
|
207 | * The type of storage to use for the object.
|
208 | * @default STANDARD
|
209 | */
|
210 | readonly storageClass?: "STANDARD" | "REDUCED_REDUNDANCY" | "STANDARD_IA" | null;
|
211 | /**
|
212 | * Server-side encryption algorithm to use for the object.
|
213 | */
|
214 | readonly encryption?: "AES256" | "aws:kms" | null;
|
215 | /**
|
216 | * The endpoint URI to send requests to. The default endpoint is built from the configured region.
|
217 | * The endpoint should be a string like `https://{service}.{region}.amazonaws.com`.
|
218 | */
|
219 | readonly endpoint?: string | null;
|
220 | }
|
221 | /**
|
222 | * [DigitalOcean Spaces](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-spaces) options.
|
223 | * Access key is required, define `DO_KEY_ID` and `DO_SECRET_KEY` environment variables.
|
224 | */
|
225 | export interface SpacesOptions extends BaseS3Options {
|
226 | /**
|
227 | * The provider. Must be `spaces`.
|
228 | */
|
229 | readonly provider: "spaces";
|
230 | /**
|
231 | * The space name.
|
232 | */
|
233 | readonly name: string;
|
234 | /**
|
235 | * The region (e.g. `nyc3`).
|
236 | */
|
237 | readonly region: string;
|
238 | }
|
239 | export declare function getS3LikeProviderBaseUrl(configuration: PublishConfiguration): string;
|
240 | /**
|
241 | * [Bintray](https://bintray.com/) options. Requires an API key. An API key can be obtained from the user [profile](https://bintray.com/profile/edit) page ("Edit Your Profile" -> API Key).
|
242 | * Define `BT_TOKEN` environment variable.
|
243 | */
|
244 | export interface BintrayOptions extends PublishConfiguration {
|
245 | /**
|
246 | * The provider. Must be `bintray`.
|
247 | */
|
248 | readonly provider: "bintray";
|
249 | /**
|
250 | * The Bintray package name.
|
251 | */
|
252 | readonly package?: string | null;
|
253 | /**
|
254 | * The Bintray repository name.
|
255 | * @default generic
|
256 | */
|
257 | readonly repo?: string | null;
|
258 | /**
|
259 | * The owner.
|
260 | */
|
261 | readonly owner?: string | null;
|
262 | /**
|
263 | * The Bintray component (Debian only).
|
264 | */
|
265 | readonly component?: string | null;
|
266 | /**
|
267 | * The Bintray distribution (Debian only).
|
268 | * @default stable
|
269 | */
|
270 | readonly distribution?: string | null;
|
271 | /**
|
272 | * The Bintray user account. Used in cases where the owner is an organization.
|
273 | */
|
274 | readonly user?: string | null;
|
275 | readonly token?: string | null;
|
276 | }
|