Skip to content

Commit

Permalink
add label for fromSource build on electron-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
filfreire committed Nov 4, 2022
1 parent e2cebc5 commit e11da85
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,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
Expand Down
2 changes: 1 addition & 1 deletion fedora.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
11 changes: 9 additions & 2 deletions packages/insomnia/electron-builder.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,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' };
Expand Down

0 comments on commit e11da85

Please sign in to comment.