-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(circleci): improve build process (#1104)
* chore(circleci): improve build process * chore(circleci): update * circleci * fix * fix * fixx * fix version * fix * fix * fix command * fix lib * fix permissions * fix lib * fixtest * test * fix * fix orb * adjust * trigger * add windows * 32 support * sudo * su * i * su * commands * str * fix * f * ident * fix * add libdev * fix * remove * fixx * win * test * add when step * add mac * mac permissions * enable * fix tests * trigger * fix cachce * remove storing arts * arts * chore(circleci): seperate jobs * add conditional deploy * update cache values * add category * release test * chore(app): add auto changelog/tagging/bumping and update readme * fix * fix cache * cache test * store to workspace * fix path * fix path * add checksums job * test * fx * glob * glob2 * add checksum command * final test * fix syntax * fix syntax * fix job name * fix sha func * fix win * adjust shasum command * fix * fix * fix * test * cleanup * cleanup * adjust version * fix cache issue * adjust job * remove redundant command
- Loading branch information
Maurice Dalderup
authored
Aug 23, 2019
1 parent
a70c856
commit 9f5696e
Showing
7 changed files
with
653 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Javascript Node CircleCI 2.0 configuration file. | ||
# Check https://circleci.com/docs/2.0/language-javascript/ for more details | ||
version: 2 | ||
version: 2.1 | ||
|
||
orbs: | ||
codecov: codecov/[email protected] | ||
|
||
references: | ||
workspace: &workspace ~/repo | ||
|
@@ -22,99 +23,140 @@ references: | |
xcode: '10.3.0' | ||
working_directory: *workspace | ||
|
||
commands: | ||
pre: | ||
description: 'Setting up and building environment' | ||
parameters: | ||
sudo: | ||
type: string | ||
default: '' | ||
windows: | ||
type: boolean | ||
default: false | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ arch }}-{{ checksum "package.json" }} | ||
- v1-dependencies-{{ arch }} | ||
|
||
- run: << parameters.sudo >> apt-get -y update | ||
- run: << parameters.sudo >> apt-get -y install libusb-1.0-0 | ||
- when: | ||
condition: <<parameters.windows>> | ||
steps: | ||
- run: apt-get -y install libudev-dev libudev-dev:i386 libusb-1.0-0-dev libusb-1.0-0-dev:i386 | ||
- run: yarn | ||
|
||
jobs: | ||
build: | ||
build_linux: | ||
<<: *container_config | ||
steps: | ||
- pre: | ||
sudo: 'sudo' | ||
- run: yarn dist --linux | ||
- save_cache: | ||
key: v1-dependencies-{{ arch }}-{{ checksum "package.json" }} | ||
paths: | ||
- node_modules | ||
build_win: | ||
<<: *win_config | ||
steps: | ||
- pre: | ||
windows: true | ||
- run: yarn dist --win --x64 --ia32 | ||
- save_cache: | ||
key: v1-dependencies-{{ arch }}-{{ checksum "package.json" }} | ||
paths: | ||
- node_modules | ||
build_mac: | ||
<<: *mac_config | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
- v1-dependencies- | ||
- run: sudo apt-get -y update | ||
- run: sudo apt-get -y install libudev-dev libusb-1.0-0-dev | ||
- run: yarn install | ||
- run: chmod -R 777 ~/repo | ||
- v1-dependencies-{{ arch }}-{{ checksum "package.json" }} | ||
- v1-dependencies-{{ arch }} | ||
- run: yarn | ||
- run: yarn dist --mac | ||
- save_cache: | ||
key: v1-dependencies-{{ arch }}-{{ checksum "package.json" }} | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package.json" }} | ||
test: | ||
<<: *container_config | ||
steps: | ||
- checkout | ||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- v1-dependencies- | ||
- run: sudo apt-get -y update | ||
- run: sudo apt-get -y install libgtk-3-0 libxss1 libgconf-2-4 libnss3 libasound2 | ||
- run: yarn test | ||
- pre: | ||
sudo: 'sudo' | ||
- run: yarn codecov | ||
store_artifacts: | ||
- path: artifacts | ||
- destination: yarnpkg | ||
- codecov/upload: | ||
file: ./coverage/lcov.info | ||
|
||
deploy_win: | ||
<<: *win_config | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
- v1-dependencies- | ||
- run: dpkg --add-architecture i386 | ||
- run: apt-get -y update | ||
- run: apt-get -y install libudev-dev libudev-dev:i386 libusb-1.0-0-dev libusb-1.0-0-dev:i386 | ||
- run: yarn install | ||
- pre: | ||
windows: true | ||
- run: yarn release:win | ||
- store_artifacts: | ||
path: dist | ||
destination: build | ||
- persist_to_workspace: | ||
root: *workspace | ||
paths: | ||
- dist/*.* | ||
|
||
deploy_linux: | ||
<<: *container_config | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
- v1-dependencies- | ||
- run: sudo apt-get -y update | ||
- run: sudo apt-get -y install build-essential libudev-dev | ||
- run: yarn install | ||
- pre: | ||
sudo: 'sudo' | ||
- run: yarn release:linux | ||
- store_artifacts: | ||
path: dist | ||
destination: build | ||
- persist_to_workspace: | ||
root: *workspace | ||
paths: | ||
- dist/*.* | ||
|
||
deploy_mac: | ||
<<: *mac_config | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v3-dependencies-{{ checksum "package.json" }} | ||
- v3-dependencies- | ||
- run: yarn install | ||
- v1-dependencies-{{ arch }}-{{ checksum "package.json" }} | ||
- v1-dependencies-{{ arch }} | ||
- run: yarn | ||
- run: yarn release:mac | ||
- store_artifacts: | ||
path: dist | ||
destination: build | ||
- persist_to_workspace: | ||
root: *workspace | ||
paths: | ||
- ./dist/*.* | ||
|
||
calculate_checksums: | ||
<<: *container_config | ||
steps: | ||
- attach_workspace: | ||
at: *workspace | ||
- run: cd ./dist && shasum -a 256 *.* | ||
|
||
workflows: | ||
version: 2 | ||
build_test: | ||
build_win: | ||
jobs: | ||
- build | ||
- test: | ||
requires: | ||
- build | ||
|
||
- build_win | ||
build_linux: | ||
jobs: | ||
- build_linux | ||
build_mac: | ||
jobs: | ||
- build_mac | ||
unit_tests: | ||
jobs: | ||
- test | ||
deploy: | ||
jobs: | ||
- calculate_checksums: | ||
requires: | ||
- deploy_win | ||
- deploy_linux | ||
- deploy_mac | ||
- deploy_win: | ||
filters: | ||
branches: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"types": [ | ||
{"type": "feat", "section": "Features"}, | ||
{"type": "fix", "section": "Bug Fixes"}, | ||
{"type": "chore", "section": "Bug Fixes"}, | ||
{"type": "docs", "section": "Documentation"}, | ||
{"type": "style", "hidden": true}, | ||
{"type": "refactor", "hidden": true}, | ||
{"type": "perf", "hidden": true}, | ||
{"type": "test", "hidden": true}, | ||
{"type": "renovate", "hidden": true} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"appId": "io.nos.desktop", | ||
"forceCodeSigning": true, | ||
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}", | ||
"win": { | ||
"icon": "./static/icons/icon1024x1024.ico", | ||
"timeStampServer": "http://timestamp.globalsign.com/scripts/timstamp.dll" | ||
}, | ||
"linux": { | ||
"icon": "./static/icons/icon1024x1024.png" | ||
}, | ||
"mac": { | ||
"icon": "./static/icons/icon1024x1024.icns", | ||
"category": "public.app-category.utilities" | ||
}, | ||
"directories": { | ||
"buildResources": "static" | ||
}, | ||
"files": ["static/**/*"], | ||
"publish": { | ||
"provider": "github" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.