From 87220bf80ef7e5dc4508a2cb999871e80fbf7a95 Mon Sep 17 00:00:00 2001 From: Leonard Laszlo Date: Wed, 8 Dec 2021 10:04:48 +0100 Subject: [PATCH] Improve documentation. --- README.md | 36 +++++++++++++++++------------------- automatic-build.sh | 7 +++++++ 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index e012abd..9fb03c4 100644 --- a/README.md +++ b/README.md @@ -6,37 +6,35 @@ The NW.js ARMv7 and ARMv8 (experimental) binaries are located under the [Release 64 bit and 32 bit binaries are packaged and released separately. The 64 bit package does not contain the SDK versions. -## Contributing - -The most needed contribution at the moment is a self-hosted Github runner or a docker host for the build execution. -A virtual machine or access to a cloud ubuntu x64 instance could be useful as well. - -The building process is resource intensive, the minimal requirements are: -- 10 GB of RAM, -- 4GB of swap, -- 110 GB of disk, -- and of course, as many CPU cores as possible. - -Another way to support this project is to join as a maintainer, and patch the building script once in a while. - ## Instructions for running your NW.js application on Linux ARMv7 After downloading the archive and unpacking it, the NW.js binary can be executed on Linux ARMv7 devices with: `./nw --use-gl=egl --ignore-gpu-blacklist --disable-accelerated-2d-canvas --num-raster-threads=2` -Thanks **@gripped**, **@jtg-gg** and **@llamasoft** for their endless patience and continuous help! +Thanks **@gripped**, **@jtg-gg** and **@llamasoft** for their endless patience and help! + +## Building the binaries + +Starting the build of nw57 branch: -## Docker +``` Bash +./automatic-build.sh --branch nw57 +``` + +If no branch is provided the script will use the latest version for the build. -Thanks to Docker containerisation, building NW.js for ARMv7 is now as easy as it gets. -However the building process is resource intensive, so brace yourselves. See: +Starting the build of nw57 branch in an existing docker container: ``` Bash -./automatic-build.sh +./automatic-build.sh --branch nw57 --docker-container 45c1550a0bb3 ``` -for a starting point. +Building the build environment docker image and upload it to docker hub: + +``` Bash +./automatic-build.sh --branch nw57 --docker-image-build-only --upload-image +``` ## Further reading diff --git a/automatic-build.sh b/automatic-build.sh index 97550f1..e46e770 100755 --- a/automatic-build.sh +++ b/automatic-build.sh @@ -105,6 +105,9 @@ if [ -z "$NWJS_BRANCH" ]; then | python -c 'import sys, json; print(json.load(sys.stdin)["default_branch"])' )" fi +# The Github token is needed for the release on Github. +# It can be provided manually or in a text file name .github-token, under the root of this repository. +# If not provided the script will skip uploading to Github. if [ -z "$GITHUB_TOKEN" ]; then GITHUB_TOKEN=$(cat .github-token) fi @@ -117,6 +120,9 @@ log "NW.js active branch: $NWJS_BRANCH" log "Docker repository: $DOCKER_REPOSITORY" log "Docker parameters: $DOCKER_PARAMS" +# This build script uses the latest build environment image from dockerhub. +# This function is used to build the build environment image for dockerhub +# or as a fallback when the image is not available. function buildImage { IMAGE_TAG="$DOCKER_REPOSITORY:$NWJS_BRANCH" log "Start building $IMAGE_TAG" @@ -127,6 +133,7 @@ function buildImage { function prepareImage { log "Check whether the image exists on the docker host" IMAGE_IDS=() + # Read the docker images to the IMAGE_IDS array. while IFS="" read -r line; do IMAGE_IDS+=("$line"); done < \ <(docker "$DOCKER_PARAMS" images --all --quiet "$DOCKER_REPOSITORY") if [ "${#IMAGE_IDS[@]}" -gt 0 ]; then