Skip to content

Commit

Permalink
fix: do not remove GitHub's releaseType attribute from the publish co…
Browse files Browse the repository at this point in the history
…nfiguration

Close #2971 Close #2994
  • Loading branch information
mseneshen authored and develar committed Jul 17, 2018
1 parent ca18b74 commit 7f529ff
Show file tree
Hide file tree
Showing 25 changed files with 763 additions and 539 deletions.
4 changes: 4 additions & 0 deletions docs/api/electron-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ Developer API only. See [Configuration](/configuration/configuration.md) for use


<!-- end of generated block -->




4 changes: 4 additions & 0 deletions docs/configuration/appx.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ The only solution for now — using [Parallels Desktop for Mac](http://www.paral
#### How do install AppX without trusted certificate?

If you use self-signed certificate, you need to add it to "Trusted People". See [Install the certificate](https://stackoverflow.com/a/24372483/1910191).




5 changes: 4 additions & 1 deletion docs/configuration/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,7 @@ Currently, only macOS and Linux supported.
## Build Version Management
`CFBundleVersion` (macOS) and `FileVersion` (Windows) will be set automatically to `version.build_number` on CI server (Travis, AppVeyor, CircleCI and Bamboo supported).

{!includes/hooks.md!}
{!includes/hooks.md!}



4 changes: 4 additions & 0 deletions docs/configuration/dmg.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ The contain file should have the following format:
"description": "Here is my own description"
}
```




5 changes: 4 additions & 1 deletion docs/configuration/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ All [LinuxTargetSpecificOptions](linux.md#linuxtargetspecificoptions-apk-freebsd

The top-level `apk`, `freebsd`, `pacman`, `p5p` and `rpm` keys contains set of options instructing electron-builder on how it should build corresponding Linux target.

{!generated/LinuxTargetSpecificOptions.md!}
{!generated/LinuxTargetSpecificOptions.md!}



4 changes: 4 additions & 0 deletions docs/configuration/mac.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ The top-level [mac](configuration.md#Configuration-mac) key contains set of opti
* <code id="MacConfiguration-electronLanguages">electronLanguages</code> Array&lt;String&gt; | String - The electron locales. By default Electron locales used as is.

<!-- end of generated block -->




5 changes: 4 additions & 1 deletion docs/configuration/mas.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ Inherits [macOS options](mac.md).
* <code id="MasConfiguration-entitlementsInherit">entitlementsInherit</code> String - The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set). Otherwise [default](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.mas.inherit.plist).
* <code id="MasConfiguration-binaries">binaries</code> Array&lt;String&gt; - Paths of any extra binaries that need to be signed.

<!-- end of generated block -->
<!-- end of generated block -->



17 changes: 16 additions & 1 deletion docs/configuration/nsis.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,19 @@ It is also important to set the Application User Model ID (AUMID) to the [appId]
!macroend
```


??? question "Is it possible to made single installer that will allow configuring user/machine installation?"

Yes, you need to switch to assisted installer (not default one-click).

```json tab="package.json"
"build": {
"nsis": {
"oneClick": false
}
}
```

```yaml tab="electron-builder.yml"
nsis:
oneClick: false
```
5 changes: 4 additions & 1 deletion docs/configuration/pkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ Inherited from `TargetSpecificOptions`:
* <code id="PkgOptions-artifactName">artifactName</code> String - The [artifact file name template](/configuration/configuration.md#artifact-file-name-template).
* <code id="PkgOptions-publish">publish</code> The [publish](/configuration/publish.md) options.

<!-- end of generated block -->
<!-- end of generated block -->



4 changes: 4 additions & 0 deletions docs/configuration/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,7 @@ Example configuration:
{!generated/s3-options.md!}

{!generated/spaces-options.md!}




4 changes: 4 additions & 0 deletions docs/configuration/snap.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ Inherited from `TargetSpecificOptions`:
* <code id="SnapOptions-publish">publish</code> The [publish](/configuration/publish.md) options.

<!-- end of generated block -->




5 changes: 4 additions & 1 deletion docs/configuration/squirrel-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ Inherited from `TargetSpecificOptions`:
* <code id="SquirrelWindowsOptions-artifactName">artifactName</code> String - The [artifact file name template](/configuration/configuration.md#artifact-file-name-template).
* <code id="SquirrelWindowsOptions-publish">publish</code> The [publish](/configuration/publish.md) options.

<!-- end of generated block -->
<!-- end of generated block -->



5 changes: 4 additions & 1 deletion docs/configuration/target.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ build -wl
* **<code id="TargetConfiguration-target">target</code>** String - The target name. e.g. `snap`.
* <code id="TargetConfiguration-arch">arch</code> Array&lt;"x64" | "ia32" | "armv7l" | "arm64"&gt; | "x64" | "ia32" | "armv7l" | "arm64" - The arch or list of archs.

<!-- end of generated block -->
<!-- end of generated block -->



5 changes: 4 additions & 1 deletion docs/configuration/win.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@ If you are not on macOS or don't want to buy [Parallels Desktop](https://www.par

The password to your VM is `Passw0rd!`.

VirtualBox is not supported by electron-builder for now, so, you need to setup build environment on Windows if you want to use VirtualBox to build AppX (and other Windows-only tasks).
VirtualBox is not supported by electron-builder for now, so, you need to setup build environment on Windows if you want to use VirtualBox to build AppX (and other Windows-only tasks).



14 changes: 11 additions & 3 deletions docs/generated/NsisOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

<!-- do not edit. start of generated block -->
* <code id="NsisOptions-oneClick">oneClick</code> = `true` Boolean - Whether to create one-click installer or assisted.
* <code id="NsisOptions-perMachine">perMachine</code> = `false` Boolean - If `oneClick` is `true` (default): Whether to install per all users (per-machine).
* <code id="NsisOptions-perMachine">perMachine</code> = `false` Boolean - Whether to show install mode installer page (choice per-machine or per-user) for assisted installer. Or whether installation always per all users (per-machine).

If `oneClick` is `false`: no install mode installer page (choice per-machine or per-user), always install per-machine.
If `oneClick` is `true` (default): Whether to install per all users (per-machine).

If `oneClick` is `false` and `perMachine` is `true`: no install mode installer page, always install per-machine.

If `oneClick` is `false` and `perMachine` is `false` (default): install mode installer page.

* <code id="NsisOptions-allowElevation">allowElevation</code> = `true` Boolean - *assisted installer only.* Allow requesting for elevation. If false, user will have to restart installer with elevated permissions.
* <code id="NsisOptions-allowToChangeInstallationDirectory">allowToChangeInstallationDirectory</code> = `false` Boolean - *assisted installer only.* Whether to allow user to change installation directory.
Expand Down Expand Up @@ -53,4 +57,8 @@
* <code id="NsisOptions-menuCategory">menuCategory</code> = `false` Boolean | String - Whether to create submenu for start menu shortcut and program files directory. If `true`, company name will be used. Or string value.
* <code id="NsisOptions-shortcutName">shortcutName</code> String - The name that will be used for all shortcuts. Defaults to the application name.

<!-- end of generated block -->
<!-- end of generated block -->




5 changes: 4 additions & 1 deletion docs/generated/s3-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@
* <code id="S3Options-channel">channel</code> = `latest` String - The update channel.
* <code id="S3Options-path">path</code> = `/` String - The directory path.

<!-- end of generated block -->
<!-- end of generated block -->



5 changes: 4 additions & 1 deletion docs/generated/spaces-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ Access key is required, define `DO_KEY_ID` and `DO_SECRET_KEY` environment varia
* <code id="SpacesOptions-acl">acl</code> = `public-read` "private" | "public-read" - The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).


<!-- end of generated block -->
<!-- end of generated block -->



6 changes: 6 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Settings]
ID = "e6f8cb2b-77d6-4681-bf16-7f120ea5c4e2"

[Build]
Publish = ""
Functions = ""
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"set-versions": "node test/out/helpers/setVersions.js",
"release": "yarn set-versions && BABEL_WORKAROUND=true BABEL_ENV=production yarn compile && sh ./__publish.sh && conventional-changelog -p angular -i CHANGELOG.md -s",
"schema": "typescript-json-schema packages/electron-builder-lib/tsconfig.json Configuration --out packages/electron-builder-lib/scheme.json --noExtraProps --useTypeOfKeyword --strictNullChecks --titles --required",
"jsdoc": "ts2jsdoc packages/builder-util-runtime packages/electron-updater packages/builder-util packages/electron-builder-lib packages/electron-builder packages/electron-publish",
"jsdoc": "ts2jsdoc packages/builder-util-runtime packages/builder-util packages/electron-builder-lib packages/electron-builder packages/electron-publish",
"jsdoc2md": "node scripts/jsdoc2md.js",
"docs": "tsc -p ./scripts/renderer/tsconfig.json && yarn jsdoc && yarn jsdoc2md",
"deploy-docs": "mkdocs build && ./scripts/publish.sh",
"deploy-docs": "mkdocs build --clean && ./scripts/publish.sh",
"////": "docs: pip3 install mkdocs-material mkdocs pymdown-extensions markdown-include --upgrade"
},
"//": "repository must be specified otherwise conventional-changelog will use forked repo (currently cloned)",
Expand All @@ -30,7 +30,7 @@
"dependencies": {
"7zip-bin": "~4.0.2",
"@types/is-ci": "^1.1.0",
"app-builder-bin": "1.11.2",
"app-builder-bin": "1.11.3",
"archiver": "^2.1.1",
"async-exit-hook": "^2.0.1",
"bluebird-lst": "^1.0.5",
Expand Down Expand Up @@ -68,15 +68,15 @@
"yargs": "^12.0.1"
},
"devDependencies": {
"@babel/core": "^7.0.0-beta.53",
"@babel/preset-env": "^7.0.0-beta.53",
"@babel/preset-react": "^7.0.0-beta.53",
"@babel/preset-stage-0": "^7.0.0-beta.53",
"@babel/core": "^7.0.0-beta.54",
"@babel/preset-env": "^7.0.0-beta.54",
"@babel/preset-react": "^7.0.0-beta.54",
"@babel/preset-stage-0": "^7.0.0-beta.54",
"@types/debug": "^0.0.30",
"@types/ejs": "^2.6.0",
"@types/electron-is-dev": "^0.3.0",
"@types/ini": "^1.3.29",
"@types/jest": "^23.1.6",
"@types/jest": "^23.3.0",
"@types/js-yaml": "^3.11.2",
"@types/lodash.isequal": "^4.5.2",
"@types/node-emoji": "^1.8.0",
Expand All @@ -101,7 +101,7 @@
"sumchecker": "^2.0.2",
"ts-babel": "^5.0.7",
"ts-jsdoc": "^3.0.1",
"tslint": "^5.10.0",
"tslint": "^5.11.0",
"typescript": "2.9.2",
"v8-compile-cache": "^2.0.0",
"whitespace": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/builder-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"out"
],
"dependencies": {
"app-builder-bin": "1.11.2",
"app-builder-bin": "1.11.3",
"temp-file": "^3.1.3",
"fs-extra-p": "^4.6.1",
"is-ci": "^1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"homepage": "https://github.com/electron-userland/electron-builder",
"dependencies": {
"7zip-bin": "~4.0.2",
"app-builder-bin": "1.11.2",
"app-builder-bin": "1.11.3",
"async-exit-hook": "^2.0.1",
"bluebird-lst": "^1.0.5",
"chromium-pickle-js": "^0.2.0",
Expand Down
12 changes: 4 additions & 8 deletions packages/electron-builder-lib/src/publish/updateInfoBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BluebirdPromise from "bluebird-lst"
import { Arch, hashFile, log, safeStringifyJson, serializeToYaml } from "builder-util"
import { GenericServerOptions, GithubOptions, PublishConfiguration, UpdateInfo, WindowsUpdateInfo } from "builder-util-runtime"
import { GenericServerOptions, PublishConfiguration, UpdateInfo, WindowsUpdateInfo } from "builder-util-runtime"
import { outputFile, outputJson, readFile } from "fs-extra-p"
import { Lazy } from "lazy-val"
import * as path from "path"
Expand Down Expand Up @@ -91,12 +91,7 @@ export async function createUpdateInfoTasks(event: ArtifactCreated, _publishConf
const sharedInfo = await createUpdateInfo(version, event, await getReleaseInfo(packager))
const tasks: Array<UpdateInfoFileTask> = []
const electronUpdaterCompatibility = (packager.platformSpecificBuildOptions as any).electronUpdaterCompatibility
for (let publishConfiguration of publishConfigs) {
if (publishConfiguration.provider === "github" && "releaseType" in publishConfiguration) {
publishConfiguration = {...publishConfiguration!!}
delete (publishConfiguration as GithubOptions).releaseType
}

for (const publishConfiguration of publishConfigs) {
const isBintray = publishConfiguration.provider === "bintray"
let dir = outDir
// Bintray uses different variant of channel file info, better to generate it to a separate dir by always
Expand Down Expand Up @@ -178,7 +173,8 @@ export async function writeUpdateInfoFiles(updateInfoFileTasks: Array<UpdateInfo

const updateChannelFileToInfo = new Map<string, UpdateInfoFileTask>()
for (const task of updateInfoFileTasks) {
const key = `${task.file}@${safeStringifyJson(task.publishConfiguration)}`
// https://github.com/electron-userland/electron-builder/pull/2994
const key = `${task.file}@${safeStringifyJson(task.publishConfiguration, new Set(["releaseType"]))}`
const existingTask = updateChannelFileToInfo.get(key)
if (existingTask == null) {
updateChannelFileToInfo.set(key, task)
Expand Down
10 changes: 7 additions & 3 deletions packages/electron-builder-lib/src/targets/nsis/nsisOptions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TargetSpecificOptions } from "../../core"
import { CommonWindowsInstallerConfiguration } from "../../options/CommonWindowsInstallerConfiguration"
import { CommonWindowsInstallerConfiguration } from "../.."

export interface CommonNsisOptions {
/**
Expand Down Expand Up @@ -33,10 +33,14 @@ export interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerCo
*/
readonly oneClick?: boolean

/***
/**
* Whether to show install mode installer page (choice per-machine or per-user) for assisted installer. Or whether installation always per all users (per-machine).
*
* If `oneClick` is `true` (default): Whether to install per all users (per-machine).
*
* If `oneClick` is `false`: no install mode installer page (choice per-machine or per-user), always install per-machine.
* If `oneClick` is `false` and `perMachine` is `true`: no install mode installer page, always install per-machine.
*
* If `oneClick` is `false` and `perMachine` is `false` (default): install mode installer page.
* @default false
*/
readonly perMachine?: boolean
Expand Down
18 changes: 9 additions & 9 deletions scripts/jsdoc2md.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ async function main() {
]
},

{
page: "auto-update.md", pageUrl: "auto-update", mainHeader: "API",
files: [
path.join(source, "updater/electron-updater.js"),
path.join(source, "builder-util-runtime/builder-util-runtime.js"),
]
},
// {
// page: "auto-update.md", pageUrl: "auto-update", mainHeader: "API",
// files: [
// path.join(source, "updater/electron-updater.js"),
// path.join(source, "builder-util-runtime/builder-util-runtime.js"),
// ]
// },
]

const jsdoc2MdOptions = {
Expand Down Expand Up @@ -382,7 +382,7 @@ async function render(pages, jsdoc2MdOptions) {
}

sortOptions(pages)
sortAutoUpdate(pages)
// sortAutoUpdate(pages)

for (const page of pages) {
const finalOptions = Object.assign({
Expand Down Expand Up @@ -426,7 +426,7 @@ async function writeDocFile(docOutFile, content) {
const start = existingContent.indexOf(startMarker)
const end = existingContent.indexOf(endMarker)
if (start != -1 && end != -1) {
return fs.outputFile(docOutFile, existingContent.substring(0, start + startMarker.length) + "\n" + content + "\n" + existingContent.substring(end))
return fs.outputFile(docOutFile, existingContent.substring(0, start + startMarker.length) + "\n" + content + "\n" + existingContent.substring(end) + "\n")
}
else {
return fs.outputFile(docOutFile, content)
Expand Down
Loading

0 comments on commit 7f529ff

Please sign in to comment.