Skip to content

Commit

Permalink
chore(docs): Updating/migrating docs branch and automating docs deplo…
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaietta authored Sep 2, 2021
1 parent 55c1164 commit 0573808
Show file tree
Hide file tree
Showing 67 changed files with 7,367 additions and 74 deletions.
5 changes: 5 additions & 0 deletions .changeset/thick-eyes-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

---

chore(docs): Updating/migrating docs branch and automating docs deployment
9 changes: 9 additions & 0 deletions .github/workflows/pr-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,12 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Deploy Documentation
uses: netlify/actions/build@master
if: steps.changesets.outputs.published == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_CMD: bash netlify-docs.sh
NETLIFY_DIR: site
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ out/

/packages/dmg-builder/vendor/
/packages/electron-builder/README.md
#/packages/app-builder-lib/scheme.json

/scripts/jsdoc/out/
/scripts/renderer/out/

electron-builder-*.d.ts

/site/
/docs/

tsconfig.tsbuildinfo

Expand Down
12 changes: 3 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,13 @@ our git [commit messages can be formatted](https://gist.github.com/develar/273e2

## Documentation

To avoid Google indexing, documentation files located in the branch `docs`. To clone:

```shell script
git clone --single-branch -b docs [email protected]:electron-userland/electron-builder.git docs
```

Documentation files located in the `/docs`.

`/docs` is deployed to Netlify when `next` release is marked as `latest` and available for all users.
`/docs` is deployed to Netlify on every release and available for all users.

`pip3 install mkdocs-material mkdocs markdown-include pymdown-extensions pygments --upgrade`
`bash netlify-docs.sh` to setup local env (Python 3) and build.

You'll want to copy the `mkdocs.yml` file from the master branch and then run `mkdocs build`.
Build command: `mkdocs build`.

## Debug Tests

Expand Down
16 changes: 16 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
mkdocs-material = "*"
mkdocs = "*"
markdown-include = "*"
pymdown-extensions = "*"
pygments = "*"

[dev-packages]

[requires]
python_version = "3"
286 changes: 286 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/publishing-artifacts /configuration/publish
/configuration/linux-other /configuration/linux
/configuration/deb /configuration/linux
/docker /multi-platform-build
/configuration/target /cli
1,988 changes: 1,988 additions & 0 deletions docs/api/electron-builder.md

Large diffs are not rendered by default.

130 changes: 130 additions & 0 deletions docs/api/programmaticUsage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
```
"use strict"
const builder = require("electron-builder")
const Platform = builder.Platform
// Let's get that intellisense working
/**
* @type {import('electron-builder').Configuration}
* @see https://www.electron.build/configuration/configuration
*/
const options = {
protocols: {
name: "Deeplink Example",
// Don't forget to set `MimeType: "x-scheme-handler/deeplink"` for `linux.desktop` entry!
schemes: [
"deeplink"
]
},
// "store” | “normal” | "maximum". - For testing builds, use 'store' to reduce build time significantly.
compression: "normal",
removePackageScripts: true,
afterSign: async (context) => {
// Mac releases require hardening+notarization: https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution
if (!isDebug && context.electronPlatformName === "darwin") {
await notarizeMac(context)
}
},
artifactBuildStarted: (context) => {
identifyLinuxPackage(context)
},
afterAllArtifactBuild: (buildResult) => {
return stampArtifacts(buildResult)
},
// force arch build if using electron-rebuild
beforeBuild: async (context) => {
const { appDir, electronVersion, arch } = context
await electronRebuild.rebuild({ buildPath: appDir, electronVersion, arch })
return false
},
nodeGypRebuild: false,
buildDependenciesFromSource: false,
directories: {
output: "dist/artifacts/local",
buildResources: "installer/resources"
},
files: [
"out"
],
extraFiles: [
{
from: "build/Release",
to: nodeAddonDir,
filter: "*.node"
}
],
win: {
target: 'nsis'
},
nsis: {
deleteAppDataOnUninstall: true,
include: "installer/win/nsis-installer.nsh"
},
mac: {
target: 'dmg',
hardenedRuntime: true,
gatekeeperAssess: true,
extendInfo: {
NSAppleEventsUsageDescription: 'Let me use Apple Events.',
NSCameraUsageDescription: 'Let me use the camera.',
NSScreenCaptureDescription: 'Let me take screenshots.',
}
},
dmg: {
background: "installer/mac/dmg-background.png",
iconSize: 100,
contents: [
{
x: 255,
y: 85,
type: "file"
},
{
x: 253,
y: 325,
type: "link",
path: "/Applications"
}
],
window: {
width: 500,
height: 500
}
},
linux: {
desktop: {
StartupNotify: "false",
Encoding: "UTF-8",
MimeType: "x-scheme-handler/deeplink"
},
target: ["AppImage", "rpm", "deb"]
},
deb: {
priority: "optional",
afterInstall:"installer/linux/after-install.tpl",
},
rpm: {
fpm: ["--before-install", "installer/linux/before-install.tpl"],
afterInstall:"installer/linux/after-install.tpl",
}
};
// Promise is returned
builder.build({
targets: Platform.MAC.createTarget(),
config: options
})
.then((result) => {
console.log(JSON.stringify(result))
})
.catch((error) => {
console.error(error)
})
```
Loading

0 comments on commit 0573808

Please sign in to comment.