Explorar o código

Fix build with native dependencies. (#213)

Build still fails on macOS, likely because the native dependency does not support arm64. Republished the dependency with the optional native components removed to solve the problem.
Daniel Scalzi %!s(int64=3) %!d(string=hai) anos
pai
achega
c1d36d2b03
Modificáronse 3 ficheiros con 29 adicións e 72 borrados
  1. 13 7
      .github/workflows/build.yml
  2. 15 64
      package-lock.json
  3. 1 1
      package.json

+ 13 - 7
.github/workflows/build.yml

@@ -14,16 +14,22 @@ jobs:
       - name: Check out Git repository
         uses: actions/checkout@v1
 
-      - name: Install Node.js, NPM and Yarn
+      - name: Set up Node
         uses: actions/setup-node@v1
         with:
           node-version: 16
 
-      - name: Build/release Electron app
-        uses: samuelmeuli/action-electron-builder@v1
+      - name: Set up Python
+        uses: actions/setup-python@v2
         with:
-          github_token: ${{ secrets.github_token }}
+          python-version: 3.x
 
-          # 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') }}
+      - name: Install Dependencies
+        run: npm ci
+        shell: bash
+
+      - name: Build
+        env:
+          GH_TOKEN: ${{ secrets.github_token }}
+        run: npm run dist
+        shell: bash

+ 15 - 64
package-lock.json

@@ -12,7 +12,7 @@
         "@electron/remote": "^2.0.1",
         "adm-zip": "^0.5.9",
         "async": "^3.2.1",
-        "discord-rpc": "^3.2.0",
+        "discord-rpc-patch": "^4.0.1",
         "ejs": "^3.1.6",
         "ejs-electron": "^2.1.1",
         "electron-updater": "^4.3.9",
@@ -695,15 +695,6 @@
         "tweetnacl": "^0.14.3"
       }
     },
-    "node_modules/bindings": {
-      "version": "1.5.0",
-      "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
-      "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
-      "peer": true,
-      "dependencies": {
-        "file-uri-to-path": "1.0.0"
-      }
-    },
     "node_modules/bl": {
       "version": "4.1.0",
       "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
@@ -1369,16 +1360,13 @@
         "node": ">= 0.6.x"
       }
     },
-    "node_modules/discord-rpc": {
-      "version": "3.2.0",
-      "resolved": "https://registry.npmjs.org/discord-rpc/-/discord-rpc-3.2.0.tgz",
-      "integrity": "sha512-KJv0EVbGMlr04HoG6f5b3wD7X9kSHzQ2Ed2qfHSDvYJ1MkE8RbCQmMcQQrSvAxpfsqZgUjB/bsfi/mjyicCH+A==",
+    "node_modules/discord-rpc-patch": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/discord-rpc-patch/-/discord-rpc-patch-4.0.1.tgz",
+      "integrity": "sha512-rnHZzNzUcSNdPZCRf18Nza6Nir4i3ljO0HIoSRadD0uEQwKa8PgqCf/tLUr/HJyJQ3NuXNHACMsOC6/JRhojmQ==",
       "dependencies": {
         "node-fetch": "^2.6.1",
         "ws": "^7.3.1"
-      },
-      "peerDependencies": {
-        "register-scheme": "github:devsnek/node-register-scheme"
       }
     },
     "node_modules/dmg-builder": {
@@ -1973,12 +1961,6 @@
         "node": "^10.12.0 || >=12.0.0"
       }
     },
-    "node_modules/file-uri-to-path": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
-      "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
-      "peer": true
-    },
     "node_modules/filelist": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.2.tgz",
@@ -3158,7 +3140,9 @@
     "node_modules/node-addon-api": {
       "version": "1.7.2",
       "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz",
-      "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg=="
+      "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==",
+      "dev": true,
+      "optional": true
     },
     "node_modules/node-fetch": {
       "version": "2.6.5",
@@ -3512,17 +3496,6 @@
         "url": "https://github.com/sponsors/mysticatea"
       }
     },
-    "node_modules/register-scheme": {
-      "version": "0.0.2",
-      "resolved": "git+ssh://git@github.com/devsnek/node-register-scheme.git#e7cc9a63a1f512565da44cb57316d9fb10750e17",
-      "hasInstallScript": true,
-      "license": "MIT",
-      "peer": true,
-      "dependencies": {
-        "bindings": "^1.3.0",
-        "node-addon-api": "^1.3.0"
-      }
-    },
     "node_modules/registry-auth-token": {
       "version": "4.2.1",
       "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz",
@@ -5095,15 +5068,6 @@
         "tweetnacl": "^0.14.3"
       }
     },
-    "bindings": {
-      "version": "1.5.0",
-      "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
-      "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
-      "peer": true,
-      "requires": {
-        "file-uri-to-path": "1.0.0"
-      }
-    },
     "bl": {
       "version": "4.1.0",
       "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
@@ -5642,10 +5606,10 @@
         }
       }
     },
-    "discord-rpc": {
-      "version": "3.2.0",
-      "resolved": "https://registry.npmjs.org/discord-rpc/-/discord-rpc-3.2.0.tgz",
-      "integrity": "sha512-KJv0EVbGMlr04HoG6f5b3wD7X9kSHzQ2Ed2qfHSDvYJ1MkE8RbCQmMcQQrSvAxpfsqZgUjB/bsfi/mjyicCH+A==",
+    "discord-rpc-patch": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/discord-rpc-patch/-/discord-rpc-patch-4.0.1.tgz",
+      "integrity": "sha512-rnHZzNzUcSNdPZCRf18Nza6Nir4i3ljO0HIoSRadD0uEQwKa8PgqCf/tLUr/HJyJQ3NuXNHACMsOC6/JRhojmQ==",
       "requires": {
         "node-fetch": "^2.6.1",
         "ws": "^7.3.1"
@@ -6119,12 +6083,6 @@
         "flat-cache": "^3.0.4"
       }
     },
-    "file-uri-to-path": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
-      "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
-      "peer": true
-    },
     "filelist": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.2.tgz",
@@ -7017,7 +6975,9 @@
     "node-addon-api": {
       "version": "1.7.2",
       "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz",
-      "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg=="
+      "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==",
+      "dev": true,
+      "optional": true
     },
     "node-fetch": {
       "version": "2.6.5",
@@ -7286,15 +7246,6 @@
       "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==",
       "dev": true
     },
-    "register-scheme": {
-      "version": "git+ssh://git@github.com/devsnek/node-register-scheme.git#e7cc9a63a1f512565da44cb57316d9fb10750e17",
-      "from": "register-scheme@github:devsnek/node-register-scheme",
-      "peer": true,
-      "requires": {
-        "bindings": "^1.3.0",
-        "node-addon-api": "^1.3.0"
-      }
-    },
     "registry-auth-token": {
       "version": "4.2.1",
       "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz",

+ 1 - 1
package.json

@@ -26,7 +26,7 @@
     "@electron/remote": "^2.0.1",
     "adm-zip": "^0.5.9",
     "async": "^3.2.1",
-    "discord-rpc": "^3.2.0",
+    "discord-rpc-patch": "^4.0.1",
     "ejs": "^3.1.6",
     "ejs-electron": "^2.1.1",
     "electron-updater": "^4.3.9",