diff --git a/.github/ISSUE_TEMPLATE/workflows/release.yml b/.github/ISSUE_TEMPLATE/workflows/release.yml deleted file mode 100644 index 550e1514..00000000 --- a/.github/ISSUE_TEMPLATE/workflows/release.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Build/release - -# this will help you specify where to run -on: - push: - branches: - # this will run on the specified branch - - feature/desktop-app - -env: - REACT_APP_BLOCKNATIVE_KEY: ${{ secrets.REACT_APP_BLOCKNATIVE_KEY }} - REACT_APP_FORTMATIC_KEY: ${{ secrets.REACT_APP_FORTMATIC_KEY }} - REACT_APP_GOOGLE_ANALYTICS_ID_MAINNET: ${{ secrets.REACT_APP_GOOGLE_ANALYTICS_ID_MAINNET }} - REACT_APP_INFURA_TOKEN: ${{ secrets.REACT_APP_INFURA_TOKEN }} - REACT_APP_PORTIS_ID: ${{ secrets.REACT_APP_PORTIS_ID }} - -jobs: - release: - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [macos-latest, ubuntu-latest] - - steps: - - name: Check out Git repository - uses: actions/checkout@v1 - - - name: Install Node.js, NPM and Yarn - uses: actions/setup-node@v1 - with: - node-version: 10.16 - - - name: Build/release Electron app - env: - # macOS notarization API key - APPLEID: ${{ secrets.APPLE_ID }} - APPLEIDPASS: ${{ secrets.APPLE_ID_PASS }} - uses: samuelmeuli/action-electron-builder@v1 - with: - #Build scipt - build_script_name: build-desktop - - # GitHub token, automatically provided to the action - # (No need to define this secret in the repo settings) - - github_token: ${{ secrets.github_token }} - - # macOS code signing certificate - mac_certs: ${{ secrets.MAC_CERTS }} - mac_certs_password: ${{ secrets.MAC_CERTS_PASSWORD }} - - # 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') }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f6fd6576..9ff9aa1d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,6 @@ on: workflow_dispatch env: - REACT_APP_BLOCKNATIVE_KEY: ${{ secrets.REACT_APP_BLOCKNATIVE_KEY }} REACT_APP_FORTMATIC_KEY: ${{ secrets.REACT_APP_FORTMATIC_KEY }} REACT_APP_GOOGLE_ANALYTICS_ID_MAINNET: ${{ secrets.REACT_APP_GOOGLE_ANALYTICS_ID_MAINNET }} REACT_APP_INFURA_TOKEN: ${{ secrets.REACT_APP_INFURA_TOKEN }} @@ -21,24 +20,24 @@ jobs: fail-fast: false max-parallel: 15 matrix: - os: [macos-latest, windows-latest, ubuntu-latest] + os: [macos-latest, windows-latest, ubuntu-20.04] steps: - name: Check out Git repository uses: actions/checkout@v2 # Add cache for yarn directory - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" + # - name: Get yarn cache directory path + # id: yarn-cache-dir-path + # run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + # - uses: actions/cache@v2 + # id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + # with: + # path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + # key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + # restore-keys: | + # ${{ runner.os }}-yarn- - name: Patch node gyp on windows to support Visual Studio 2019 if: startsWith(matrix.os, 'windows') @@ -52,9 +51,9 @@ jobs: yarn global add node-gyp yarn config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js" - name: Install Node.js, NPM and Yarn - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: - node-version: 12 + node-version: 14 - run: yarn install --frozen-lockfile --network-concurrency 1 - name: Build/Release Desktop App env: diff --git a/docs/networks.md b/docs/networks.md index e1519441..a048fa86 100644 --- a/docs/networks.md +++ b/docs/networks.md @@ -161,7 +161,6 @@ export type GasPriceOracle = { - **REACT_APP_GOOGLE_ANALYTICS**: Used for enabling google analytics - **REACT_APP_PORTIS_ID**: Portis ID for enabling it on given network - **REACT_APP_FORTMATIC_KEY**: Formatic yey for given network -- **REACT_APP_BLOCKNATIVE_KEY**: Blocknative key for given network --- ## How to add a network @@ -190,7 +189,6 @@ export enum ETHEREUM_NETWORK { * REACT_APP_GOOGLE_ANALYTICS * REACT_APP_PORTIS_ID * REACT_APP_FORTMATIC_KEY -* REACT_APP_BLOCKNATIVE_KEY 3) Add the **NetworkSettings** in [`src/config/networks`](/src/config/networks) as `.ts`: diff --git a/package.json b/package.json index 5d9cc763..e4350cc8 100644 --- a/package.json +++ b/package.json @@ -94,21 +94,23 @@ } ] }, - "files": [ - "build/", + "files": [ + "build", + "patches", "public", "scripts", + "dev-app-update.yml", "package.json" ], "directories": { - "buildResources": "public/build" + "buildResources": "public/resources" }, "mac": { "category": "public.app-category.productivity", "hardenedRuntime": true, - "entitlements": "public/build/entitlements.mac.plist", + "entitlements": "public/resources/entitlements.mac.plist", "gatekeeperAssess": false, - "entitlementsInherit": "public/build/entitlements.mac.plist", + "entitlementsInherit": "public/resources/entitlements.mac.plist", "target": [ "dmg", "zip" @@ -136,7 +138,7 @@ "target": [ "nsis" ], - "icon": "public/build/icon.ico" + "icon": "public/resources/icon.ico" } }, "resolutions": { @@ -161,7 +163,7 @@ "@gnosis.pm/safe-contracts": "1.1.1-dev.2", "@gnosis.pm/safe-react-components": "https://github.com/gnosis/safe-react-components.git#bf3a84486b7353bd25447ddff39c406f6fafecc6", "@gnosis.pm/util-contracts": "2.0.6", - "@ledgerhq/hw-transport-node-hid-singleton": "5.36.0", + "@ledgerhq/hw-transport-node-hid-singleton": "5.38.0", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.11.0", "@material-ui/lab": "4.0.0-alpha.56", @@ -249,7 +251,7 @@ "cross-env": "^7.0.3", "dotenv": "^8.2.0", "dotenv-expand": "^5.1.0", - "electron": "^9.3.5", + "electron": "^9.4.0", "electron-builder": "22.9.1", "electron-notarize": "1.0.0", "eslint": "^7.11.0", diff --git a/public/electron.js b/public/electron.js index 18a5ba3d..ac071d25 100644 --- a/public/electron.js +++ b/public/electron.js @@ -90,9 +90,10 @@ function createWindow(port = DEFAULT_PORT) { webPreferences: { preload: path.join(__dirname, '../scripts/preload.js'), allowRunningInsecureContent: true, + enableRemoteModule: true, nativeWindowOpen: true, // need to be set in order to display modal }, - icon: electron.nativeImage.createFromPath(path.join(__dirname, '/public/build/safe.png')), + icon: electron.nativeImage.createFromPath(path.join(__dirname, '../build/resources/safe.png')), }) mainWindow.once('ready-to-show', () => { @@ -141,7 +142,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.3.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/9.4.1 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/public/build/all-certs.p12 b/public/resources/all-certs.p12 similarity index 100% rename from public/build/all-certs.p12 rename to public/resources/all-certs.p12 diff --git a/public/build/background.png b/public/resources/background.png similarity index 100% rename from public/build/background.png rename to public/resources/background.png diff --git a/public/build/entitlements.mac.plist b/public/resources/entitlements.mac.plist similarity index 100% rename from public/build/entitlements.mac.plist rename to public/resources/entitlements.mac.plist diff --git a/public/build/icon.icns b/public/resources/icon.icns similarity index 100% rename from public/build/icon.icns rename to public/resources/icon.icns diff --git a/public/build/icon.ico b/public/resources/icon.ico similarity index 100% rename from public/build/icon.ico rename to public/resources/icon.ico diff --git a/public/build/safe.png b/public/resources/safe.png similarity index 100% rename from public/build/safe.png rename to public/resources/safe.png diff --git a/src/utils/constants.ts b/src/utils/constants.ts index c03e7121..57e6b3dd 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -7,7 +7,6 @@ export const GOOGLE_ANALYTICS_ID = process.env.REACT_APP_GOOGLE_ANALYTICS || '' export const SENTRY_DSN = process.env.REACT_APP_SENTRY_DSN || '' export const PORTIS_ID = process.env.REACT_APP_PORTIS_ID ?? '852b763d-f28b-4463-80cb-846d7ec5806b' export const FORTMATIC_KEY = process.env.REACT_APP_FORTMATIC_KEY ?? 'pk_test_CAD437AA29BE0A40' -export const BLOCKNATIVE_KEY = process.env.REACT_APP_BLOCKNATIVE_KEY ?? '7fbb9cee-7e97-4436-8770-8b29a9a8814c' /* * Not being used export const SQUARELINK_ID = { diff --git a/yarn.lock b/yarn.lock index 86b9265f..3c77ac22 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1782,19 +1782,19 @@ dependencies: invariant "2" -"@ledgerhq/devices@^5.36.0": - version "5.36.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-5.36.0.tgz#f4493bea44390325fcc7a2a0d03bba69fc1604ec" - integrity sha512-EwQwLZcz66a2V07Bad0J+Q67LR2afj2NJChJNcA6/gqvzXrtNtJ37u1co9eLU7S5GGll5JGi7KdBqAD9ZTHaaQ== +"@ledgerhq/devices@^5.38.0": + version "5.38.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-5.38.0.tgz#0b805020c4f3ac40d35f1b1af6d64d04256b1e0f" + integrity sha512-1RZ+Dh+oVUDMeaPSCeQ56qzgiMHHy481dbkRCDUMRJEzkGqOLI3k34x7XdkVKy1NQdt8G8sYyobP/yixDry5ow== dependencies: - "@ledgerhq/errors" "^5.36.0" - "@ledgerhq/logs" "^5.36.0" + "@ledgerhq/errors" "^5.38.0" + "@ledgerhq/logs" "^5.38.0" rxjs "^6.6.3" -"@ledgerhq/errors@^5.34.0", "@ledgerhq/errors@^5.36.0": - version "5.36.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-5.36.0.tgz#9d178b54116ae81b1fbdfa80afcd33981453be4c" - integrity sha512-VS6aFzn3IDUmSLaX2kAPg5sQOc5m7IwvswAGvoMc3FCi9/a1dXWwtiYn5rWd1QjDJlTKSfCwmSpvUMp8FKoY2Q== +"@ledgerhq/errors@^5.34.0", "@ledgerhq/errors@^5.38.0": + version "5.38.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-5.38.0.tgz#1642b87de47cbabc7b75ca93005a690895920a72" + integrity sha512-d4gQzbOLNBoGIwDtEGFNSb0w0aYN10T5Y749e+vqiJoS3dWrB+5BCSQ/U/ALet0wi/UMIyFY/xmgd1gPaPB3Hw== "@ledgerhq/hw-app-eth@^5.21.0": version "5.37.0" @@ -1807,27 +1807,27 @@ bignumber.js "^9.0.1" rlp "^2.2.6" -"@ledgerhq/hw-transport-node-hid-noevents@^5.36.0": - version "5.36.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-5.36.0.tgz#a25bdf0d10f9eac73148040e5887f40ca46f6a93" - integrity sha512-8zwokin0KFJaTzhy7oLVcy4QCNUjMuc49wPLnr3zxLqhO1innMp2crUxjIFNLRGJm/TfDLnlpxTPud6WZoo5zg== +"@ledgerhq/hw-transport-node-hid-noevents@^5.38.0": + version "5.38.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-5.38.0.tgz#ffbfb0b997e585fc08b6b220997caaa59e094554" + integrity sha512-zuxN3gWfCuN+pbK3BKc8z3VCulKI7zee1N3xhCWua9TiwL3leBTBs25Bvm22fmiLJYhzszccbF673/bpnnIQAA== dependencies: - "@ledgerhq/devices" "^5.36.0" - "@ledgerhq/errors" "^5.36.0" - "@ledgerhq/hw-transport" "^5.36.0" - "@ledgerhq/logs" "^5.36.0" + "@ledgerhq/devices" "^5.38.0" + "@ledgerhq/errors" "^5.38.0" + "@ledgerhq/hw-transport" "^5.38.0" + "@ledgerhq/logs" "^5.38.0" node-hid "2.1.1" -"@ledgerhq/hw-transport-node-hid-singleton@5.36.0": - version "5.36.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid-singleton/-/hw-transport-node-hid-singleton-5.36.0.tgz#99cedb773e571642d7f151c3134c5924147bc0d8" - integrity sha512-eKkJGXW0m7PeJY7V/7FDfU4VFLIVSRjxi7PpfJKFYlUrRwx9QndlZT0LD0u3W9dLktgounHhsOuXvuG44uTHYA== +"@ledgerhq/hw-transport-node-hid-singleton@5.38.0": + version "5.38.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid-singleton/-/hw-transport-node-hid-singleton-5.38.0.tgz#ea133ac3a7015aaafd5d629388da4d4a2086c761" + integrity sha512-FPpr6R2Cs6YKCamprC9vzJa+P7RieyMLQC3cG6EjYg8tmvHPtIxpmWFclNi45jZ05Ve1YvNjutoHVTVn0cOnpg== dependencies: - "@ledgerhq/devices" "^5.36.0" - "@ledgerhq/errors" "^5.36.0" - "@ledgerhq/hw-transport" "^5.36.0" - "@ledgerhq/hw-transport-node-hid-noevents" "^5.36.0" - "@ledgerhq/logs" "^5.36.0" + "@ledgerhq/devices" "^5.38.0" + "@ledgerhq/errors" "^5.38.0" + "@ledgerhq/hw-transport" "^5.38.0" + "@ledgerhq/hw-transport-node-hid-noevents" "^5.38.0" + "@ledgerhq/logs" "^5.38.0" lodash "^4.17.20" node-hid "2.1.1" usb-detection "^4.10.0" @@ -1842,19 +1842,19 @@ "@ledgerhq/logs" "^5.30.0" u2f-api "0.2.7" -"@ledgerhq/hw-transport@^5.34.0", "@ledgerhq/hw-transport@^5.36.0": - version "5.36.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-5.36.0.tgz#b6e951c411182ece59c7b527f948240d1b0a8a51" - integrity sha512-rwLTBUsdGCC3Ka4G99sqGbbyVhkVxXd4eWWeOb8gnuKhrTydZGkkP3JdZSHgWSrVRYTAUmkE1AnUmchbfh361w== +"@ledgerhq/hw-transport@^5.34.0", "@ledgerhq/hw-transport@^5.38.0": + version "5.38.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-5.38.0.tgz#b02bea73d77e729d13c367a967df1666f9ef940d" + integrity sha512-CAxvHukCcp+RqaEsSltmBw4Lb1yW42fiF/LTYN7JvCkZyLIQhvkndLDVCgp4hpMdtLK4bkf7RJRElqbN0vRoAQ== dependencies: - "@ledgerhq/devices" "^5.36.0" - "@ledgerhq/errors" "^5.36.0" + "@ledgerhq/devices" "^5.38.0" + "@ledgerhq/errors" "^5.38.0" events "^3.2.0" -"@ledgerhq/logs@^5.30.0", "@ledgerhq/logs@^5.36.0": - version "5.36.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-5.36.0.tgz#78721347162fb834d90effa1123b363dc46e3a52" - integrity sha512-HnD/hByteUL1MsJu1lMinY9bNq8++5mWJ8qHCW9dLC9LbsvWIqwLwmZiGcW0D2tX9p0/C5ESuIpJ9B/d2dReuw== +"@ledgerhq/logs@^5.30.0", "@ledgerhq/logs@^5.38.0": + version "5.38.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-5.38.0.tgz#3c5dbd1f62c0bf5580477b218fb57c67b575643a" + integrity sha512-i87Yn89Cq2D9Y0KmrEzCm62XHzI2edeOTBENKH6vAyzESGzyF+SBoqtZNwrjJcKup3/9dNn/zHjpicY7ev94Vw== "@material-ui/core@^4.11.0": version "4.11.2" @@ -8156,10 +8156,10 @@ electron-updater@4.3.5: lodash.isequal "^4.5.0" semver "^7.3.2" -electron@^9.3.5: - version "9.3.5" - resolved "https://registry.yarnpkg.com/electron/-/electron-9.3.5.tgz#7967146b81e6d9b484773243fd4a4f671a50b884" - integrity sha512-EPmDsp7sO0UPtw7nLD1ufse/nBskP+ifXzBgUg9psCUlapkzuwYi6pmLAzKLW/bVjwgyUKwh1OKWILWfOeLGcQ== +electron@^9.4.0: + version "9.4.1" + resolved "https://registry.yarnpkg.com/electron/-/electron-9.4.1.tgz#62a2aae4cd93f1b56d794a47541505a71654177a" + integrity sha512-r4CxoVG9Ja7tBtkilWMnBsBGup8G8Z+v7icZmwysHa8/OSr0OrLjrcOF/30BAP7yPE5fz/XTxygnltzW4OTZdw== dependencies: "@electron/get" "^1.0.1" "@types/node" "^12.0.12"