Skip to content

Commit 7791f3a

Browse files
authored
Merge pull request #92 from funnyzak/refactor/action
2 parents b13628a + 5c77d1a commit 7791f3a

File tree

17 files changed

+192
-138
lines changed

17 files changed

+192
-138
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ module.exports = {
9292
'react-hooks/exhaustive-deps': 'warn',
9393
'react-native/no-unused-styles': 2,
9494
'react-native/split-platform-components': 2,
95-
'react-native/no-inline-styles': 'warn',
95+
'react-native/no-inline-styles': 'off',
9696
'react-native/no-color-literals': 2,
9797
'react-native/no-raw-text': 0,
9898
'react-native/no-single-element-style-arrays': 2

.github/workflows/ci.yml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,52 @@ jobs:
99
install-and-test:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- name: Install dependencies
12+
-
13+
uses: actions/checkout@v2
14+
-
15+
name: Install dependencies
1416
run: |
1517
yarn
18+
yarn lint
1619
build-android:
1720
needs: install-and-test
1821
runs-on: ubuntu-latest
1922
steps:
20-
- uses: actions/checkout@v2
21-
22-
- name: Use Node.js
23+
-
24+
uses: actions/checkout@v2
25+
-
26+
name: Use Node.js
2327
uses: actions/setup-node@v2
2428
with:
2529
node-version: "16.16.0"
26-
27-
- name: Get yarn cache directory path
30+
-
31+
name: Get yarn cache directory path
2832
id: yarn-cache-dir-path
2933
run: echo "::set-output name=dir::$(yarn cache dir)"
30-
3134
- uses: actions/cache@v1
3235
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
3336
with:
3437
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
3538
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
3639
restore-keys: |
3740
${{ runner.os }}-yarn-
38-
39-
- name: Install dependencies
41+
-
42+
name: Install dependencies
4043
run: |
4144
yarn
42-
43-
- name: Build Android Release
45+
-
46+
name: Build Android Release
4447
run: |
4548
cd android && ./gradlew assembleRelease
46-
47-
- name: Get the version
49+
-
50+
name: Get the version
4851
id: get_version
4952
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
50-
51-
- name: Rename Apk Name
53+
-
54+
name: Rename Apk Name
5255
run: cp android/app/build/outputs/apk/release/app-release.apk android/app/build/outputs/apk/release/v2hub-${{ steps.get_version.outputs.VERSION }}.apk
53-
54-
- name: build changelog
56+
-
57+
name: build changelog
5558
id: build_changelog
5659
if: startsWith(github.ref, 'refs/tags/')
5760
uses: mikepenz/[email protected]
@@ -60,8 +63,8 @@ jobs:
6063
with:
6164
configuration: ".config/changelog_configuration.json"
6265
ignorePreReleases: "false"
63-
64-
- name: Create Release
66+
-
67+
name: Create Release
6568
uses: softprops/action-gh-release@v1
6669
if: startsWith(github.ref, 'refs/tags/')
6770
with:
@@ -71,21 +74,18 @@ jobs:
7174
env:
7275
GITHUB_TOKEN: ${{ secrets.github_token }}
7376

74-
# - name: Upload Artifact
75-
# uses: actions/upload-artifact@v1
76-
# with:
77-
# name: app-release.apk
78-
# path: android/app/build/outputs/apk/release/
79-
80-
81-
jishida-push:
77+
push:
8278
runs-on: ubuntu-latest
8379
needs: [build-android]
8480
if: startsWith(github.ref, 'refs/tags/')
8581
steps:
86-
- name: JiShiDa Push
87-
uses: funnyzak/jishida-action@master
82+
-
83+
name: V2Hub Release Push
84+
uses: funnyzak/pushoo-action@main
8885
with:
89-
key: ${{secrets.JPUSH_KEY}}
90-
head: ${{github.repository}}已完成打包发布
91-
body: 来自GithubAction:${{github.repository}} 发布已完成,下载地址:https://github.com/funnyzak/react-native-v2ex/releases。
86+
platforms: ifttt, bark
87+
tokens: ${{ secrets.PUSH_KEY }}
88+
content: |
89+
# ${{github.repository}} Released
90+
options: '{"bark": { "url": "https://github.com/funnyzak" }}'
91+
debug: false

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches: [ dev, main ]
6+
pull_request:
7+
branches: [ dev, main ]
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [16.x]
14+
steps:
15+
-
16+
name: Checkout
17+
uses: actions/checkout@v3
18+
-
19+
name: Use Node.js
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
-
24+
name: Get yarn cache directory path
25+
id: yarn-cache-dir-path
26+
run: echo "::set-output name=dir::$(yarn cache dir)"
27+
-
28+
uses: actions/cache@v1
29+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
30+
with:
31+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
32+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
33+
restore-keys: |
34+
${{ runner.os }}-yarn-
35+
-
36+
name: Lint
37+
run: |
38+
yarn
39+
yarn lint

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"source.fixAll.spotlessGradle": true
1212
}
1313
},
14-
"java.configuration.updateBuildConfiguration": "interactive"
14+
"java.configuration.updateBuildConfiguration": "automatic"
1515
}

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ android {
138138
applicationId "github.funnyzak.v2ex"
139139
minSdkVersion rootProject.ext.minSdkVersion
140140
targetSdkVersion rootProject.ext.targetSdkVersion
141-
versionCode 32
141+
versionCode 33
142142
versionName "0.7.1"
143143
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
144144

metro.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ module.exports = {
1010
getTransformOptions: async () => ({
1111
transform: {
1212
experimentalImportSupport: false,
13-
inlineRequires: true,
14-
},
15-
}),
16-
},
17-
};
13+
inlineRequires: true
14+
}
15+
})
16+
}
17+
}

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
"start": "react-native start",
1212
"test": "jest",
1313
"pod": "pod-install",
14-
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
14+
"lint:code": "eslint --max-warnings 100 . --ext .js,.jsx,.ts,.tsx",
15+
"lint:style": "prettier --check '**/*.{ts,js,jsx,tsx}'",
16+
"lint:style:fix": "prettier --write '**/*.{ts,js,jsx,tsx}'",
17+
"lint": "yarn lint:code && yarn lint:style",
18+
"lint:fix": "yarn lint:style:fix && yarn lint:code --fix",
1519
"prepare": "if [[ $NODE_ENV != \"production\" ]]; then husky install; fi && patch-package",
1620
"upgrade": "react-native upgrade",
1721
"check-dependencies": "rnx-dep-check",
@@ -28,6 +32,8 @@
2832
"keywords": [
2933
"react",
3034
"react-native",
35+
"v2ex",
36+
"react-native-v2ex",
3137
"javascript",
3238
"js",
3339
"redux",
@@ -136,4 +142,4 @@
136142
"*.{js,jsx,ts,tsx}": "eslint --cache --fix",
137143
"*.{js,tx,tsx,sass,less,css,md}": "prettier --write"
138144
}
139-
}
145+
}

src/components/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
export { default as Header } from './header'
2-
export { default as LoadingModal } from './loading-modal'
3-
export { default as loading } from './loading'
4-
export * from './atoms'
5-
export * from './common'
6-
export { default as Avatar } from './avatar'
7-
8-
export * from './toast'
1+
export { default as Header } from './header'
2+
export { default as LoadingModal } from './loading-modal'
3+
export { default as loading } from './loading'
4+
export * from './atoms'
5+
export * from './common'
6+
export { default as Avatar } from './avatar'
7+
8+
export * from './toast'

src/reducers/NotificationReducer.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { APP_NOTIFICATION_PULL, APP_LOGOUT, APP_NOTIFICATION_LATEST, APP_NOTIFICATION_REMOVE, Action, IState } from '../types'
1+
import {
2+
APP_NOTIFICATION_PULL,
3+
APP_LOGOUT,
4+
APP_NOTIFICATION_LATEST,
5+
APP_NOTIFICATION_REMOVE,
6+
Action,
7+
IState
8+
} from '../types'
29

310
const INITIAL_STATE: IState.NotificationState = {
411
refreshing: false,

src/screens/components/notification/NotificationList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const NotificationList: React.FC<NotificationListProps> = ({ containerStyle }: N
6161
})
6262
},
6363
[showMessage, page, logined]
64-
) // eslint-disable-line react-hooks/exhaustive-deps
64+
)
6565

6666
const onRefresh = useCallback(() => {
6767
setPage(1)

0 commit comments

Comments
 (0)