Selaa lähdekoodia

Remove Snap and AppImage support (#1500)

Lutz Roeder 2 kuukautta sitten
vanhempi
sitoutus
76535d16c6

+ 0 - 1
.github/workflows/build.yml

@@ -51,7 +51,6 @@ jobs:
             ubuntu*)
               sudo apt-get install rpm --yes
               npm run build electron linux
-              npx electron-builder --linux snap --x64 --publish never
               ;;
             windows*)
               npm run build electron windows

+ 0 - 3
.github/workflows/publish.yml

@@ -44,7 +44,6 @@ jobs:
           APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
           CSC_LINK: ${{ secrets.CSC_LINK }}
           CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
-          SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
           AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
           AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
           AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
@@ -59,8 +58,6 @@ jobs:
             ubuntu*)
               sudo apt-get install rpm --yes
               npm run publish electron linux
-              sudo snap install snapcraft --classic
-              npx electron-builder --linux snap --x64 --publish always
               ;;
             windows*)
               unset CSC_LINK;

+ 1 - 6
publish/electron-builder.json

@@ -77,8 +77,7 @@
         "executableName": "netron",
         "target": [ 
             { "target": "deb", "arch": ["x64"] },
-            { "target": "rpm", "arch": ["x64"] },
-            { "target": "AppImage", "arch": ["x64"] }
+            { "target": "rpm", "arch": ["x64"] }
         ]
     },
     "mac": {
@@ -111,9 +110,5 @@
     },
     "nsis": {
         "differentialPackage": false
-    },
-    "snap": {
-        "plugs": [ "default", "removable-media" ],
-        "publish": { "provider": "snapStore", "channels": "stable" }
     }
 }

+ 7 - 29
source/desktop.mjs

@@ -56,21 +56,15 @@ desktop.Host = class {
         metadata.push(os.arch());
         let packager = '';
         if (process.platform === 'linux') {
-            if (process.env.APPIMAGE) {
-                packager = 'appimage';
-            } else if (process.env.SNAP) {
-                packager = 'snap';
-            } else {
+            try {
+                child_process.execFileSync('dpkg', ['-S', process.execPath]);
+                packager = 'deb';
+            } catch {
                 try {
-                    child_process.execFileSync('dpkg', ['-S', process.execPath]);
-                    packager = 'deb';
+                    child_process.execFileSync("rpm", ["-qf", process.execPath]);
+                    packager = 'rpm';
                 } catch {
-                    try {
-                        child_process.execFileSync("rpm", ["-qf", process.execPath]);
-                        packager = 'rpm';
-                    } catch {
-                        // continue regardless of error
-                    }
+                    // continue regardless of error
                 }
             }
         }
@@ -100,22 +94,6 @@ desktop.Host = class {
 
     async view(view) {
         this._view = view;
-        if (process.env.SNAP) {
-            this.document.body.classList.remove('spinner');
-            for (;;) {
-                // eslint-disable-next-line no-await-in-loop
-                await this.message('Please migrate as Snap support has been discontinued.', null, 'Migrate');
-                this.openURL('https://github.com/lutzroeder/netron/issues/1500');
-            }
-        }
-        if (process.env.APPIMAGE) {
-            this.document.body.classList.remove('spinner');
-            for (;;) {
-                // eslint-disable-next-line no-await-in-loop
-                await this.message('Please migrate as AppImage support has been discontinued.', null, 'Migrate');
-                this.openURL('https://github.com/lutzroeder/netron/issues/1500');
-            }
-        }
         const age = async () => {
             const days = (new Date() - new Date(this._environment.date)) / (24 * 60 * 60 * 1000);
             if (days > 180) {