Skip to content

Commit

Permalink
feat: adding Bitbucket publisher and autoupdater
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Maietta committed Sep 8, 2021
1 parent 3d4c364 commit 4459d36
Show file tree
Hide file tree
Showing 23 changed files with 418 additions and 65 deletions.
4 changes: 2 additions & 2 deletions docs/api/electron-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -1709,7 +1709,7 @@ return path.join(target.outDir, <code>__${target.name}-${getArtifactArchName(arc
<tbody>
<tr>
<td>options</td>
<td><code><a href="/configuration/publish#publishconfiguration">PublishConfiguration</a></code> | <code>String</code> | <code><a href="/configuration/publish#githuboptions">GithubOptions</a></code> | <code><a href="/configuration/publish#s3options">S3Options</a></code> | <code><a href="/configuration/publish#spacesoptions">SpacesOptions</a></code> | <code><a href="/configuration/publish#genericserveroptions">GenericServerOptions</a></code> | <code><a href="/configuration/publish#bintrayoptions">BintrayOptions</a></code> | <code>module:builder-util-runtime/out/publishOptions.CustomPublishOptions</code> | <code>module:builder-util-runtime/out/publishOptions.KeygenOptions</code> | <code><a href="/configuration/publish#snapstoreoptions">SnapStoreOptions</a></code> | <code>String</code></td>
<td><code><a href="/configuration/publish#publishconfiguration">PublishConfiguration</a></code> | <code>String</code> | <code><a href="/configuration/publish#githuboptions">GithubOptions</a></code> | <code><a href="/configuration/publish#s3options">S3Options</a></code> | <code><a href="/configuration/publish#spacesoptions">SpacesOptions</a></code> | <code><a href="/configuration/publish#genericserveroptions">GenericServerOptions</a></code> | <code><a href="/configuration/publish#bintrayoptions">BintrayOptions</a></code> | <code>module:builder-util-runtime/out/publishOptions.CustomPublishOptions</code> | <code>module:builder-util-runtime/out/publishOptions.KeygenOptions</code> | <code><a href="/configuration/publish#snapstoreoptions">SnapStoreOptions</a></code> | <code>module:builder-util-runtime/out/publishOptions.BitbucketOptions</code> | <code>String</code></td>
<td>If you want to override configuration in the <code>app-update.yml</code>.</td>
</tr>
</tbody>
Expand Down Expand Up @@ -1834,7 +1834,7 @@ This is different from the normal quit event sequence.</p>
<tbody>
<tr>
<td>options</td>
<td><code><a href="/configuration/publish#publishconfiguration">PublishConfiguration</a></code> | <code>String</code> | <code><a href="/configuration/publish#githuboptions">GithubOptions</a></code> | <code><a href="/configuration/publish#s3options">S3Options</a></code> | <code><a href="/configuration/publish#spacesoptions">SpacesOptions</a></code> | <code><a href="/configuration/publish#genericserveroptions">GenericServerOptions</a></code> | <code><a href="/configuration/publish#bintrayoptions">BintrayOptions</a></code> | <code>module:builder-util-runtime/out/publishOptions.CustomPublishOptions</code> | <code>module:builder-util-runtime/out/publishOptions.KeygenOptions</code> | <code><a href="/configuration/publish#snapstoreoptions">SnapStoreOptions</a></code> | <code>String</code></td>
<td><code><a href="/configuration/publish#publishconfiguration">PublishConfiguration</a></code> | <code>String</code> | <code><a href="/configuration/publish#githuboptions">GithubOptions</a></code> | <code><a href="/configuration/publish#s3options">S3Options</a></code> | <code><a href="/configuration/publish#spacesoptions">SpacesOptions</a></code> | <code><a href="/configuration/publish#genericserveroptions">GenericServerOptions</a></code> | <code><a href="/configuration/publish#bintrayoptions">BintrayOptions</a></code> | <code>module:builder-util-runtime/out/publishOptions.CustomPublishOptions</code> | <code>module:builder-util-runtime/out/publishOptions.KeygenOptions</code> | <code><a href="/configuration/publish#snapstoreoptions">SnapStoreOptions</a></code> | <code>module:builder-util-runtime/out/publishOptions.BitbucketOptions</code> | <code>String</code></td>
<td>If you want to override configuration in the <code>app-update.yml</code>.</td>
</tr>
</tbody>
Expand Down
13 changes: 11 additions & 2 deletions docs/configuration/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ This example workflow is modelled on how releases are handled in maven (it is an
3. When you are ready to deploy, simply change you package version to `1.9.0` and push. This will then produce a `latest.yml` and `something.exe` on s3. Usually you'll git-tag this version as well (just to keep track of it).
4. Change the version back to a snapshot version right after, i.e. `1.10.0-snapshot`, and commit it.

## GitHub Repository and Bintray Package
## GitHub Repository

Detected automatically using:

Expand Down Expand Up @@ -228,7 +228,7 @@ Or in the [~/.aws/credentials](http://docs.aws.amazon.com/sdk-for-javascript/v2/

Example configuration:

```json tab="package.json"
```json
{
"build":
"publish": {
Expand All @@ -240,3 +240,12 @@ Example configuration:
```

{!generated/s3-options.md!}

{!generated/bitbucket-options.md!}
For converting an app password to a usable token, you can utilize this
```typescript
convertAppPassword(owner: string, token: string) {
const base64encodedData = Buffer.from(`${owner}:${token.trim()}`).toString("base64")
return `Basic ${base64encodedData}`
}
```
2 changes: 1 addition & 1 deletion docs/generated/DebOptions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ul>
<li><code id="DebOptions-depends">depends</code> Array&lt;String&gt; | “undefined” - Package dependencies. Defaults to <code>[&quot;gconf2&quot;, &quot;gconf-service&quot;, &quot;libnotify4&quot;, &quot;libappindicator1&quot;, &quot;libxtst6&quot;, &quot;libnss3&quot;]</code>. If need to support Debian, <code>libappindicator1</code> should be removed, <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895037">deprecated in Debian</a>. If need to support KDE, <code>gconf2</code> and <code>gconf-service</code> should be removed, <a href="https://packages.debian.org/bullseye/gconf2">for GNOME and no longer used by GNOME</a>.</li>
<li><code id="DebOptions-depends">depends</code> Array&lt;String&gt; | “undefined” - Package dependencies. Defaults to <code>[&quot;gconf2&quot;, &quot;gconf-service&quot;, &quot;libnotify4&quot;, &quot;libappindicator1&quot;, &quot;libxtst6&quot;, &quot;libnss3&quot;]</code>.</li>
<li><code id="DebOptions-packageCategory">packageCategory</code> String | “undefined” - The <a href="https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Section">package category</a>.</li>
<li><code id="DebOptions-priority">priority</code> String | “undefined” - The <a href="https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Priority">Priority</a> attribute.</li>
</ul>
16 changes: 16 additions & 0 deletions docs/generated/bitbucket-options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<ul>
<li><strong><code id="BitbucketOptions-provider">provider</code></strong> “bitbucket” - The provider. Must be <code>bitbucket</code>.</li>
<li><strong><code id="BitbucketOptions-owner">owner</code></strong> String - Repository owner</li>
<li><strong><code id="BitbucketOptions-slug">slug</code></strong> String - Repository slug/name</li>
<li><code id="BitbucketOptions-channel">channel</code> = <code>latest</code> String | “undefined” - The channel.</li>
</ul>
<p>Inherited from <code>PublishConfiguration</code>:</p>
<ul>
<li>
<p><code id="BitbucketOptions-publishAutoUpdate">publishAutoUpdate</code> = <code>true</code> Boolean - Whether to publish auto update info files.</p>
<p>Auto update relies only on the first provider in the list (you can specify several publishers). Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.</p>
</li>
<li>
<p><code id="BitbucketOptions-requestHeaders">requestHeaders</code> module:http.OutgoingHttpHeaders - Any custom request headers</p>
</li>
</ul>
5 changes: 0 additions & 5 deletions docs/generated/s3-options.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<!-- FILE IS AUTOGENERATED. Please edit S3Options class jsdoc in the packages/builder-util-runtime/src/publishOptions.ts -->

<!-- do not edit. start of generated block -->
<ul>
<li>
<p><strong><code id="S3Options-provider">provider</code></strong> “s3” - The provider. Must be <code>s3</code>.</p>
Expand Down Expand Up @@ -31,5 +28,3 @@
<p><code id="S3Options-path">path</code> = <code>/</code> String | “undefined” - The directory path.</p>
</li>
</ul>

<!-- end of generated block -->
17 changes: 0 additions & 17 deletions docs/generated/snap-store-options.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/generated/spaces-options.md

This file was deleted.

1 change: 1 addition & 0 deletions packages/app-builder-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"ejs": "^3.1.6",
"electron-osx-sign": "^0.5.0",
"electron-publish": "workspace:*",
"form-data": "^4.0.0",
"fs-extra": "^10.0.0",
"hosted-git-info": "^4.0.2",
"is-ci": "^3.0.0",
Expand Down
Loading

0 comments on commit 4459d36

Please sign in to comment.