From abb50f32b93b2756cac0d2c16f9bb285f465b483 Mon Sep 17 00:00:00 2001 From: Filipe Freire Date: Fri, 21 Oct 2022 16:22:01 +0100 Subject: [PATCH] add label for fromSource build on electron-builder --- .github/workflows/release-publish.yml | 2 +- fedora.Dockerfile | 2 +- packages/insomnia/electron-builder.config.js | 11 +++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index 09d761548659..2c4984eeb4ae 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -215,7 +215,7 @@ jobs: run: | docker build --tag fedora-insomnia-builder:latest -f fedora.Dockerfile . docker create --name builder fedora-insomnia-builder:latest - docker cp builder:/insomnia/packages/insomnia/dist ./artifacts/ + docker cp builder:/insomnia/packages/insomnia/dist/. ./artifacts/ docker rm -f builder - name: Upload artifacts to release diff --git a/fedora.Dockerfile b/fedora.Dockerfile index 0ac1164a732b..b178131eaacd 100644 --- a/fedora.Dockerfile +++ b/fedora.Dockerfile @@ -17,6 +17,6 @@ WORKDIR /insomnia RUN nvm install RUN npm run bootstrap -RUN NODE_OPTIONS="--max-old-space-size=6144" BUILD_TARGETS="rpm" BUILD_DEPS_FROM_SOURCE="true" npm run app-package +RUN NODE_OPTIONS="--max-old-space-size=6144" BUILD_TARGETS="rpm" BUILD_DEPS_FROM_SOURCE="true" BUILD_TARGET_LABEL="fedora" npm run app-package ENTRYPOINT [ "bash" ] diff --git a/packages/insomnia/electron-builder.config.js b/packages/insomnia/electron-builder.config.js index cc92e653425e..053c9398ee8d 100644 --- a/packages/insomnia/electron-builder.config.js +++ b/packages/insomnia/electron-builder.config.js @@ -123,12 +123,19 @@ const config = { }, }; -const { env: { BUILD_TARGETS, BUILD_DEPS_FROM_SOURCE }, platform } = process; +const { env: { BUILD_TARGETS, BUILD_DEPS_FROM_SOURCE, BUILD_TARGET_LABEL }, platform } = process; const targets = BUILD_TARGETS?.split(','); + +// TODO(Filipe): Improve this when we have a better solution for building Fedora if (BUILD_DEPS_FROM_SOURCE) { config.buildDependenciesFromSource = true; - config.linux.artifactName = `${BINARY_PREFIX}-\${version}-fromSource.\${ext}`; + let buildFromSourceLabel = 'fromSource'; + if (BUILD_TARGET_LABEL) { + buildFromSourceLabel = `${BUILD_TARGET_LABEL}`; + } + config.linux.artifactName = `${BINARY_PREFIX}-\${version}-${buildFromSourceLabel}.\${ext}`; } + if (platform && targets) { console.log('overriding build targets to: ', targets); const PLATFORM_MAP = { darwin: 'mac', linux: 'linux', win32: 'win' };