forge icon indicating copy to clipboard operation
forge copied to clipboard

Specify which version Publisher-s3 uses

Open zbouslikhin opened this issue 1 year ago • 1 comments

Pre-flight checklist

  • [X] I have read the contribution documentation for this project.
  • [X] I agree to follow the code of conduct that this project uses.
  • [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

6.4.2

Electron version

26.2.1

Operating system

Windows 10 Pro (19045.3448)

Last known working Electron Forge version

No response

Expected behavior

Specify in the configuration of publisher-s3 to use a different version than the one defined in package.json.

Actual behavior

Hey lads,

In my current setup, I'm specifying the version of my app through a variable, which is then passed to for example the config of squirrel

makers: [
    {
      name: '@electron-forge/maker-squirrel',
      config: {
          version: APPLICATION_VERSION, // <-- assume this to be 6.1.0
          name: 'zapp',
        },
    },
]

Now, if I try to publish it, this won't work and will return the following error Error: ENOENT: no such file or directory, open '/out/make/squirrel.windows/x64/zapp-0.0.0-full.nupkg'

I noticed this is because my package.json is set to 0.0.0 which seems to be used by publisher-s3.

Is there any way to configure publisher-s3 to use a specific version rather than the one defined in package.json?

Steps to reproduce

const forgeConfig: any = {
  makers: [
    {
      name: '@electron-forge/maker-squirrel',
      config: {
          version: APPLICATION_VERSION, // <-- assume this to be 6.1.0
          name: 'zapp',
        },
    },
  ],
  make_targets: {
    win32: ['squirrel'],
  },
  electronPackagerConfig: {
    packageManager: 'yarn',
  },
  electronWinstallerConfig: {
    name: 'zapp',
  },
  windowsStoreConfig: {
    packageName: 'Zapp',
    name: 'zapp',
  },
  publishers: [
    {
      name: '@electron-forge/publisher-s3',
      config: {
        bucket: '...',
        endpoint: '...',
        folder: '...' + channel,
        region: 'ams3',
        public: true,
      },
    },
  ],
  plugins: [
    new VitePlugin({
      build: [
        {
          entry: './src/electron/main/main.ts',
          config: './src/electron/main/vite.config.electron.ts',
        },
      ],
      renderer: [
        {
          name: 'splash_window',
          config: './src/electron/renderer/splash_window/vite.config.splash.ts',
        },
        {
          name: 'main_window',
          config: './src/electron/renderer/main_window/vite.config.renderer.ts',
        },
      ],
    }),
  ],
};

Additional information

I tried setting AppVersion in packagerConfig: {}, but it doesn't seem to work either

zbouslikhin avatar Oct 02 '23 23:10 zbouslikhin