Skip to content

Commit 8abc02f

Browse files
authored
chore: standardize repository maintenance (#3)
chore: standardize repository maintenance
1 parent b207af2 commit 8abc02f

7 files changed

Lines changed: 115 additions & 150 deletions

File tree

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
day: monday
8+
time: "21:00"
9+
timezone: Asia/Shanghai
10+
groups:
11+
github-actions:
12+
patterns:
13+
- "*"

FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: ant-design
2+
open_collective: ant-design

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019-present react-component
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
1-
# GitHub Actions
1+
<div align="center">
2+
<h1>React Component GitHub Defaults</h1>
3+
<p><sub><a href="https://ant.design"><img alt="Ant Design" height="14" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" style="vertical-align: -0.125em;" /></a> Part of the Ant Design ecosystem.</sub></p>
4+
<p>🧰 Shared GitHub community files and workflow templates for rc-component packages.</p>
5+
</div>
26

3-
🤖 React Component GitHub Actions CI workflow template.
7+
<p align="center">English | <a href="./README.zh-CN.md">简体中文</a></p>
48

5-
ref: [GitHub docs](https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/sharing-workflows-with-your-organization)
9+
Shared GitHub community files and workflow templates for the React Component organization.
610

7-
## 💬 How to use?
11+
## Recommended CI
812

9-
1、On GitHub, navigate to the main page of the repository.
13+
New rc-component repositories should use the reusable workflow from `react-component/rc-test`:
1014

11-
2、Under your repository name, click Actions.
15+
```yml
16+
jobs:
17+
test:
18+
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
19+
secrets:
20+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
21+
```
1222
13-
![](./assets/image/actions-tab.png)
23+
## Workflow Template
1424
15-
3、If your repository already has existing workflows: In the upper-left corner, click New workflow.
25+
1. Open the target repository on GitHub.
26+
2. Go to the Actions tab.
27+
3. Click New workflow when the repository already has workflows.
28+
4. Choose the React Component workflow template.
1629
17-
![](./assets/image/actions-new-workflow.png)
30+
See GitHub's documentation for [sharing workflows with an organization](https://docs.github.com/en/actions/using-workflows/sharing-workflows-secrets-and-runners-with-your-organization).
1831
19-
4、In section titled "Workflows created by React Component". Click **Set up this workflow**.
32+
## License
2033
21-
![](./assets/image/react-component-ci.png)
22-
23-
## 💬 How to migrate from travis CI?
24-
25-
1、Remove `.travis.yml` from the root dir of project.
26-
27-
2、Update build ci badge url in `README.md`.
28-
29-
ref: [Update Badge](https://github.com/react-component/trigger/pull/213)
30-
31-
3、Following [How to use](#how-to-use) to set up github actions.
34+
MIT License. See [LICENSE](./LICENSE) for details.

README.zh-CN.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<div align="center">
2+
<h1>React Component GitHub Defaults</h1>
3+
<p><sub><a href="https://ant.design"><img alt="Ant Design" height="14" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" style="vertical-align: -0.125em;" /></a> Ant Design 生态的一部分。</sub></p>
4+
<p>🧰 rc-component 仓库共享的 GitHub 社区文件与工作流模板。</p>
5+
</div>
6+
7+
<p align="center"><a href="./README.md">English</a> | 简体中文</p>
8+
9+
React Component 组织共享的 GitHub Actions 工作流模板。
10+
11+
## 使用方式
12+
13+
1. 进入目标仓库的 Actions 页面。
14+
2. 如果仓库已有工作流,点击 New workflow。
15+
3. 选择 React Component 提供的模板并按需提交。
16+
17+
当前推荐新仓库直接使用 [rc-test](https://github.com/react-component/rc-test) 中的 reusable workflow:
18+
19+
```yml
20+
jobs:
21+
test:
22+
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
23+
secrets:
24+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
25+
```
26+
27+
## License
28+
29+
MIT License。详见 [LICENSE](./LICENSE)。

profile/README.md

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
1-
# Fundamental react components of antd
1+
# React Component
22

3-
React components foundation of https://ant.design, developed and maintained by the Ant Design Team.
3+
React Component provides the low-level React primitives that power the Ant Design ecosystem.
44

5-
## Docs
6-
7-
https://react-component.github.io
5+
<p>
6+
<a href="https://ant.design"><img alt="Ant Design" height="14" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" /></a>
7+
<sub>Part of the Ant Design ecosystem.</sub>
8+
</p>
89

9-
### 中文
10+
## Packages
1011

11-
- [如何开发一个 react 组件](https://github.com/react-component/react-component.github.io/blob/master/docs/zh-cn/how-to-write-a-react-component.md)
12-
- [react 组件代码规范](https://github.com/react-component/react-component.github.io/blob/master/docs/zh-cn/component-code-style.md)
13-
- [react 组件设计原则](https://github.com/react-component/react-component.github.io/blob/master/docs/zh-cn/component-design.md)
14-
- [kissy 与 react 组件编写异同](https://github.com/react-component/react-component.github.io/blob/master/docs/zh-cn/kissy-react-compare.md)
12+
- Core component packages live under [react-component](https://github.com/react-component).
13+
- Public packages are published as <code>@rc-component/*</code> when possible.
14+
- Shared test workflow lives in [rc-test](https://github.com/react-component/rc-test).
15+
- Shared release helper lives in [@rc-component/np](https://github.com/react-component/np).
1516

16-
## third-party recommended react components
17+
## Docs
1718

18-
- [search index](http://react-components.com)
19-
- [react-bootstrap](https://github.com/react-bootstrap/react-bootstrap/)
20-
- [react-forms](https://github.com/prometheusresearch/react-forms)
21-
- [react-router](https://github.com/rackt/react-router)
22-
- [flux-router-component](https://github.com/yahoo/flux-router-component)
19+
- [Ant Design](https://ant.design)
20+
- [React Component docs](https://react-component.github.io)
2321

24-
## tutorials
22+
## License
2523

26-
- [learning-react](https://github.com/yiminghe/learning-react)
27-
- [awesome-react](https://github.com/enaqx/awesome-react)
28-
- [react-learning](https://github.com/rpflorence/react-training)
29-
- [react-starter-kit](https://github.com/kriasoft/react-starter-kit)
24+
MIT License. See [LICENSE](../LICENSE) for details.
Lines changed: 10 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,16 @@
1-
name: CI
1+
name: ✅ test
22

33
on:
44
push:
5-
branches: [ $default-branch ]
5+
branches: [$default-branch]
66
pull_request:
7-
branches: [ $default-branch ]
7+
branches: [$default-branch]
88

9-
jobs:
10-
setup:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: checkout
14-
uses: actions/checkout@master
15-
16-
- uses: actions/setup-node@v1
17-
with:
18-
node-version: '12'
19-
20-
- name: cache package-lock.json
21-
uses: actions/cache@v2
22-
with:
23-
path: package-temp-dir
24-
key: lock-${{ github.sha }}
25-
26-
- name: create package-lock.json
27-
run: npm i --package-lock-only
28-
29-
- name: hack for singe file
30-
run: |
31-
if [ ! -d "package-temp-dir" ]; then
32-
mkdir package-temp-dir
33-
fi
34-
cp package-lock.json package-temp-dir
35-
36-
- name: cache node_modules
37-
id: node_modules_cache_id
38-
uses: actions/cache@v2
39-
with:
40-
path: node_modules
41-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
42-
43-
- name: install
44-
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
45-
run: npm ci
46-
47-
lint:
48-
runs-on: ubuntu-latest
49-
steps:
50-
- name: checkout
51-
uses: actions/checkout@master
52-
53-
- name: restore cache from package-lock.json
54-
uses: actions/cache@v2
55-
with:
56-
path: package-temp-dir
57-
key: lock-${{ github.sha }}
58-
59-
- name: restore cache from node_modules
60-
uses: actions/cache@v2
61-
with:
62-
path: node_modules
63-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
64-
65-
- name: lint
66-
run: npm run lint
9+
permissions:
10+
contents: read
6711

68-
needs: setup
69-
70-
compile:
71-
runs-on: ubuntu-latest
72-
steps:
73-
- name: checkout
74-
uses: actions/checkout@master
75-
76-
- name: restore cache from package-lock.json
77-
uses: actions/cache@v2
78-
with:
79-
path: package-temp-dir
80-
key: lock-${{ github.sha }}
81-
82-
- name: restore cache from node_modules
83-
uses: actions/cache@v2
84-
with:
85-
path: node_modules
86-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
87-
88-
- name: compile
89-
run: npm run compile
90-
91-
needs: setup
92-
93-
coverage:
94-
runs-on: ubuntu-latest
95-
steps:
96-
- name: checkout
97-
uses: actions/checkout@master
98-
99-
- name: restore cache from package-lock.json
100-
uses: actions/cache@v2
101-
with:
102-
path: package-temp-dir
103-
key: lock-${{ github.sha }}
104-
105-
- name: restore cache from node_modules
106-
uses: actions/cache@v2
107-
with:
108-
path: node_modules
109-
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
110-
111-
- name: coverage
112-
run: npm test -- --coverage && bash <(curl -s https://codecov.io/bash)
113-
114-
needs: setup
12+
jobs:
13+
test:
14+
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
15+
secrets:
16+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)