electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.46k stars 513 forks source link

[5.x] Could not find a publish target with the name: s3 #1982

Closed OpNop closed 4 years ago

OpNop commented 4 years ago

Preflight Checklist

Issue Details

Expected Behavior

Application should build and be published to s3 using the configs on the 5.x readme

Actual Behavior

Electron forge was terminated:
Could not find a publish target with the name: s3

To Reproduce

Try publishing with s3 configs from the readme

Additional Information

package.json (sensitive parts removed)

{
  "name": "<app name>",
  "productName": "<app long name>",
  "version": "1.0.0-RC1",
  "description": "My Electron application description",
  "main": "src/index.js",
  "scripts": {
    "debug": "electron-forge start --inspect-electron",
    "start": "electron-forge start",
    "package": "electron-forge package",
    "make": "electron-forge make",
    "publish": "electron-forge publish",
    "lint": "eslint src --color"
  },
  "keywords": [],
  "author": "OpNop",
  "config": {
    "forge": "./forge.config.js"
  },
  "dependencies": {
    "angular": "^1.8.0",
    "angular-animate": "^1.8.0",
    "angular-content-editable": "^1.2.3",
    "angular-messages": "^1.8.0",
    "angular-resource": "^1.8.0",
    "angular-sanitize": "^1.8.0",
    "angular-ui-router": "^1.0.28",
    "bootstrap": "^4.5.2",
    "bootstrap.native": "^2.0.27",
    "custom-electron-titlebar": "^3.2.4",
    "electron-compile": "^6.4.4",
    "electron-dl": "^1.14.0",
    "electron-squirrel-startup": "^1.0.0",
    "font-awesome": "^4.7.0",
    "jquery": "^3.5.1",
    "mousetrap": "^1.6.5",
    "ngstorage": "^0.3.11",
    "popper.js": "^1.16.1",
    "video.js": "^7.8.4",
    "videojs-resumecard": "^2.1.1",
    "videojs-upnext": "^2.2.1"
  },
  "devDependencies": {
    "appdmg": "^0.6.0",
    "babel-plugin-transform-async-to-generator": "^6.24.1",
    "babel-preset-env": "^1.7.0",
    "babel-preset-react": "^6.24.1",
    "electron-forge": "^5.2.4",
    "electron-notarize": "^1.0.0",
    "electron-prebuilt-compile": "4.0.0",
    "eslint": "^3.19.0",
    "eslint-config-airbnb": "^15.1.0",
    "eslint-plugin-import": "^2.22.0",
    "eslint-plugin-jsx-a11y": "^5.1.1",
    "eslint-plugin-react": "^7.20.6",
    "fs-xattr": "^0.3.1"
  }
}

forge.config.js (sensitive parts removed)

const { notarize } = require('electron-notarize');
const path = require('path');

module.exports = {
    "make_targets": {
        "win32": [ "squirrel" ],
        "darwin": [ "zip", "dmg" ]
    },
    "publish_targets": {
        "win32": ["s3"],
        "darwin": ["s3"]
    },
    "s3": {
        "accessKeyId": "<MY AWS KEY>",
        "bucket": "<bucket-name>",
        "folder": "<folder-name>",
        "public": true
    },
    "electronPackagerConfig": {
        "packageManager": "npm",
        "asar": true,
        "icon": "resources/<app.ico>",
        "setupIcon": "resources/<app.ico>",
        "iconUrl": "resources/<app.ico>",
        "appCategoryType": "public.app-category.education",
        "appBundleId": "com.<company>.<app>",
        "osxSign": {
            "identity": "<name of cert>",
            "hardenedRuntime": "true",
            "gatekeeper-assess": false,
            "entitlements": "entitlements.plist",
            "entitlements-inherit": "entitlements.plist"
        },
        "osxNotarize": {
            "appleId": "<email-address>",
            "appleIdPassword": "<SECRET>"
        }
    },
    "electronWinstallerConfig": {
        "name": "<app-name>"
    },
    "electronInstallerDebian": {},
    "electronInstallerRedhat": {},
    "electronInstallerDMG": {
        "title": "Install <app-name>",
        "overwrite": true,
        "debug": true,
        "icon": "resources/<app.icns>",
        "background": "resources/<dmg.png>"
    },
    "hooks": {
        postPackage: async function (params) {
            console.log('postPackage hook triggered');

            if (process.platform !== 'darwin') {
                console.log('Skipping notarization - not building for Mac');
                return;
            }

            await notarize({
                appBundleId: params.electronPackagerConfig.appBundleId,
                appPath: path.join("out", "<app name>-darwin-x64", "<app name>.app"),
                appleId: "<email>",
                appleIdPassword: "<SECRET>"
            });
        }
    }
}

Electron forge was terminated: Could not find a publish target with the name: s3



I have confirmed that the path `C:\Users\OpNop\AppData\Roaming\npm\node_modules\electron-forge\dist\publishers\s3.js` does infact exist, so not sure why its saying it cant find it. 

Thanks for the help!

also confirmed that i have `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` in the environment 
malept commented 4 years ago

Unfortunately, the maintainers do not have the capacity to fix bugs in the 5.x series. Please upgrade to Electron Forge v6.

OpNop commented 4 years ago

A bit of a disappointment, if you are not supporting 5.x then you should officially release 6.x and remove the warning and update npm to 6.

malept commented 4 years ago

We're working on it, see #621.