Skip to content

Commit dece537

Browse files
authored
Support for Linux (#396)
* Build linux * Update packages * Hide openAtStartUp on Linux * Build config for linux * Don't publish on build * Use GitHub action by codecov
1 parent eb947ba commit dece537

File tree

7 files changed

+1174
-1736
lines changed

7 files changed

+1174
-1736
lines changed

.github/workflows/build-app.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
env:
3131
CSC_LINK: ${{ secrets.mac_certs }}
3232
CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }}
33-
run: yarn make:macos -c.mac.identity=null
33+
run: yarn make:macos --publish=never -c.mac.identity=null
3434

3535
- name: Clean up builds
3636
run: rm -rfv dist/mac
@@ -64,7 +64,7 @@ jobs:
6464
run: yarn build
6565

6666
- name: Make Windows (electron-builder)
67-
run: yarn make:win
67+
run: yarn make:win --publish=never
6868

6969
- name: Clean up builds
7070
run: Remove-Item dist/win-unpacked -Recurse
@@ -73,3 +73,37 @@ jobs:
7373
with:
7474
name: Gitify-dist-win
7575
path: dist
76+
77+
build-linux:
78+
runs-on: ubuntu-18.04
79+
80+
steps:
81+
- uses: actions/checkout@v2
82+
83+
- name: Get yarn cache
84+
id: yarn-cache
85+
run: echo "::set-output name=dir::$(yarn cache dir)"
86+
87+
- uses: actions/cache@v1
88+
with:
89+
path: ${{ steps.yarn-cache.outputs.dir }}
90+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
91+
restore-keys: |
92+
${{ runner.os }}-yarn-
93+
94+
- name: Install Dependencies
95+
run: yarn install
96+
97+
- name: Build
98+
run: yarn build
99+
100+
- name: Make Linux (electron-builder)
101+
run: yarn make:linux --publish=never
102+
103+
- name: Clean up builds
104+
run: rm -rfv dist/linux-unpacked
105+
106+
- uses: actions/upload-artifact@v1
107+
with:
108+
name: Gitify-dist-linux
109+
path: dist

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,34 @@ jobs:
7272
env:
7373
GH_TOKEN: ${{ secrets.gh_token }}
7474
run: yarn make:win --publish onTagOrDraft
75+
76+
release-linux:
77+
runs-on: ubuntu-18.04
78+
79+
steps:
80+
- uses: actions/checkout@v2
81+
82+
- name: Get yarn cache
83+
id: yarn-cache
84+
run: echo "::set-output name=dir::$(yarn cache dir)"
85+
86+
- uses: actions/cache@v1
87+
with:
88+
path: ${{ steps.yarn-cache.outputs.dir }}
89+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
90+
restore-keys: |
91+
${{ runner.os }}-yarn-
92+
93+
- name: Install Dependencies
94+
run: yarn install
95+
96+
- name: Build
97+
env:
98+
OAUTH_CLIENT_ID: ${{ secrets.oauth_client_id }}
99+
OAUTH_CLIENT_SECRET: ${{ secrets.oauth_client_secret }}
100+
run: yarn build
101+
102+
- name: Publish Linuxs (electron-builder)
103+
env:
104+
GH_TOKEN: ${{ secrets.gh_token }}
105+
run: yarn make:linux --publish onTagOrDraft

.github/workflows/run-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ jobs:
2828

2929
- name: Run Jest
3030
run: yarn test --coverage --runInBand
31+
32+
- uses: codecov/codecov-action@v1

package.json

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
"scripts": {
77
"build": "webpack --config webpack.prod.js",
88
"watch": "webpack --config webpack.common.js --watch",
9-
"make:win": "electron-builder --win",
9+
"make:linux": "electron-builder --linux",
1010
"make:macos": "electron-builder --mac",
11+
"make:win": "electron-builder --win",
1112
"prettier-check": "prettier --check 'src/**/*.{js,ts,tsx}'",
1213
"prettier": "prettier --single-quote --trailing-comma es5 --write 'src/**/*.{js,ts,tsx}'",
1314
"jest": "jest",
@@ -93,21 +94,29 @@
9394
"nsis": {
9495
"oneClick": false
9596
},
97+
"linux": {
98+
"target": [
99+
"AppImage",
100+
"deb"
101+
],
102+
"category": "Development",
103+
"maintainer": "Emmanouil Konstantinidis"
104+
},
96105
"afterSign": "scripts/notarize.js"
97106
},
98107
"dependencies": {
99108
"@primer/octicons-react": "^9.6.0",
100109
"axios": "=0.19.2",
101110
"date-fns": "^2.11.1",
102111
"electron-updater": "^4.2.5",
103-
"final-form": "^4.18.7",
112+
"final-form": "^4.19.1",
104113
"lodash": "^4.17.15",
105114
"menubar": "^8.0.1",
106115
"nprogress": "=0.2.0",
107116
"react": "=16.13.1",
108117
"react-dom": "=16.13.1",
109118
"react-emojione": "=5.0.1",
110-
"react-final-form": "^6.3.5",
119+
"react-final-form": "^6.4.0",
111120
"react-is": "^16.13.1",
112121
"react-redux": "=7.2.0",
113122
"react-router-dom": "^5.1.2",
@@ -123,24 +132,24 @@
123132
"typescript": "^3.8.3"
124133
},
125134
"devDependencies": {
126-
"@testing-library/react": "^10.0.1",
127-
"@types/jest": "^25.1.4",
135+
"@testing-library/react": "^10.0.2",
136+
"@types/jest": "^25.2.1",
128137
"@types/lodash": "^4.14.149",
129-
"@types/node": "^13.9.5",
130-
"@types/react": "^16.9.26",
138+
"@types/node": "^13.11.0",
139+
"@types/react": "^16.9.32",
131140
"@types/react-redux": "^7.1.7",
132141
"@types/react-transition-group": "^4.2.4",
133142
"@types/styled-components": "^5.0.1",
134143
"electron": "^8.2.0",
135144
"electron-builder": "^22.4.1",
136-
"electron-notarize": "^0.2.1",
137-
"jest": "^25.2.3",
145+
"electron-notarize": "^0.3.0",
146+
"jest": "^25.2.7",
138147
"nock": "^12.0.3",
139148
"prettier": "=2.0.2",
140149
"react-test-renderer": "=16.13.1",
141150
"redux-logger": "=3.0.6",
142151
"redux-mock-store": "=1.5.4",
143-
"ts-jest": "^25.2.1",
152+
"ts-jest": "^25.3.1",
144153
"webpack": "^4.42.1",
145154
"webpack-cli": "^3.3.11",
146155
"webpack-merge": "^4.2.2"

src/js/__mocks__/electron.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ module.exports = {
4949
remote: {
5050
BrowserWindow: () => browserWindow,
5151
dialog: dialog,
52+
process: {
53+
platform: 'darwin',
54+
},
5255
app: {
5356
getVersion: () => '0.0.1',
5457
getLoginItemSettings: jest.fn(),

src/js/routes/settings.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
const { ipcRenderer } = require('electron');
1+
const { ipcRenderer, remote } = require('electron');
22

33
import * as React from 'react';
44
import { connect } from 'react-redux';
55
import styled from 'styled-components';
66

7-
const { remote } = require('electron');
8-
97
import { AppState, SettingsState } from '../../types/reducers';
108
import { fetchNotifications, updateSetting, logout } from '../actions';
119
import { FieldCheckbox } from '../components/ui/checkbox';
1210
import { updateTrayIcon } from '../utils/comms';
1311

12+
const isLinux = remote.process.platform === 'linux';
13+
1414
const Wrapper = styled.div`
1515
display: flex;
1616
flex-direction: column;
@@ -167,14 +167,16 @@ export class SettingsRoute extends React.Component<IProps> {
167167
this.props.updateSetting('markOnClick', evt.target.checked)
168168
}
169169
/>
170-
<FieldCheckbox
171-
name="openAtStartUp"
172-
label="Open at startup"
173-
checked={settings.openAtStartup}
174-
onChange={(evt) =>
175-
this.props.updateSetting('openAtStartup', evt.target.checked)
176-
}
177-
/>
170+
{!isLinux && (
171+
<FieldCheckbox
172+
name="openAtStartUp"
173+
label="Open at startup"
174+
checked={settings.openAtStartup}
175+
onChange={(evt) =>
176+
this.props.updateSetting('openAtStartup', evt.target.checked)
177+
}
178+
/>
179+
)}
178180
</Main>
179181

180182
<Footer>

0 commit comments

Comments
 (0)