UNPKG

7.31 kBTypeScriptView Raw
1export declare type PublishProvider = "github" | "bintray" | "s3" | "spaces" | "generic" | "custom";
2export declare type AllPublishOptions = string | GithubOptions | S3Options | SpacesOptions | GenericServerOptions | BintrayOptions | CustomPublishOptions;
3export declare type Publish = AllPublishOptions | Array<AllPublishOptions> | null;
4export interface PublishConfiguration {
5 /**
6 * The provider.
7 */
8 readonly provider: PublishProvider;
9 /**
10 * @private
11 * win-only
12 */
13 publisherName?: Array<string> | null;
14 /**
15 * @private
16 * win-only
17 */
18 readonly updaterCacheDirName?: string | null;
19 /**
20 * Whether to publish auto update info files.
21 *
22 * Auto update relies only on the first provider in the list (you can specify several publishers).
23 * Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.
24 *
25 * @default true
26 */
27 readonly publishAutoUpdate?: boolean;
28}
29export interface CustomPublishOptions extends PublishConfiguration {
30 [index: string]: any;
31}
32/**
33 * [GitHub](https://help.github.com/articles/about-releases/) options.
34 *
35 * 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.
36 * Define `GH_TOKEN` environment variable.
37 */
38export interface GithubOptions extends PublishConfiguration {
39 /**
40 * The provider. Must be `github`.
41 */
42 readonly provider: "github";
43 /**
44 * The repository name. [Detected automatically](#github-repository-and-bintray-package).
45 */
46 readonly repo?: string | null;
47 /**
48 * The owner.
49 */
50 readonly owner?: string | null;
51 /**
52 * Whether to use `v`-prefixed tag name.
53 * @default true
54 */
55 readonly vPrefixedTagName?: boolean;
56 /**
57 * The host (including the port if need).
58 * @default github.com
59 */
60 readonly host?: string | null;
61 /**
62 * The protocol. GitHub Publisher supports only `https`.
63 * @default https
64 */
65 readonly protocol?: "https" | "http" | null;
66 /**
67 * The access token to support auto-update from private github repositories. Never specify it in the configuration files. Only for [setFeedURL](/auto-update#appupdatersetfeedurloptions).
68 */
69 readonly token?: string | null;
70 /**
71 * 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).
72 */
73 readonly private?: boolean | null;
74 /**
75 * The type of release. By default `draft` release will be created.
76 *
77 * 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`.
78 * @default draft
79 */
80 releaseType?: "draft" | "prerelease" | "release" | null;
81}
82/** @private */
83export declare function githubUrl(options: GithubOptions, defaultHost?: string): string;
84/**
85 * Generic (any HTTP(S) server) options.
86 * In all publish options [File Macros](/file-patterns#file-macros) are supported.
87 */
88export interface GenericServerOptions extends PublishConfiguration {
89 /**
90 * The provider. Must be `generic`.
91 */
92 readonly provider: "generic";
93 /**
94 * The base url. e.g. `https://bucket_name.s3.amazonaws.com`.
95 */
96 readonly url: string;
97 /**
98 * The channel.
99 * @default latest
100 */
101 readonly channel?: string | null;
102 /**
103 * Whether to use multiple range requests for differential update. Defaults to `true` if `url` doesn't contain `s3.amazonaws.com`.
104 */
105 readonly useMultipleRangeRequest?: boolean;
106}
107export interface BaseS3Options extends PublishConfiguration {
108 /**
109 * The update channel.
110 * @default latest
111 */
112 channel?: string | null;
113 /**
114 * The directory path.
115 * @default /
116 */
117 readonly path?: string | null;
118 /**
119 * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).
120 *
121 * @default public-read
122 */
123 readonly acl?: "private" | "public-read" | null;
124}
125export interface S3Options extends BaseS3Options {
126 /**
127 * The provider. Must be `s3`.
128 */
129 readonly provider: "s3";
130 /**
131 * The bucket name.
132 */
133 readonly bucket: string;
134 /**
135 * The region. Is determined and set automatically when publishing.
136 */
137 region?: string | null;
138 /**
139 * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).
140 *
141 * Please see [required permissions for the S3 provider](https://github.com/electron-userland/electron-builder/issues/1618#issuecomment-314679128).
142 *
143 * @default public-read
144 */
145 readonly acl?: "private" | "public-read" | null;
146 /**
147 * The type of storage to use for the object.
148 * @default STANDARD
149 */
150 readonly storageClass?: "STANDARD" | "REDUCED_REDUNDANCY" | "STANDARD_IA" | null;
151 /**
152 * Server-side encryption algorithm to use for the object.
153 */
154 readonly encryption?: "AES256" | "aws:kms" | null;
155 /**
156 * The endpoint URI to send requests to. The default endpoint is built from the configured region.
157 * The endpoint should be a string like `https://{service}.{region}.amazonaws.com`.
158 */
159 readonly endpoint?: string | null;
160}
161/**
162 * [DigitalOcean Spaces](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-spaces) options.
163 * Access key is required, define `DO_KEY_ID` and `DO_SECRET_KEY` environment variables.
164 */
165export interface SpacesOptions extends BaseS3Options {
166 /**
167 * The provider. Must be `spaces`.
168 */
169 readonly provider: "spaces";
170 /**
171 * The space name.
172 */
173 readonly name: string;
174 /**
175 * The region (e.g. `nyc3`).
176 */
177 readonly region: string;
178}
179export declare function getS3LikeProviderBaseUrl(configuration: PublishConfiguration): string;
180/**
181 * [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).
182 * Define `BT_TOKEN` environment variable.
183 */
184export interface BintrayOptions extends PublishConfiguration {
185 /**
186 * The provider. Must be `bintray`.
187 */
188 readonly provider: "bintray";
189 /**
190 * The Bintray package name.
191 */
192 readonly package?: string | null;
193 /**
194 * The Bintray repository name.
195 * @default generic
196 */
197 readonly repo?: string | null;
198 /**
199 * The owner.
200 */
201 readonly owner?: string | null;
202 /**
203 * The Bintray component (Debian only).
204 */
205 readonly component?: string | null;
206 /**
207 * The Bintray distribution (Debian only).
208 * @default stable
209 */
210 readonly distribution?: string | null;
211 /**
212 * The Bintray user account. Used in cases where the owner is an organization.
213 */
214 readonly user?: string | null;
215 readonly token?: string | null;
216}