From 75a18e08125959765a2964f7760799c6b5cb4e1e Mon Sep 17 00:00:00 2001 From: says10 <142166942+says10@users.noreply.github.com> Date: Wed, 6 Mar 2024 13:30:28 +0530 Subject: [PATCH 1/5] Update zip.md --- config/makers/zip.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/config/makers/zip.md b/config/makers/zip.md index b260491..16b93d5 100644 --- a/config/makers/zip.md +++ b/config/makers/zip.md @@ -10,6 +10,16 @@ The Zip target builds basic `.zip` files containing your packaged application.Th ```javascript { - name: '@electron-forge/maker-zip' + name: '@electron-forge/maker-zip', + config: (arch) => ({ + macUpdateManifestBaseUrl: (config) => { + const parsed = new URL(config.macUpdateManifestBaseUrl); + if (!parsed.pathname.endsWith('/RELEASES.json')) { + parsed.pathname += '/RELEASES.json'; + } + return parsed.toString(); + } + }) } + ``` From 27306ca0494ea79f7b93c445142dd7e9c7bccbed Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Fri, 5 Jul 2024 01:28:08 -0400 Subject: [PATCH 2/5] Update zip.md --- config/makers/zip.md | 72 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 13 deletions(-) diff --git a/config/makers/zip.md b/config/makers/zip.md index 16b93d5..6c248e3 100644 --- a/config/makers/zip.md +++ b/config/makers/zip.md @@ -1,25 +1,71 @@ --- -description: Create a ZIP file for your Electron app using Electron Forge. +description: Create a ZIP archive for your Electron app using Electron Forge. --- -# Zip +# ZIP -The Zip target builds basic `.zip` files containing your packaged application.There are no platform specific dependencies for using this maker and it will run on any platform. +The ZIP target builds basic [.zip archives](https://en.wikipedia.org/wiki/ZIP_(file_format)) containing your packaged application. There are no platform-specific dependencies for using this maker and it will run on any platform. -### Usage +## Usage +To use `@electron-forge/maker-zip`, add it to the `makers` array in your Forge configuration. + +{% code title="forge.config.js" %} +```javascript +module.exports = { + makers: [ + { + name: '@electron-forge/maker-zip', + } + ] +}; +``` +{% endcode %} + +All configuration options are optional, and options are documented in the API docs for [MakerZIPConfig](https://js.electronforge.io/interfaces/_electron_forge_maker_zip.MakerZIPConfig.html). + +### Static file auto-updates (macOS) + +On macOS, the ZIP maker can be configured to generate update manifests to use with Electron's [autoUpdater](https://electronjs.org/docs/latest/api/auto-updater) module. + +{% code title="forge.config.js" %} ```javascript +module.exports = { + makers: [ + { + name: '@electron-forge/maker-zip', + config: (arch) => ({ + macUpdateManifestBaseUrl: `https://my-bucket.s3.amazonaws.com/my-app-updates/darwin/${arch}` + }) + } + ] +}; +``` +{% endcode %} + +`macUpdateManifestBaseUrl` should be a path to an object storage bucket where you are storing your release assets. This bucket needs to be organized in folders by platform, then architecture. + +The first time you run `make` with this parameter configured, an architecture-specific `RELEASES.json` manifest will be generated. For example, if you are building v1.2.1 of `my-app` for arm64 (Apple Silicon): + +{% code title="forge.config.js" %} +```json { - name: '@electron-forge/maker-zip', - config: (arch) => ({ - macUpdateManifestBaseUrl: (config) => { - const parsed = new URL(config.macUpdateManifestBaseUrl); - if (!parsed.pathname.endsWith('/RELEASES.json')) { - parsed.pathname += '/RELEASES.json'; + "currentRelease": "1.2.1", + "releases": [ + { + "version": "1.2.1", + "updateTo": { + "version": "1.2.1", + "pub_date": "2013-09-18T12:29:53+01:00", + "name": "my-app v1.2.1", + "url": "https://my-bucket.s3.amazonaws.com/my-app-updates/darwin/arm64/my-app-1.2.1-darwin-arm64.zip" } - return parsed.toString(); } - }) + ] } - ``` +{% endcode %} + +Once this asset is uploaded to the bucket, subsequent runs will read from the existing manifest at `https://my-bucket.s3.amazonaws.com/my-app-updates/darwin/arm64/RELEASES.json` and modify it to update the `currentRelease` property to the next version that is built. + +For end-to-end instructions on this process, including how to publish assets to S3 and set up the autoUpdater to read the `RELEASES.json` manifest, see the [Auto updating from S3](s3#auto-updating-from-s3) guide. From 2aa81f9dc963936b7d645dc2f0c979b133ca7886 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Fri, 5 Jul 2024 01:30:08 -0400 Subject: [PATCH 3/5] Update zip.md --- config/makers/zip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/makers/zip.md b/config/makers/zip.md index 6c248e3..4f95b6c 100644 --- a/config/makers/zip.md +++ b/config/makers/zip.md @@ -68,4 +68,4 @@ The first time you run `make` with this parameter configured, an architecture-sp Once this asset is uploaded to the bucket, subsequent runs will read from the existing manifest at `https://my-bucket.s3.amazonaws.com/my-app-updates/darwin/arm64/RELEASES.json` and modify it to update the `currentRelease` property to the next version that is built. -For end-to-end instructions on this process, including how to publish assets to S3 and set up the autoUpdater to read the `RELEASES.json` manifest, see the [Auto updating from S3](s3#auto-updating-from-s3) guide. +For end-to-end instructions on this process, including how to publish assets to S3 and set up the autoUpdater to read the `RELEASES.json` manifest, see the [Auto updating from S3](s3/) guide. From 8ac9361cdb62a76d41aead95c0ee85bef6663b00 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Fri, 5 Jul 2024 01:32:07 -0400 Subject: [PATCH 4/5] Update zip.md --- config/makers/zip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/makers/zip.md b/config/makers/zip.md index 4f95b6c..1ad090a 100644 --- a/config/makers/zip.md +++ b/config/makers/zip.md @@ -68,4 +68,4 @@ The first time you run `make` with this parameter configured, an architecture-sp Once this asset is uploaded to the bucket, subsequent runs will read from the existing manifest at `https://my-bucket.s3.amazonaws.com/my-app-updates/darwin/arm64/RELEASES.json` and modify it to update the `currentRelease` property to the next version that is built. -For end-to-end instructions on this process, including how to publish assets to S3 and set up the autoUpdater to read the `RELEASES.json` manifest, see the [Auto updating from S3](s3/) guide. +For end-to-end instructions on this process, including how to publish assets to S3 and set up the autoUpdater to read the `RELEASES.json` manifest, see the [Auto updating from S3](config/publishers/s3.md#auto-updating-from-s3 "mention") guide. From 1443ec6fc7787f599b46c7f4bfac7fee7ba71463 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Fri, 5 Jul 2024 01:34:06 -0400 Subject: [PATCH 5/5] Update zip.md --- config/makers/zip.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/makers/zip.md b/config/makers/zip.md index 1ad090a..2e28c55 100644 --- a/config/makers/zip.md +++ b/config/makers/zip.md @@ -15,7 +15,7 @@ To use `@electron-forge/maker-zip`, add it to the `makers` array in your Forge c module.exports = { makers: [ { - name: '@electron-forge/maker-zip', + name: '@electron-forge/maker-zip' } ] }; @@ -68,4 +68,4 @@ The first time you run `make` with this parameter configured, an architecture-sp Once this asset is uploaded to the bucket, subsequent runs will read from the existing manifest at `https://my-bucket.s3.amazonaws.com/my-app-updates/darwin/arm64/RELEASES.json` and modify it to update the `currentRelease` property to the next version that is built. -For end-to-end instructions on this process, including how to publish assets to S3 and set up the autoUpdater to read the `RELEASES.json` manifest, see the [Auto updating from S3](config/publishers/s3.md#auto-updating-from-s3 "mention") guide. +For end-to-end instructions on this process, including how to publish assets to S3 and set up the autoUpdater to read the `RELEASES.json` manifest, see the [Auto updating from S3](../publishers/s3.md#auto-updating-from-s3 "mention") guide.