From 352461658bab751f5076eb0d96c1f413f695c27f Mon Sep 17 00:00:00 2001 From: Daniel Sanchez Date: Wed, 17 Mar 2021 20:04:00 +0100 Subject: [PATCH] Release v3.1.3 - Desktop app (#2045) * Update release desktop app github action * Restore yarn install step for desktop build * Add linux deps for Ledger build in desktop workflow Update electron to latest v9 * Push back ubuntu version for desktop build * Set ubuntu 18 for linux desktop app * Update Desktop App signature * Set v3.1.3 * Fix AWS credentials configuration for Volta, xDai and EWC * Remove explicit aws credentials for all networks --- .github/workflows/deploy-ewc.yml | 16 +++-- .github/workflows/deploy-rinkeby.yml | 4 +- .github/workflows/deploy-volta.yml | 17 +++--- .github/workflows/deploy-xdai.yml | 16 +++-- .github/workflows/release-mainnet-desktop.yml | 29 +++++---- public/electron.js | 6 +- yarn.lock | 59 +++---------------- 7 files changed, 51 insertions(+), 96 deletions(-) diff --git a/.github/workflows/deploy-ewc.yml b/.github/workflows/deploy-ewc.yml index 2081c697..39aaf20d 100644 --- a/.github/workflows/deploy-ewc.yml +++ b/.github/workflows/deploy-ewc.yml @@ -76,12 +76,17 @@ jobs: REACT_APP_INTERCOM_ID: ${{ secrets.REACT_APP_INTERCOM_ID }} REACT_APP_IPFS_GATEWAY: ${{ secrets.REACT_APP_IPFS_GATEWAY }} + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_DEFAULT_REGION }} + # Script to deploy Pull Requests - run: bash ./scripts/github/deploy_pull_request.sh if: success() && github.event.number env: - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} PR_NUMBER: ${{ github.event.number }} REVIEW_BUCKET_NAME: ${{ secrets.AWS_REVIEW_BUCKET_NAME }} REACT_APP_NETWORK: ${{ env.REACT_APP_NETWORK }} @@ -98,13 +103,6 @@ jobs: env: REVIEW_FEATURE_URL: https://pr${{ github.event.number }}--${{ env.REPO_NAME_ALPHANUMERIC }}.review.gnosisdev.com - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_DEFAULT_REGION }} - # Script to deploy to development environment # EWC build is never created in development branch diff --git a/.github/workflows/deploy-rinkeby.yml b/.github/workflows/deploy-rinkeby.yml index 9dceb243..9bc51a03 100644 --- a/.github/workflows/deploy-rinkeby.yml +++ b/.github/workflows/deploy-rinkeby.yml @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Remove broken apt repos [Ubuntu] - if: matrix.os == 'ubuntu-latest' + if: ${{ matrix.os }} == 'ubuntu-latest' run: | for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done - uses: actions/checkout@v2 @@ -91,8 +91,6 @@ jobs: - run: bash ./scripts/github/deploy_pull_request.sh if: success() && github.event.number env: - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} PR_NUMBER: ${{ github.event.number }} REVIEW_BUCKET_NAME: ${{ secrets.AWS_REVIEW_BUCKET_NAME }} REACT_APP_NETWORK: ${{ env.REACT_APP_NETWORK }} diff --git a/.github/workflows/deploy-volta.yml b/.github/workflows/deploy-volta.yml index 6f562e39..23f517c3 100644 --- a/.github/workflows/deploy-volta.yml +++ b/.github/workflows/deploy-volta.yml @@ -79,12 +79,17 @@ jobs: REACT_APP_INTERCOM_ID: ${{ secrets.REACT_APP_INTERCOM_ID }} REACT_APP_IPFS_GATEWAY: ${{ secrets.REACT_APP_IPFS_GATEWAY }} + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_DEFAULT_REGION }} + # Script to deploy Pull Requests - run: bash ./scripts/github/deploy_pull_request.sh if: success() && github.event.number env: - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} PR_NUMBER: ${{ github.event.number }} REVIEW_BUCKET_NAME: ${{ secrets.AWS_REVIEW_BUCKET_NAME }} REACT_APP_NETWORK: ${{ env.REACT_APP_NETWORK }} @@ -101,14 +106,6 @@ jobs: env: REVIEW_FEATURE_URL: https://pr${{ github.event.number }}--${{ env.REPO_NAME_ALPHANUMERIC }}.review.gnosisdev.com - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_DEFAULT_REGION }} - - # Script to deploy to development environment # Volta build is never created in development branch diff --git a/.github/workflows/deploy-xdai.yml b/.github/workflows/deploy-xdai.yml index 1aff151d..bedc557c 100644 --- a/.github/workflows/deploy-xdai.yml +++ b/.github/workflows/deploy-xdai.yml @@ -79,12 +79,17 @@ jobs: REACT_APP_INTERCOM_ID: ${{ secrets.REACT_APP_INTERCOM_ID }} REACT_APP_IPFS_GATEWAY: ${{ secrets.REACT_APP_IPFS_GATEWAY }} + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_DEFAULT_REGION }} + # Script to deploy Pull Requests - run: bash ./scripts/github/deploy_pull_request.sh if: success() && github.event.number env: - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} PR_NUMBER: ${{ github.event.number }} REVIEW_BUCKET_NAME: ${{ secrets.AWS_REVIEW_BUCKET_NAME }} REACT_APP_NETWORK: ${{ env.REACT_APP_NETWORK }} @@ -101,13 +106,6 @@ jobs: env: REVIEW_FEATURE_URL: https://pr${{ github.event.number }}--${{ env.REPO_NAME_ALPHANUMERIC }}.review.gnosisdev.com - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_DEFAULT_REGION }} - # Script to deploy to development environment # xDai build is never created in development branch diff --git a/.github/workflows/release-mainnet-desktop.yml b/.github/workflows/release-mainnet-desktop.yml index ac95cf22..c8556827 100644 --- a/.github/workflows/release-mainnet-desktop.yml +++ b/.github/workflows/release-mainnet-desktop.yml @@ -19,17 +19,18 @@ jobs: fail-fast: false max-parallel: 15 matrix: - os: [macos-latest, windows-latest, ubuntu-20.04] + os: [macos-latest, windows-latest, ubuntu-18.04] steps: - name: Check out Git repository uses: actions/checkout@v2 - - uses: actions/cache@v2 - with: - path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + # Linux build patches + - name: Install linux dependencies + if: startsWith(matrix.os, 'ubuntu') + run: sudo apt-get update && sudo apt-get install libudev-dev libusb-1.0-0-dev + # Windows build patches - name: Patch node gyp on windows to support Visual Studio 2019 if: startsWith(matrix.os, 'windows') shell: powershell @@ -41,18 +42,20 @@ jobs: run: | yarn global add node-gyp yarn config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js" + + # Load node_modules cache action + - uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + - name: Install Node.js, NPM and Yarn uses: actions/setup-node@v2 with: node-version: 14 - - run: | - # Due to some dependencies yarn may randomly throw an error about invalid cache - # This approach is taken from https://github.com/yarnpkg/yarn/issues/7212#issuecomment-506155894 to fix the issue - # Another approach is to install with flag --network-concurrency 1, but this will make the installation pretty slow (default value is 8) - mkdir .yarncache - yarn install --cache-folder ./.yarncache --frozen-lockfile - rm -rf .yarncache - yarn cache clean + + - name: Run yarn install + run: yarn install --frozen-lockfile --network-concurrency 1 - name: Build/Release Desktop App env: diff --git a/public/electron.js b/public/electron.js index ac071d25..94a7bbf5 100644 --- a/public/electron.js +++ b/public/electron.js @@ -89,7 +89,9 @@ function createWindow(port = DEFAULT_PORT) { height: 768, webPreferences: { preload: path.join(__dirname, '../scripts/preload.js'), - allowRunningInsecureContent: true, + experimentalFeatures: true, + nodeIntegration: true, + // allowRunningInsecureContent: true, enableRemoteModule: true, nativeWindowOpen: true, // need to be set in order to display modal }, @@ -142,7 +144,7 @@ process.on('uncaughtException', function (error) { }) app.userAgentFallback = - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) old-airport-include/1.0.0 Chrome Electron/9.4.1 Safari/537.36' + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) old-airport-include/1.0.0 Chrome Electron/11.3.0 Safari/537.36' // We have one non-context-aware module in node_modules/usb. This is used by @ledgerhq/hw-transport-node-hid // This type of modules will be impossible to use after electron 10 diff --git a/yarn.lock b/yarn.lock index c22c0bf3..71abef68 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3503,7 +3503,12 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.54.tgz#a737488631aca3ec7bd9f6229d77f1079e444793" integrity sha512-c8Lm7+hXdSPmWH4B9z/P/xIXhFK3mCQin4yCYMd2p1qpMG5AfgyJuYZ+3q2dT7qLiMMMGMd5dnkFpdqJARlvtQ== -"@types/node@^12.0.12", "@types/node@^12.12.6", "@types/node@^12.6.1": +"@types/node@^12.0.12": + version "12.20.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.5.tgz#4ca82a766f05c359fd6c77505007e5a272f4bb9b" + integrity sha512-5Oy7tYZnu3a4pnJ//d4yVvOImExl4Vtwf0D40iKUlU+XlUsyV9iyFWyCFlwy489b72FMAik/EFwRkNLjjOdSPg== + +"@types/node@^12.12.6", "@types/node@^12.6.1": version "12.20.4" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.4.tgz#73687043dd00fcb6962c60fbf499553a24d6bdf2" integrity sha512-xRCgeE0Q4pT5UZ189TJ3SpYuX/QGl6QIAOAIeDSbAVAd2gX1NxSZup4jNVK7cxIeP8KDSbJgcckun495isP1jQ== @@ -3756,18 +3761,6 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@4.16.1": - version "4.16.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.16.1.tgz#da7a396dc7d0e01922acf102b76efff17320b328" - integrity sha512-0Hm3LSlMYFK17jO4iY3un1Ve9x1zLNn4EM50Lia+0EV99NdbK+cn0er7HC7IvBA23mBg3P+8dUkMXy4leL33UQ== - dependencies: - "@types/json-schema" "^7.0.3" - "@typescript-eslint/scope-manager" "4.16.1" - "@typescript-eslint/types" "4.16.1" - "@typescript-eslint/typescript-estree" "4.16.1" - eslint-scope "^5.0.0" - eslint-utils "^2.0.0" - "@typescript-eslint/experimental-utils@4.17.0", "@typescript-eslint/experimental-utils@^4.0.1": version "4.17.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.17.0.tgz#762c44aaa1a6a3c05b6d63a8648fb89b89f84c80" @@ -3801,14 +3794,6 @@ "@typescript-eslint/typescript-estree" "4.17.0" debug "^4.1.1" -"@typescript-eslint/scope-manager@4.16.1": - version "4.16.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.16.1.tgz#244e2006bc60cfe46987e9987f4ff49c9e3f00d5" - integrity sha512-6IlZv9JaurqV0jkEg923cV49aAn8V6+1H1DRfhRcvZUrptQ+UtSKHb5kwTayzOYTJJ/RsYZdcvhOEKiBLyc0Cw== - dependencies: - "@typescript-eslint/types" "4.16.1" - "@typescript-eslint/visitor-keys" "4.16.1" - "@typescript-eslint/scope-manager@4.17.0": version "4.17.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.17.0.tgz#f4edf94eff3b52a863180f7f89581bf963e3d37d" @@ -3822,11 +3807,6 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.10.1.tgz#1d7463fa7c32d8a23ab508a803ca2fe26e758727" integrity sha512-+3+FCUJIahE9q0lDi1WleYzjCwJs5hIsbugIgnbB+dSCYUxl8L6PwmsyOPFZde2hc1DlTo/xnkOgiTLSyAbHiQ== -"@typescript-eslint/types@4.16.1": - version "4.16.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.16.1.tgz#5ba2d3e38b1a67420d2487519e193163054d9c15" - integrity sha512-nnKqBwMgRlhzmJQF8tnFDZWfunXmJyuXj55xc8Kbfup4PbkzdoDXZvzN8//EiKR27J6vUSU8j4t37yUuYPiLqA== - "@typescript-eslint/types@4.17.0": version "4.17.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.17.0.tgz#f57d8fc7f31b348db946498a43050083d25f40ad" @@ -3846,19 +3826,6 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/typescript-estree@4.16.1": - version "4.16.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.16.1.tgz#c2fc46b05a48fbf8bbe8b66a63f0a9ba04b356f1" - integrity sha512-m8I/DKHa8YbeHt31T+UGd/l8Kwr0XCTCZL3H4HMvvLCT7HU9V7yYdinTOv1gf/zfqNeDcCgaFH2BMsS8x6NvJg== - dependencies: - "@typescript-eslint/types" "4.16.1" - "@typescript-eslint/visitor-keys" "4.16.1" - debug "^4.1.1" - globby "^11.0.1" - is-glob "^4.0.1" - semver "^7.3.2" - tsutils "^3.17.1" - "@typescript-eslint/typescript-estree@4.17.0": version "4.17.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.17.0.tgz#b835d152804f0972b80dbda92477f9070a72ded1" @@ -3879,14 +3846,6 @@ dependencies: eslint-visitor-keys "^1.1.0" -"@typescript-eslint/visitor-keys@4.16.1": - version "4.16.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.16.1.tgz#d7571fb580749fae621520deeb134370bbfc7293" - integrity sha512-s/aIP1XcMkEqCNcPQtl60ogUYjSM8FU2mq1O7y5cFf3Xcob1z1iXWNB6cC43Op+NGRTFgGolri6s8z/efA9i1w== - dependencies: - "@typescript-eslint/types" "4.16.1" - eslint-visitor-keys "^2.0.0" - "@typescript-eslint/visitor-keys@4.17.0": version "4.17.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.17.0.tgz#9c304cfd20287c14a31d573195a709111849b14d" @@ -8889,9 +8848,9 @@ entities@~2.1.0: integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== env-paths@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.0.tgz#cdca557dc009152917d6166e2febe1f039685e43" - integrity sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA== + version "2.2.1" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" + integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== errlop@^4.0.0: version "4.1.0"