Skip to content
This repository was archived by the owner on Jan 14, 2023. It is now read-only.

Commit 80d44be

Browse files
authored
chore: migrate build to circleci, migrate to yarn (#38)
* chore: migrate to circleci * chore: migrate to yarn * chore: fix linting * chore: update readme * fix: fixed building. unit tests is a mess but will be fixed along the way
1 parent 2804867 commit 80d44be

33 files changed

+10302
-18217
lines changed

.circleci/config.yml

Lines changed: 75 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
version: 2
1+
version: 2.1
22
jobs:
33
lint:
44
working_directory: ~/redshape
55
docker:
6-
- image: circleci/node:10.15.3
6+
- image: circleci/node:14
77
steps:
88
- checkout
99
- restore_cache:
1010
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
1111
- run: 'sudo apt install libxss-dev pkg-config'
1212
- run:
1313
name: Install Dependencies
14-
command: 'npm install'
14+
command: yarn install --pure-lockfile
1515
- save_cache:
1616
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
1717
paths:
1818
- ./node_modules
1919
- run:
2020
name: 'Linting'
21-
command: 'npm run lint'
21+
command: yarn lint
2222

2323
test:
2424
working_directory: ~/redshape
2525
docker:
26-
- image: circleci/node:10.15.3
26+
- image: circleci/node:14
2727
steps:
2828
- checkout
2929
- restore_cache:
@@ -32,18 +32,85 @@ jobs:
3232
- run: 'sudo apt install libxss-dev libxext-dev libxtst6 libnss3 libgtk-3-0 libgtkextra-dev libasound2'
3333
- run:
3434
name: Install Dependencies
35-
command: 'npm install'
35+
command: yarn install --pure-lockfile
3636
- save_cache:
3737
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
3838
paths:
3939
- ./node_modules
4040
- run:
4141
name: Coverage
42-
command: 'npm test'
42+
command: 'yarn test'
43+
44+
build-windows:
45+
working_directory: ~/redshape
46+
docker:
47+
- image: electronuserland/builder:wine
48+
steps:
49+
- checkout
50+
- restore_cache:
51+
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
52+
- run:
53+
name: Install Dependencies
54+
command: yarn install --pure-lockfile
55+
- save_cache:
56+
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
57+
paths:
58+
- ./node_modules
59+
- run:
60+
name: Build
61+
command: |
62+
if [ "$CIRCLE_BRANCH" == "master" ]; then
63+
yarn release -- -w --ia32 --x64
64+
elif [ "$CIRCLE_BRANCH" == "develop" ]; then
65+
yarn release:ci -- -w --ia32 --x64
66+
else
67+
yarn build -- -w --ia32 --x64
68+
fi
69+
- store_artifacts:
70+
path: ~/redshape/build
71+
72+
build-linux:
73+
working_directory: ~/redshape
74+
docker:
75+
- image: electronuserland/builder
76+
steps:
77+
- checkout
78+
- restore_cache:
79+
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
80+
- run:
81+
name: Install Dependencies
82+
command: 'yarn install --pure-lockfile'
83+
- save_cache:
84+
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
85+
paths:
86+
- ./node_modules
87+
- run:
88+
name: Build
89+
command: |
90+
if [ "$CIRCLE_BRANCH" == "master" ]; then
91+
yarn release -- -l --ia32 --x64
92+
elif [ "$CIRCLE_BRANCH" == "develop" ]; then
93+
yarn release:ci -- -l --ia32 --x64
94+
else
95+
yarn build -- -l --ia32 --x64
96+
fi
97+
- store_artifacts:
98+
path: ~/redshape/build
4399

44100
workflows:
45-
version: 2
46101
test:
47102
jobs:
48103
- lint
49104
- test
105+
build:
106+
jobs:
107+
- build-windows:
108+
filters:
109+
branches:
110+
ignore:
111+
- /^v\\d+\\.\\d+\\.\\d+$/
112+
- build-linux:
113+
filters:
114+
branches:
115+
ignore:
116+
- /^v\\d+\\.\\d+\\.\\d+$/

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ dist/
44
build/
55
.env
66
.idea
7+
.DS_Store
8+
yarn-error.log
9+
*.tgz

.travis.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Unfortuantely, you will have to configure it then yourself
4545
docker-compose -f docker-compose.yml up
4646
```
4747

48-
Then after you run the project with `npm run dev`, use `http://localhost` as redmine endpoint on the login form and provide the credentials or the API token
48+
Then after you run the project with `yarn dev`, use `http://localhost` as redmine endpoint on the login form and provide the credentials or the API token
4949

5050
## FAQ
5151

babel.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ module.exports = {
2222
env: {
2323
test: {
2424
plugins: [
25-
'@babel/plugin-transform-modules-commonjs'
25+
'@babel/plugin-transform-modules-commonjs',
26+
'source-map-support'
2627
]
2728
}
2829
}

common/storage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const Store = require('electron-store');
22
const isDev = require('electron-is-dev');
3-
const { ENCRYPTION_KEY } = require('./env.js');
3+
const { ENCRYPTION_KEY } = require('./env');
44

55
const storage = new Store({
66
name: isDev ? 'config-dev' : 'config',

jest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ module.exports = {
99
'\\.(css|less)$': '<rootDir>/__mocks__/style-mock.js',
1010
'\\.(png)$': '<rootDir>/__mocks__/image-mock.js',
1111
ipc$: '<rootDir>/__mocks__/ipc.js'
12-
}
12+
},
13+
testEnvironment: 'jsdom'
1314
};

main/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ app.setAppUserModelId('app.spring3.redshape');
2121
autoUpdater.logger = logger;
2222
autoUpdater.logger.transports.file.level = 'info';
2323

24-
2524
let mainWindow;
2625
let aboutWindow;
2726
let PORT;

0 commit comments

Comments
 (0)