From 6e36a600eb7bcd210e5c97d7ba1745dc7448be8e Mon Sep 17 00:00:00 2001 From: NAmorim Date: Tue, 19 Oct 2021 14:53:06 +0100 Subject: [PATCH 1/5] Have the binary as separate config --- build/electron-builder.json | 53 +++++++++++++++++++++++++++++++++++++ package.json | 46 +------------------------------- 2 files changed, 54 insertions(+), 45 deletions(-) create mode 100644 build/electron-builder.json diff --git a/build/electron-builder.json b/build/electron-builder.json new file mode 100644 index 000000000..6b36b9fb4 --- /dev/null +++ b/build/electron-builder.json @@ -0,0 +1,53 @@ +{ + "main": "electron-wrapper.js", + "appId": "org.superalgos.platform", + "productName": "Superalgos", + "asar": false, + "generateUpdatesFilesForAllChannels": true, + "files": [ + "**/*", + "!.github", + "!.vscode", + "!.dockerignore${/*}", + "!Platform/My-Data-Storage/*", + "!Platform/My-Log-Files/*", + "!Platform/My-Workspaces/*", + "!Docker", + "!Launch-Scripts", + "!run.js", + "!setup.js", + "!uninstall.js" + ], + "win": { + "target": [ + { + "target": "nsis", + "arch": "x64" + } + ], + "artifactName": "${productName}-${os}-${version}.${ext}", + "icon": "./build/superalgos.ico" + }, + "publish": { + "provider": "github", + "vPrefixedTagName": false, + "releaseType": "prerelease" + }, + "nsis": { + "oneClick": false, + "perMachine": false, + "allowElevation": false, + "allowToChangeInstallationDirectory": true, + "createDesktopShortcut": true, + "createStartMenuShortcut": true, + "license": "./LICENSE", + "runAfterFinish": false, + "artifactName": "${productName}_Setup_${os}_${version}.${ext}" + }, + "mac": { + "artifactName": "${productName}-${os}-${version}.${ext}", + "category": "public.app-category.finance", + "target": "default", + "icon": "build/icon.icns" + } +} \ No newline at end of file diff --git a/package.json b/package.json index 5f8839f25..7f7c79781 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "superalgos", "version": "0.0.12-beta", "description": "Superalgos is a free, open-source crypto trading bot", - "main": "electron-wrapper.js", "license": "Apache License 2.0", "homepage": "https://www.superalgos.org/", "author": { @@ -11,7 +10,7 @@ "scripts": { "start": "node platform minMemo noBrowser", "setup": "node setup noShortcuts", - "release": "electron-builder -w", + "dist": "electron-builder", "postinstall": "electron-builder install-app-deps" }, "dependencies": { @@ -39,48 +38,5 @@ "devDependencies": { "electron": "^15.1.0", "electron-builder": "^22.11.7" - }, - "build": { - "appId": "org.superalgos.platform", - "productName": "Superalgos", - "asar": false, - "files": [ - "**/*", - "!.github", - "!.vscode", - "!.dockerignore${/*}", - "!Platform/My-Data-Storage/*", - "!Platform/My-Log-Files/*", - "!Platform/My-Workspaces/*", - "!Docker", - "!Launch-Scripts", - "!run.js", - "!setup.js", - "!uninstall.js" - ], - "win": { - "target": [ - { - "target": "nsis", - "arch": "x64" - } - ], - "icon": "./build/superalgos.ico" - }, - "nsis": { - "oneClick": false, - "perMachine": false, - "allowElevation": false, - "allowToChangeInstallationDirectory": true, - "createDesktopShortcut": true, - "createStartMenuShortcut": true, - "license": "./LICENSE", - "runAfterFinish": false - }, - "mac": { - "category": "public.app-category.finance", - "target": "default", - "icon": "build/icon.icns" - } } } From c34463e63a5699774b59252c541b005dbcd516d6 Mon Sep 17 00:00:00 2001 From: NAmorim Date: Tue, 19 Oct 2021 14:53:21 +0100 Subject: [PATCH 2/5] Update README for binaries --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 44f31a488..d68ea53ea 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,9 @@ You can use the windows installer (Setup file) which will install all the necess > **NOTE** > There's a known issue where the screen stays white. In this case, go to "View/Reload" and it should work. +> **NOTE** +> The application is not signed yet. The antivirus probably will flag the file as unsecure. You can force the installation and running or way for the signed app. + The manual installation option, tailored for users who are experienced and who want to contribute to the project (highly appreciated and rewarded with SA tokens). Follow the install wizards to install the latest NodeJS and Github Desktop applications. - [Node.js download page](https://nodejs.org/en/download/). Select "Current" then "Windows Installer", then follow the wizard to install after the download completes. @@ -93,6 +96,11 @@ The manual installation option, tailored for users who are experienced and who w ### Mac OS Install +You can use the MacOS installer (DMG file) which will install all the necessary dependencies and files for you to run the platform. Also the shortcuts are placed. This application will notify you and update as new releases come (to be released). + +> **NOTE** +> The application is not signed. To be able to run you have to permit it in System Preferences > Security & Privacy > General > Open Anyway. + [Homebrew](https://brew.sh/) can be used to install the requirements with minimal effort on Mac OS. After you clone the repository, change directory to the Superalgos base and install the requirements using the Brewfile. Python 3 is only required for running machine learning (TensorFlow). ```sh From fe1432facb2f768a450513c961d74e38516224f7 Mon Sep 17 00:00:00 2001 From: NAmorim Date: Tue, 19 Oct 2021 14:54:36 +0100 Subject: [PATCH 3/5] Update workflows --- .github/workflows/release_build.yml | 10 ++- .github/workflows/release_build_dev.yml | 87 +++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release_build_dev.yml diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index cbd424a2b..272485c9f 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -1,9 +1,14 @@ -name: Build/release +name: Build/release Binaries on: push: + branches: [master] tags: - '*' + release: + types: [published, created, edited] + + workflow_dispatch: jobs: release: @@ -28,7 +33,8 @@ jobs: # GitHub token, automatically provided to the action # (No need to define this secret in the repo settings) github_token: ${{ secrets.github_token }} + args: "-c build/electron-builder.json" # If the commit is tagged with a version (e.g. "v1.0.0"), # release the app after building - release: ${{ startsWith(github.ref, 'refs/tags/v') }} + release: ${{ startsWith(github.ref, 'refs/tags/') }} diff --git a/.github/workflows/release_build_dev.yml b/.github/workflows/release_build_dev.yml new file mode 100644 index 000000000..9916dacd2 --- /dev/null +++ b/.github/workflows/release_build_dev.yml @@ -0,0 +1,87 @@ +name: Nightly develop Binaries + +on: + schedule: + - cron: '20 3 * * *' + + workflow_dispatch: + +jobs: + create-release: + runs-on: ubuntu-latest + steps: + - name: Download a file + run: curl "https://raw.githubusercontent.com/${{ github.repository }}/develop/package.json" -o package.json + + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y%m%d')" + + - name: get-version + id: version + uses: nyaa8/package-version@v1 + with: + path: './package.json' # Optional + + - name: Create nightly release + id: create_release + uses: viperproject/create-nightly-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.PACKAGE_VERSION }}.${{ steps.date.outputs.date }} + release_name: Superalgos ${{ env.PACKAGE_VERSION }} Snapshot ${{ steps.date.outputs.date }} + keep_num: 5 + keep_tags: false + + build-release: + runs-on: ${{ matrix.os }} + needs: create-release + strategy: + matrix: + os: [windows-latest, macos-latest] + + steps: + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y%m%d')" + + - name: Check out Git repository + uses: actions/checkout@v2 + with: + ref: develop + + - name: Install Node.js, NPM and Yarn + uses: actions/setup-node@v1 + with: + node-version: 14 + + - name: get-version + id: version + uses: nyaa8/package-version@v1 + with: + path: './package.json' # Optional + + - name: Update package.json version + uses: jossef/action-set-json-field@v1 + with: + file: package.json + field: version + value: ${{ env.PACKAGE_VERSION }}.${{ steps.date.outputs.date }} + + - name: Build/release Electron app + #env: + # DATE: ${{ steps.date.outputs.date }} + uses: samuelmeuli/action-electron-builder@v1 + with: + # GitHub token, automatically provided to the action + # (No need to define this secret in the repo settings) + github_token: ${{ secrets.github_token }} + args: "-c build/electron-builder.json -p onTagOrDraft" + + # If the commit is tagged with a version (e.g. "v1.0.0"), + # release the app after building + # release: ${{ startsWith(github.ref, 'refs/tags/v') }} + release: true + + From 92b6d04051050f48eec151d195e6d7276147a5cc Mon Sep 17 00:00:00 2001 From: NAmorim Date: Tue, 19 Oct 2021 15:12:18 +0100 Subject: [PATCH 4/5] Further package.json cleanup --- .github/workflows/release_build_dev.yml | 14 +++++++------- build/electron-builder.json | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release_build_dev.yml b/.github/workflows/release_build_dev.yml index 9916dacd2..498e2a2c6 100644 --- a/.github/workflows/release_build_dev.yml +++ b/.github/workflows/release_build_dev.yml @@ -62,12 +62,12 @@ jobs: with: path: './package.json' # Optional - - name: Update package.json version - uses: jossef/action-set-json-field@v1 - with: - file: package.json - field: version - value: ${{ env.PACKAGE_VERSION }}.${{ steps.date.outputs.date }} + #- name: Update package.json version + # uses: jossef/action-set-json-field@v1 + # with: + # file: package.json + # field: version + # value: ${{ env.PACKAGE_VERSION }}.${{ steps.date.outputs.date }} - name: Build/release Electron app #env: @@ -77,7 +77,7 @@ jobs: # GitHub token, automatically provided to the action # (No need to define this secret in the repo settings) github_token: ${{ secrets.github_token }} - args: "-c build/electron-builder.json -p onTagOrDraft" + args: "-c.extraMetadata.main=electron-wrapper.js -c.extraMetadata.version=${{ env.PACKAGE_VERSION }}.${{ steps.date.outputs.date }} -c build/electron-builder.json -p onTagOrDraft" # If the commit is tagged with a version (e.g. "v1.0.0"), # release the app after building diff --git a/build/electron-builder.json b/build/electron-builder.json index 6b36b9fb4..0a0c49fe1 100644 --- a/build/electron-builder.json +++ b/build/electron-builder.json @@ -1,5 +1,4 @@ { - "main": "electron-wrapper.js", "appId": "org.superalgos.platform", "productName": "Superalgos", "asar": false, From c7cebb4f0e4e5665b930e14545be3e821bde71a7 Mon Sep 17 00:00:00 2001 From: NAmorim Date: Tue, 19 Oct 2021 15:21:57 +0100 Subject: [PATCH 5/5] Cleaned up workflows --- .github/workflows/release_build.yml | 2 +- .github/workflows/release_build_dev.yml | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index 272485c9f..e448ed7e5 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -33,7 +33,7 @@ jobs: # GitHub token, automatically provided to the action # (No need to define this secret in the repo settings) github_token: ${{ secrets.github_token }} - args: "-c build/electron-builder.json" + args: "-c.extraMetadata.main=electron-wrapper.js -c build/electron-builder.json" # If the commit is tagged with a version (e.g. "v1.0.0"), # release the app after building diff --git a/.github/workflows/release_build_dev.yml b/.github/workflows/release_build_dev.yml index 498e2a2c6..feb7d2a58 100644 --- a/.github/workflows/release_build_dev.yml +++ b/.github/workflows/release_build_dev.yml @@ -21,7 +21,7 @@ jobs: id: version uses: nyaa8/package-version@v1 with: - path: './package.json' # Optional + path: './package.json' - name: Create nightly release id: create_release @@ -60,14 +60,7 @@ jobs: id: version uses: nyaa8/package-version@v1 with: - path: './package.json' # Optional - - #- name: Update package.json version - # uses: jossef/action-set-json-field@v1 - # with: - # file: package.json - # field: version - # value: ${{ env.PACKAGE_VERSION }}.${{ steps.date.outputs.date }} + path: './package.json' - name: Build/release Electron app #env: