electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.47k stars 1.71k forks source link

Auto-update is not working for bitbucket. #6777

Open rabbygit opened 2 years ago

rabbygit commented 2 years ago

Auto-update is not working for bitbucket. The official documentation supports bitbucket as a provider but electron-builder throws an error while running this command "electron-builder -- --publish always --win --mac --linux". Official Doc: https://www.electron.build/configuration/publish#publishers Error:

⨯ Invalid configuration object. electron-builder 23.0.3 has been initialized using a configuration object that does not match the API schema.
 - configuration.publish should be one of these:
   object { provider, channel?, host?, owner?, private?, protocol?, publishAutoUpdate?, publisherName?, releaseType?, repo?, requestHeaders?, token?, updaterCacheDirName?, vPrefixedTagName? } | object { bucket, provider, acl?, channel?, encryption?, endpoint?, path?, publishAutoUpdate?, publisherName?, region?, requestHeaders?, storageClass?, updaterCacheDirName? } | object { name, provider, region, acl?, channel?, path?, publishAutoUpdate?, publisherName?, requestHeaders?, updaterCacheDirName? } | object { provider, url, channel?, publishAutoUpdate?, publisherName?, requestHeaders?, updaterCacheDirName?, useMultipleRangeRequest? } | object { provider, publishAutoUpdate?, publisherName?, requestHeaders?, updateProvider?, updaterCacheDirName?, <key>: {} } | object { account, product, provider, channel?, platform?, publishAutoUpdate?, publisherName?, requestHeaders?, updaterCacheDirName? } | object { provider, channels?, publishAutoUpdate?, publisherName?, repo?, requestHeaders?, updaterCacheDirName? } | object { owner, provider, slug, channel?, publishAutoUpdate?, publisherName?, requestHeaders?, token?, updaterCacheDirName?, username? } | [object { provider, channel?, host?, owner?, private?, protocol?, publishAutoUpdate?, publisherName?, releaseType?, repo?, requestHeaders?, token?, updaterCacheDirName?, vPrefixedTagName? } | object { bucket, provider, acl?, channel?, encryption?, endpoint?, path?, publishAutoUpdate?, publisherName?, region?, requestHeaders?, storageClass?, updaterCacheDirName? } | object { name, provider, region, acl?, channel?, path?, publishAutoUpdate?, publisherName?, requestHeaders?, updaterCacheDirName? } | object { provider, url, channel?, publishAutoUpdate?, publisherName?, requestHeaders?, updaterCacheDirName?, useMultipleRangeRequest? } | object { provider, publishAutoUpdate?, publisherName?, requestHeaders?, updateProvider?, updaterCacheDirName?, <key>: {} } | object { account, product, provider, channel?, platform?, publishAutoUpdate?, publisherName?, requestHeaders?, updaterCacheDirName? } | object { provider, channels?, publishAutoUpdate?, publisherName?, repo?, requestHeaders?, updaterCacheDirName? } | object { owner, provider, slug, channel?, publishAutoUpdate?, publisherName?, requestHeaders?, token?, updaterCacheDirName?, username? } | string, ...] | null | string
   Details:
    * configuration.publish.provider should be "github".
      -> The provider. Must be `github`.
    * configuration.publish.provider should be "s3".
      -> The provider. Must be `s3`.
    * configuration.publish.provider should be "spaces".
      -> The provider. Must be `spaces`.
    * configuration.publish.provider should be "generic".
      -> The provider. Must be `generic`.
    * configuration.publish.provider should be "custom".
      -> The provider. Must be `custom`.
    * configuration.publish.provider should be "keygen".
      -> The provider. Must be `keygen`.
    * configuration.publish.provider should be "snapStore".
      -> The provider. Must be `snapStore`.

package.json:

"build": {
    "productName": "appName",
    "appId": "org.erb.appName",
    "asar": false,
    "asarUnpack": "**\\*.{node,dll}",
    "copyright": "Copyright © 2022 ${author}",
    "files": [
      "dist",
      "node_modules",
      "package.json"
    ],
    "afterSign": ".erb/scripts/notarize.js",
    "mac": {
      "target": {
        "target": "default",
        "arch": [
          "arm64",
          "x64"
        ]
      },
      "type": "distribution",
      "hardenedRuntime": true,
      "entitlements": "assets/entitlements.mac.plist",
      "entitlementsInherit": "assets/entitlements.mac.plist",
      "gatekeeperAssess": false
    },
    "dmg": {
      "contents": [
        {
          "x": 130,
          "y": 220
        },
        {
          "x": 410,
          "y": 220,
          "type": "link",
          "path": "/Applications"
        }
      ]
    },
    "win": {
      "target": [
        "nsis",
        "msi"
      ]
    },
    "linux": {
      "target": [
        "deb"
      ],
      "category": "Development"
    },
    "directories": {
      "app": "release/app",
      "buildResources": "assets",
      "output": "release/build"
    },
    "extraResources": [
      "./assets/**"
    ],
    "publish": {
      "provider": "bitbucket",
      "owner": "<owner>",
      "username": "<username>",
      "repo": "<repo-name>",
      "token": "my-token"
    }
  },
le4onardo commented 2 years ago

I was facing the same issue. We were both missing the required variable slug for bitbucket options instead of repo

...
   "publish": {
      "provider": "bitbucket",
      "owner": "<owner>",
      "username": "<username>",
      "token": "my-token",
      "slug": "Repository slug/name"        // Missing required variable added
    }
...

In the docs, required variables seem to be in bold.

sergeushenecz commented 1 year ago

@le4onardo Hi. On which version electron-builder you works? because i have errors not supported provider.

le4onardo commented 1 year ago

Hi @sergeu90. I am using version 23.4.0

sergeushenecz commented 1 year ago

@le4onardo and bitbucket works?

le4onardo commented 1 year ago

Yup 🙂. Are you facing the same error described here?

sergeushenecz commented 1 year ago

@le4onardo Did you use private repository ?https://github.com/electron-userland/electron-builder/issues/7395 it is my issue

sergeushenecz commented 1 year ago

@le4onardo i updated to version as you and i getting same error Not supported provider: bitbucket failedTask=build stackTrace=Error: Not supported provider: bitbucket when uploading file

image

in this file.

sergeushenecz commented 1 year ago

@le4onardo Which target did you use for the build

"target": [
        {
          "target": "nsis-web",
          "arch": [
            "x64",
            "ia32"
          ]
        }
      ]
le4onardo commented 1 year ago

You have a different error, lets continue in your issue 7395