Skip to content

Commit

Permalink
Merge pull request #57 from makeark/build-dists
Browse files Browse the repository at this point in the history
Distributables
  • Loading branch information
kaulsh authored Sep 18, 2022
2 parents 312e6f9 + b5d6616 commit 785e21a
Show file tree
Hide file tree
Showing 11 changed files with 173 additions and 51 deletions.
72 changes: 61 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
version: 2.1

jobs:
build_linux:

build:
docker:
- image: node:16
steps:
Expand All @@ -10,21 +11,70 @@ jobs:
name: "Install dependencies"
command: "npm ci"
- run:
name: "Build electron & react"
name: "Build processes"
command: "npm run build"
- run:
name: "Build AppImage"
command: "npm run dist:app_image"
name: "Move build assets"
command: "mkdir -p /tmp/release && mv node_modules build package.json /tmp/release"
- persist_to_workspace:
root: /tmp/release
paths:
- build
- node_modules
- package.json

publish_linux:
docker:
- image: node:16
working_directory: /tmp/release
steps:
- attach_workspace:
at: /tmp/release
- run:
name: "Install extra linux dependencies"
command: apt-get update && apt-get install rpm -y
- run:
name: "Build distributable"
command: "npm run dist:linux"

publish_macos:
macos:
xcode: 13.4.1
working_directory: /tmp/release
steps:
- attach_workspace:
at: /tmp/release
- run:
name: "Build deb"
command: "npm run dist:deb"
name: "Install dmg-license"
command: "npm i dmg-license"
- run:
name: "Move necessary build output"
command: "mkdir -p /tmp/release && mv ./release/*.AppImage ./release/*.deb /tmp/release"
- store_artifacts:
path: /tmp/release
name: "Build distributable"
command: "npm run dist:macos"
no_output_timeout: 30m

workflows:
main:
jobs:
- build_linux
- build:
filters:
tags:
only:
- /^\d+\.\d+\.\d+$/
- publish_linux:
requires:
- 'build'
filters:
branches:
ignore: /.*/
tags:
only:
- /^\d+\.\d+\.\d+$/
- publish_macos:
requires:
- 'build'
filters:
branches:
ignore: /.*/
tags:
only:
- /^\d+\.\d+\.\d+$/
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run format:prettier:diff
npm run format:diff
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# .prettierignore
.gitignore
.gitattributes
.circleci
*.md

build
release

package-lock.json
2 changes: 1 addition & 1 deletion electron/core/driver/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function createDriver(stores: Ark.DriverStores) {
}

const mem = args && args.id && memoryStore.has(args.id) ? memoryStore.get(args.id) : undefined;
const stored = args && args.id && diskStore.has(args.id) ? await diskStore.get(args.id) : undefined;
const stored = args && args.id && (await diskStore.has(args.id)) ? await diskStore.get(args.id) : undefined;

const icon = args && args.id ? await iconStore.get(args.id) : undefined;

Expand Down
54 changes: 23 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,27 @@
"private": true,
"homepage": "./",
"main": "./build/renderer/electron/main.js",
"repository": "github:makeark/ark",
"scripts": {
"start": "BROWSER=none ARK_ENTRY_URL=http://localhost:5173 concurrently \"vite\" \"sleep 2 && electron .\"",
"dev:electron": "tsc --build electron/tsconfig.json -w",
"dev:react": "vite dev",
"format:prettier": "prettier -w .",
"format:prettier:diff": "prettier --check --ignore-unknown $(git diff --staged --name-only --diff-filter=d origin/master) package.json",
"format": "prettier -w .",
"format:diff": "prettier --check --ignore-unknown $(git diff --staged --name-only --diff-filter=d origin/master) package.json",
"build:renderer": "vite build",
"build:main": "tsc --build electron/tsconfig.json",
"build": "rimraf build && npm run build:renderer && npm run build:main",
"pack": "electron-builder --dir",
"dist:app_image": "electron-builder --linux",
"dist:deb": "electron-builder --linux deb",
"dist:macos_dmg": "electron-builder --macos",
"dist:macos_deb": "echo 'Not supported for now'",
"dist:linux": "electron-builder --linux",
"dist:macos": "electron-builder --macos",
"dist:windows": "electron-builder --windows",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"prepare": "husky install"
},
"author": {
"email": "[email protected]",
"name": "Shashank Kaul"
},
"browser": "none",
"browserslist": {
"production": [
Expand All @@ -40,6 +42,7 @@
"build": {
"productName": "ark",
"appId": "dev.makeark.ark",
"artifactName": "${name}-${os}-${version}-${arch}.${ext}",
"extends": null,
"files": [
"./build/**/*",
Expand All @@ -48,11 +51,19 @@
"to": "build/mongoshell.d.ts"
}
],
"publish": [
{
"provider": "github",
"vPrefixedTagName": false,
"publishAutoUpdate": true
}
],
"npmArgs": [
"--ignore-scripts"
],
"directories": {
"output": "release/",
"output": "release",
"buildResources": "src/assets",
"app": "./"
},
"mac": {
Expand All @@ -62,20 +73,6 @@
"hardenedRuntime": true,
"gatekeeperAssess": false
},
"dmg": {
"contents": [
{
"x": 130,
"y": 220
},
{
"x": 410,
"y": 220,
"type": "link",
"path": "/Applications"
}
]
},
"win": {
"target": [
"nsis"
Expand All @@ -93,17 +90,12 @@
},
"linux": {
"target": [
"deb",
"rpm",
"AppImage"
],
"category": "Development"
},
"extraResources": [
"./node_modules/**/*"
],
"publish": {
"provider": "github",
"owner": "makeark",
"repo": "ark-foss"
"category": "Development",
"icon": "src/assets/icon.png"
}
},
"devDependencies": {
Expand Down
Binary file added src/assets/icon.icns
Binary file not shown.
Binary file added src/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 19 additions & 4 deletions src/assets/logo_fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/logo_outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions src/common/styles/bp4-override.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@
border-radius: @border-radius;
}

.bp4-popover2-arrow-fill {
fill: @background-color;
}

// annoying override: blueprint's datepicker sets inline height on the month select's caret icon
.bp4-html-select select {
width: unset;
right: unset;
}
div.bp4-html-select.bp4-minimal.bp4-datepicker-month-select > span {
right: 2px !important;
}
// annoying override end

.bp4-tag {
background-color: @container-fg-color;
color: @text-color;
Expand Down Expand Up @@ -62,4 +76,46 @@
.bp4-file-upload-input::after {
content: none;
}

.bp4-datepicker {
background-color: @container-bg-color;
border-radius: @border-radius;

.bp4-selected {
color: @highlight-color;
background-color: @container-fg-color;
}

.DayPicker-Day,
.DayPicker-Month {
color: @text-color;
background-color: @container-fg-color;
}
.DayPicker-Day:hover {
background-color: @container-fg-color-bright;
}
.DayPicker-Day--selected {
background-color: @primary-color;
}
}

.bp4-datepicker-caption {
select {
color: @text-color;
&:hover {
color: @text-color;
}
}
option {
color: @container-fg-color;
}
}

.bp4-timepicker-input {
color: @text-color;
}

.bp4-timepicker-input-row {
background-color: @container-fg-color;
}
}
3 changes: 1 addition & 2 deletions src/components/layout/Titlebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ export const TitleBar = (): JSX.Element => {
)}
<div className="header-container">
<div className="logo">
<Logo width={"2.5rem"} height={"2.5rem"} opacity="80%" />
{/* Ark */}
<Logo width={"1.7rem"} height={"1.7rem"} opacity="80%" />
</div>
<DropdownMenu
position="bottom-right"
Expand Down

0 comments on commit 785e21a

Please sign in to comment.