From bb0e23b273694700c2dcc77a7d0592ebfcf2b146 Mon Sep 17 00:00:00 2001 From: sergeichestakov Date: Fri, 13 Oct 2023 10:36:44 -0400 Subject: [PATCH 01/11] Explicitly set different dmgPaths for each arch in DMG maker --- forge.config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/forge.config.js b/forge.config.js index 69fd98e..29ed084 100644 --- a/forge.config.js +++ b/forge.config.js @@ -45,6 +45,7 @@ module.exports = { // node_modules are necessary, but we have to strip binaries if (path.includes('node_modules')) { const ignoreNodeBinaries = '/node_modules/\\.bin($|/)'; + return path.match(ignoreNodeBinaries); } @@ -82,6 +83,7 @@ module.exports = { name: 'Replit', icon: './assets/logo.icns', overwrite: true, + dmgPath: process.arch === 'arm64' ? 'Replit.dmg' : 'Replit-Intel.dmg', additionalDMGOptions: { 'background-color': '#0E1525', }, From 00a34e2131a437d5fa3c1246767884331041bfbc Mon Sep 17 00:00:00 2001 From: sergeichestakov Date: Fri, 13 Oct 2023 10:39:21 -0400 Subject: [PATCH 02/11] Don't overwrite --- forge.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge.config.js b/forge.config.js index 29ed084..766228f 100644 --- a/forge.config.js +++ b/forge.config.js @@ -82,7 +82,7 @@ module.exports = { config: { name: 'Replit', icon: './assets/logo.icns', - overwrite: true, + overwrite: false, dmgPath: process.arch === 'arm64' ? 'Replit.dmg' : 'Replit-Intel.dmg', additionalDMGOptions: { 'background-color': '#0E1525', From 70e9bb52ad34fa56eb3a49954cf5901918716f79 Mon Sep 17 00:00:00 2001 From: sergeichestakov Date: Fri, 13 Oct 2023 11:29:45 -0400 Subject: [PATCH 03/11] debug --- forge.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/forge.config.js b/forge.config.js index 766228f..69a7b3a 100644 --- a/forge.config.js +++ b/forge.config.js @@ -66,6 +66,11 @@ module.exports = { const cpy = (await import('cpy')).default; await cpy('assets', 'dist'); }, + postMake: (config, makeResults) => { + console.log('POST MAKE'); + console.log(config); + console.log(makeResults); + }, }, makers: [ { From 499712d075c8a445ab9e3ac7edf9f414e09cd5ca Mon Sep 17 00:00:00 2001 From: sergeichestakov Date: Fri, 13 Oct 2023 11:50:27 -0400 Subject: [PATCH 04/11] More debug --- forge.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/forge.config.js b/forge.config.js index 69a7b3a..70d9c31 100644 --- a/forge.config.js +++ b/forge.config.js @@ -18,6 +18,11 @@ if (!osxNotarize) { ); } +const dmgPath = process.arch === 'arm64' ? 'Replit.dmg' : 'Replit-Intel.dmg'; +console.log(process); +console.log('ARCH: ', process.arch); +console.log('DMG PATH: ', dmgPath); + module.exports = { packagerConfig: { icon: './assets/logo', From 1f38b78e1d43eb9bea670bf26831daaf8883b531 Mon Sep 17 00:00:00 2001 From: sergeichestakov Date: Fri, 13 Oct 2023 12:49:14 -0400 Subject: [PATCH 05/11] Explicitly pass architecture --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db99f49..b80cb19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,6 +71,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18.x + architecture: ${{ matrix.arch }} cache: pnpm - name: Install run: pnpm install From 73a2cefb3364cba11df7ecaa74142997f51ea68c Mon Sep 17 00:00:00 2001 From: sergeichestakov Date: Fri, 13 Oct 2023 13:51:36 -0400 Subject: [PATCH 06/11] Try using new M1 runner --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b80cb19..c4bb009 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,7 +55,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macOS-latest, ubuntu-latest, windows-latest ] + os: [ macOS-13-xlarge, ubuntu-latest, windows-latest ] arch: [ x64, arm64 ] # Exclude platforms we don't support exclude: From cf9cc02eaecb903c509a54cec9edfd57d3467568 Mon Sep 17 00:00:00 2001 From: sergeichestakov Date: Fri, 13 Oct 2023 13:57:26 -0400 Subject: [PATCH 07/11] Exclude Linux for now --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c4bb009..5bc9b6d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,6 +61,9 @@ jobs: exclude: - os: windows-latest arch: arm64 + exclude: + - os: ubuntu-latest + arch: arm64 steps: - uses: actions/checkout@v3 From c4f499675937756fe7b53e8e61264298482fa86f Mon Sep 17 00:00:00 2001 From: sergeichestakov Date: Fri, 13 Oct 2023 13:58:47 -0400 Subject: [PATCH 08/11] whoops --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5bc9b6d..6e2a67c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,7 +61,6 @@ jobs: exclude: - os: windows-latest arch: arm64 - exclude: - os: ubuntu-latest arch: arm64 From a10ab013d11986b6ef8c910a85a03e592aebb52d Mon Sep 17 00:00:00 2001 From: sergeichestakov Date: Fri, 13 Oct 2023 19:49:54 -0400 Subject: [PATCH 09/11] Use M1 for arm64 builds, Intel for x86 --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e2a67c..ab0093b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,14 +55,17 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macOS-13-xlarge, ubuntu-latest, windows-latest ] + os: [ macOS-13-xlarge, macOS-latest, ubuntu-latest, windows-latest ] arch: [ x64, arm64 ] - # Exclude platforms we don't support + # On Windows we only support x86 builds exclude: - os: windows-latest arch: arm64 - - os: ubuntu-latest + # Only build arm64 build on M1 and x86 build on Intel Mac + - os: macOS-latest arch: arm64 + - os: macOS-13-xlarge + arch: x64 steps: - uses: actions/checkout@v3 @@ -73,7 +76,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18.x - architecture: ${{ matrix.arch }} cache: pnpm - name: Install run: pnpm install From 4f7e424906151dcff9960b7feb3458cd4441d1b3 Mon Sep 17 00:00:00 2001 From: sergeichestakov Date: Fri, 13 Oct 2023 20:00:39 -0400 Subject: [PATCH 10/11] rm logs --- forge.config.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/forge.config.js b/forge.config.js index 70d9c31..50bed35 100644 --- a/forge.config.js +++ b/forge.config.js @@ -13,16 +13,12 @@ const osxNotarize = const osxSign = osxNotarize ? {} : undefined; if (!osxNotarize) { + // eslint-disable-next-line no-console console.log( 'Notarytool credentials not passed, skipping sign and notarize step for OSX.', ); } -const dmgPath = process.arch === 'arm64' ? 'Replit.dmg' : 'Replit-Intel.dmg'; -console.log(process); -console.log('ARCH: ', process.arch); -console.log('DMG PATH: ', dmgPath); - module.exports = { packagerConfig: { icon: './assets/logo', @@ -71,11 +67,6 @@ module.exports = { const cpy = (await import('cpy')).default; await cpy('assets', 'dist'); }, - postMake: (config, makeResults) => { - console.log('POST MAKE'); - console.log(config); - console.log(makeResults); - }, }, makers: [ { @@ -93,6 +84,7 @@ module.exports = { name: 'Replit', icon: './assets/logo.icns', overwrite: false, + // Set a different path for each architecture to avoid conflicts when uploading dmgPath: process.arch === 'arm64' ? 'Replit.dmg' : 'Replit-Intel.dmg', additionalDMGOptions: { 'background-color': '#0E1525', From 82e43f3283fba7816d27bf551a17a3e059b56324 Mon Sep 17 00:00:00 2001 From: sergeichestakov Date: Sat, 14 Oct 2023 12:53:37 -0400 Subject: [PATCH 11/11] Update publish workflow too --- .github/workflows/build.yml | 6 ++++-- .github/workflows/publish.yml | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab0093b..29fb051 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,11 +57,13 @@ jobs: matrix: os: [ macOS-13-xlarge, macOS-latest, ubuntu-latest, windows-latest ] arch: [ x64, arm64 ] - # On Windows we only support x86 builds + # Publishing artifacts for multiple Windows architectures has + # a bug which can cause the wrong architecture to be downloaded + # for an update, so until that is fixed, only build Windows x64 exclude: - os: windows-latest arch: arm64 - # Only build arm64 build on M1 and x86 build on Intel Mac + # Only build arm64 builds on M1 and x86 builds on Intel Mac - os: macOS-latest arch: arm64 - os: macOS-13-xlarge diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9931aad..ead4920 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macOS-latest, ubuntu-latest, windows-latest ] + os: [ macOS-13-xlarge, macOS-latest, ubuntu-latest, windows-latest ] arch: [ x64, arm64 ] # Publishing artifacts for multiple Windows architectures has # a bug which can cause the wrong architecture to be downloaded @@ -18,6 +18,11 @@ jobs: exclude: - os: windows-latest arch: arm64 + # Only build arm64 builds on M1 and x86 builds on Intel Mac + - os: macOS-latest + arch: arm64 + - os: macOS-13-xlarge + arch: x64 steps: - uses: actions/checkout@v3