Skip to content

Commit ac46222

Browse files
authored
Merge pull request #384 from manosim/release/v3.0.1
Release 3.0.1
2 parents efc903d + baa75f6 commit ac46222

File tree

7 files changed

+38
-18
lines changed

7 files changed

+38
-18
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release App
33
on:
44
push:
55
branches:
6-
- release
6+
- 'release/v**'
77

88
jobs:
99
release-macos:
@@ -27,6 +27,9 @@ jobs:
2727
run: yarn install
2828

2929
- name: Build
30+
env:
31+
OAUTH_CLIENT_ID: ${{ secrets.oauth_client_id }}
32+
OAUTH_CLIENT_SECRET: ${{ secrets.oauth_client_secret }}
3033
run: yarn build
3134

3235
- name: Pack (electron-builder)

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,37 +31,41 @@ Gitify currently only supports mac OS.
3131

3232
### Development
3333

34-
First you will need to set the testing `CLIENT_ID` and `CLIENT_SECRET` in `src/js/utils/constants.js` file. You can use the development app credentials (use at your own discretion):
34+
Optional: If you want you use your own OAuth credentials, you can do so by passing them as environment variables when bundling the app. This is optional as the app has some default "development" keys (use at your own discretion).
3535

36-
Client Id: 3fef4433a29c6ad8f22c
37-
Client Secret Key: 9670de733096c15322183ff17ed0fc8704050379
36+
OAUTH_CLIENT_ID="123" OAUTH_CLIENT_SECRET="456789" yarn build
3837

39-
To watch for changes in the `src` directory:
38+
To watch for changes(`webpack`) in the `src` directory:
4039

4140
yarn run watch
4241

4342
To run the actual **electron app**:
4443

4544
yarn start
4645

47-
### Distribution
46+
### Releases
4847

49-
To prepare the app for distribution run:
48+
The release process is automated. Follow the steps below.
5049

51-
yarn run build
52-
yarn run pack
53-
yarn run make:macos
50+
1. Create a [new **draft** release](https://github.com/manosim/gitify/releases/new). Set the tag version to something with the format of `v1.2.3`. Save as a **draft**.
51+
2. Once everything is merged to `master`, create a branch that starts with `release/vX.X.X` (ie. `release/v1.2.3`).
52+
3. In the same branch, **bump the version** of the app in the `package.json` file and open a PR. GitHub Actions will build, sign and upload the release assets for each commit to that branch as long as a branch is named like `release/vX.X.X` and there is a draft release with the same version number(`package.json`).
53+
4. Merge your release branch into `master`.
54+
5. Publish the draft release once you've added notes to it and all assets are there.
5455

5556
### Tests
5657

57-
There are 2 linters for `js` & `scss` and unit tests with `jest`.
58+
There are 2 checks - one for prettier and one for the unit tests with `jest`.
5859

59-
// Run only unit tests
60-
yarn run jest
60+
// Run prettier to check
61+
yarn run prettier-check
6162

6263
// Run linter & unit tests with coverage
6364
yarn run test
6465

66+
// Run jest directly - allows to pass arguments like `--watch`
67+
yarn run jest
68+
6569
### FAQ
6670

6771
#### My notifications aren't showing?

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gitify",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"description": "GitHub Notifications on your menu bar.",
55
"main": "main.js",
66
"scripts": {
@@ -50,6 +50,9 @@
5050
"homepage": "https://www.gitify.io/",
5151
"jest": {
5252
"preset": "ts-jest/presets/js-with-ts",
53+
"setupFiles": [
54+
"<rootDir>/src/js/__helpers__/setupEnvVars.js"
55+
],
5356
"testEnvironment": "jsdom",
5457
"coverageThreshold": {
5558
"global": {

src/js/__helpers__/setupEnvVars.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
process.env.OAUTH_CLIENT_ID = 'FAKE_CLIENT_ID_123';
2+
process.env.OAUTH_CLIENT_SECRET = 'FAKE_CLIENT_SECRET_123';

src/js/utils/constants.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ export default {
44

55
DEFAULT_AUTH_OPTIONS: {
66
hostname: 'github.com',
7-
clientId: '3fef4433a29c6ad8f22c',
8-
clientSecret: '9670de733096c15322183ff17ed0fc8704050379',
7+
clientId: process.env.OAUTH_CLIENT_ID,
8+
clientSecret: process.env.OAUTH_CLIENT_SECRET,
99
},
1010

1111
REPO_SLUG: 'manosim/gitify',

src/js/utils/helpers.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ describe('utils/helpers.ts', () => {
111111

112112
expect(new BrowserWindow().loadURL).toHaveBeenCalledTimes(1);
113113
expect(new BrowserWindow().loadURL).toHaveBeenCalledWith(
114-
'https://github.com/login/oauth/authorize?client_id=3fef4433a29c6ad8f22c&scope=user:email,notifications'
114+
'https://github.com/login/oauth/authorize?client_id=FAKE_CLIENT_ID_123&scope=user:email,notifications'
115115
);
116116

117117
expect(new BrowserWindow().destroy).toHaveBeenCalledTimes(1);
@@ -171,7 +171,7 @@ describe('utils/helpers.ts', () => {
171171

172172
expect(new BrowserWindow().loadURL).toHaveBeenCalledTimes(1);
173173
expect(new BrowserWindow().loadURL).toHaveBeenCalledWith(
174-
'https://github.com/login/oauth/authorize?client_id=3fef4433a29c6ad8f22c&scope=user:email,notifications'
174+
'https://github.com/login/oauth/authorize?client_id=FAKE_CLIENT_ID_123&scope=user:email,notifications'
175175
);
176176

177177
expect(new BrowserWindow().destroy).toHaveBeenCalledTimes(1);

webpack.common.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const path = require('path');
2+
const webpack = require('webpack');
23

34
module.exports = {
45
mode: 'development',
@@ -14,6 +15,13 @@ module.exports = {
1415
},
1516
],
1617
},
18+
plugins: [
19+
new webpack.EnvironmentPlugin({
20+
// Development Keys - See README.md
21+
OAUTH_CLIENT_ID: '3fef4433a29c6ad8f22c',
22+
OAUTH_CLIENT_SECRET: '9670de733096c15322183ff17ed0fc8704050379',
23+
}),
24+
],
1725
resolve: {
1826
extensions: ['.tsx', '.ts', '.js'],
1927
},

0 commit comments

Comments
 (0)