diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index d1ce878e5..a20f6cb13 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -30,7 +30,7 @@ jobs: env: CSC_LINK: ${{ secrets.mac_certs }} CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }} - run: yarn make:macos -c.mac.identity=null + run: yarn make:macos --publish=never -c.mac.identity=null - name: Clean up builds run: rm -rfv dist/mac @@ -64,7 +64,7 @@ jobs: run: yarn build - name: Make Windows (electron-builder) - run: yarn make:win + run: yarn make:win --publish=never - name: Clean up builds run: Remove-Item dist/win-unpacked -Recurse @@ -73,3 +73,37 @@ jobs: with: name: Gitify-dist-win path: dist + + build-linux: + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v2 + + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install Dependencies + run: yarn install + + - name: Build + run: yarn build + + - name: Make Linux (electron-builder) + run: yarn make:linux --publish=never + + - name: Clean up builds + run: rm -rfv dist/linux-unpacked + + - uses: actions/upload-artifact@v1 + with: + name: Gitify-dist-linux + path: dist diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b7e3a46c4..9541b0936 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,3 +72,34 @@ jobs: env: GH_TOKEN: ${{ secrets.gh_token }} run: yarn make:win --publish onTagOrDraft + + release-linux: + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v2 + + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install Dependencies + run: yarn install + + - name: Build + env: + OAUTH_CLIENT_ID: ${{ secrets.oauth_client_id }} + OAUTH_CLIENT_SECRET: ${{ secrets.oauth_client_secret }} + run: yarn build + + - name: Publish Linuxs (electron-builder) + env: + GH_TOKEN: ${{ secrets.gh_token }} + run: yarn make:linux --publish onTagOrDraft diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5f5bcb6ee..2ff68c1cb 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -28,3 +28,5 @@ jobs: - name: Run Jest run: yarn test --coverage --runInBand + + - uses: codecov/codecov-action@v1 diff --git a/package.json b/package.json index c8f1fcf08..a1e5c3cda 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,9 @@ "scripts": { "build": "webpack --config webpack.prod.js", "watch": "webpack --config webpack.common.js --watch", - "make:win": "electron-builder --win", + "make:linux": "electron-builder --linux", "make:macos": "electron-builder --mac", + "make:win": "electron-builder --win", "prettier-check": "prettier --check 'src/**/*.{js,ts,tsx}'", "prettier": "prettier --single-quote --trailing-comma es5 --write 'src/**/*.{js,ts,tsx}'", "jest": "jest", @@ -93,6 +94,14 @@ "nsis": { "oneClick": false }, + "linux": { + "target": [ + "AppImage", + "deb" + ], + "category": "Development", + "maintainer": "Emmanouil Konstantinidis" + }, "afterSign": "scripts/notarize.js" }, "dependencies": { @@ -100,14 +109,14 @@ "axios": "=0.19.2", "date-fns": "^2.11.1", "electron-updater": "^4.2.5", - "final-form": "^4.18.7", + "final-form": "^4.19.1", "lodash": "^4.17.15", "menubar": "^8.0.1", "nprogress": "=0.2.0", "react": "=16.13.1", "react-dom": "=16.13.1", "react-emojione": "=5.0.1", - "react-final-form": "^6.3.5", + "react-final-form": "^6.4.0", "react-is": "^16.13.1", "react-redux": "=7.2.0", "react-router-dom": "^5.1.2", @@ -123,24 +132,24 @@ "typescript": "^3.8.3" }, "devDependencies": { - "@testing-library/react": "^10.0.1", - "@types/jest": "^25.1.4", + "@testing-library/react": "^10.0.2", + "@types/jest": "^25.2.1", "@types/lodash": "^4.14.149", - "@types/node": "^13.9.5", - "@types/react": "^16.9.26", + "@types/node": "^13.11.0", + "@types/react": "^16.9.32", "@types/react-redux": "^7.1.7", "@types/react-transition-group": "^4.2.4", "@types/styled-components": "^5.0.1", "electron": "^8.2.0", "electron-builder": "^22.4.1", - "electron-notarize": "^0.2.1", - "jest": "^25.2.3", + "electron-notarize": "^0.3.0", + "jest": "^25.2.7", "nock": "^12.0.3", "prettier": "=2.0.2", "react-test-renderer": "=16.13.1", "redux-logger": "=3.0.6", "redux-mock-store": "=1.5.4", - "ts-jest": "^25.2.1", + "ts-jest": "^25.3.1", "webpack": "^4.42.1", "webpack-cli": "^3.3.11", "webpack-merge": "^4.2.2" diff --git a/src/js/__mocks__/electron.js b/src/js/__mocks__/electron.js index 27c2f3e96..56a5502e9 100644 --- a/src/js/__mocks__/electron.js +++ b/src/js/__mocks__/electron.js @@ -49,6 +49,9 @@ module.exports = { remote: { BrowserWindow: () => browserWindow, dialog: dialog, + process: { + platform: 'darwin', + }, app: { getVersion: () => '0.0.1', getLoginItemSettings: jest.fn(), diff --git a/src/js/routes/settings.tsx b/src/js/routes/settings.tsx index f181633c5..c157b198a 100644 --- a/src/js/routes/settings.tsx +++ b/src/js/routes/settings.tsx @@ -1,16 +1,16 @@ -const { ipcRenderer } = require('electron'); +const { ipcRenderer, remote } = require('electron'); import * as React from 'react'; import { connect } from 'react-redux'; import styled from 'styled-components'; -const { remote } = require('electron'); - import { AppState, SettingsState } from '../../types/reducers'; import { fetchNotifications, updateSetting, logout } from '../actions'; import { FieldCheckbox } from '../components/ui/checkbox'; import { updateTrayIcon } from '../utils/comms'; +const isLinux = remote.process.platform === 'linux'; + const Wrapper = styled.div` display: flex; flex-direction: column; @@ -167,14 +167,16 @@ export class SettingsRoute extends React.Component { this.props.updateSetting('markOnClick', evt.target.checked) } /> - - this.props.updateSetting('openAtStartup', evt.target.checked) - } - /> + {!isLinux && ( + + this.props.updateSetting('openAtStartup', evt.target.checked) + } + /> + )}