Skip to content

Commit e3ec61e

Browse files
committed
chore: standardize repository tooling
1 parent e98fa3b commit e3ec61e

9 files changed

Lines changed: 258 additions & 310 deletions

File tree

.github/FUNDING.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,2 @@
1-
# These are supported funding model platforms
2-
3-
github: ant-design # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4-
patreon: # Replace with a single Patreon username
5-
open_collective: ant-design # Replace with a single Open Collective username
6-
ko_fi: # Replace with a single Ko-fi username
7-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9-
liberapay: # Replace with a single Liberapay username
10-
issuehunt: # Replace with a single IssueHunt username
11-
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12-
polar: # Replace with a single Polar username
13-
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14-
thanks_dev: # Replace with a single thanks.dev username
15-
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
1+
github: ant-design
2+
open_collective: ant-design
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Cloudflare Pages Preview
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
deployments: write
9+
10+
jobs:
11+
preview:
12+
runs-on: ubuntu-latest
13+
env:
14+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
15+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
16+
CLOUDFLARE_PAGES_PROJECT: ${{ vars.CLOUDFLARE_PAGES_PROJECT }}
17+
PREVIEW: true
18+
steps:
19+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
20+
with:
21+
persist-credentials: false
22+
- name: Skip Cloudflare Pages preview
23+
if: ${{ env.CLOUDFLARE_API_TOKEN == '' || env.CLOUDFLARE_ACCOUNT_ID == '' || env.CLOUDFLARE_PAGES_PROJECT == '' }}
24+
run: echo "Cloudflare Pages preview is not configured; skip deployment."
25+
- name: Install dependencies
26+
if: ${{ env.CLOUDFLARE_API_TOKEN != '' && env.CLOUDFLARE_ACCOUNT_ID != '' && env.CLOUDFLARE_PAGES_PROJECT != '' }}
27+
run: npm install
28+
- name: Build site
29+
if: ${{ env.CLOUDFLARE_API_TOKEN != '' && env.CLOUDFLARE_ACCOUNT_ID != '' && env.CLOUDFLARE_PAGES_PROJECT != '' }}
30+
run: npm run build
31+
- name: Deploy preview
32+
if: ${{ env.CLOUDFLARE_API_TOKEN != '' && env.CLOUDFLARE_ACCOUNT_ID != '' && env.CLOUDFLARE_PAGES_PROJECT != '' }}
33+
uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0
34+
with:
35+
apiToken: ${{ env.CLOUDFLARE_API_TOKEN }}
36+
accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }}
37+
command: pages deploy dist --project-name=${{ env.CLOUDFLARE_PAGES_PROJECT }} --branch=${{ github.head_ref }}
38+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/codeql.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,20 @@ jobs:
2424

2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v3
27+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
28+
with:
29+
persist-credentials: false
2830

2931
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@v2
32+
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
3133
with:
3234
languages: ${{ matrix.language }}
3335
queries: +security-and-quality
3436

3537
- name: Autobuild
36-
uses: github/codeql-action/autobuild@v2
38+
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
3739

3840
- name: Perform CodeQL Analysis
39-
uses: github/codeql-action/analyze@v2
41+
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
4042
with:
4143
category: "/language:${{ matrix.language }}"

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ name: ✅ test
22
on: [push, pull_request]
33
jobs:
44
test:
5-
uses: react-component/rc-test/.github/workflows/test-npm.yml@main
6-
secrets: inherit
5+
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
6+
secrets: inherit

.github/workflows/react-doctor.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: React Doctor
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened, ready_for_review]
5+
push:
6+
branches: [master]
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
issues: write
12+
statuses: write
13+
14+
concurrency:
15+
group: react-doctor-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
react-doctor:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
23+
with:
24+
fetch-depth: 0
25+
persist-credentials: false
26+
- uses: millionco/react-doctor@0b4f4f4bd248a154e64eb508a48347f71154b3f3
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Surge Preview
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
checks: write
10+
11+
jobs:
12+
preview:
13+
runs-on: ubuntu-latest
14+
env:
15+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
16+
steps:
17+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
18+
with:
19+
persist-credentials: false
20+
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
21+
if: ${{ env.SURGE_TOKEN != '' }}
22+
with:
23+
surge_token: ${{ env.SURGE_TOKEN }}
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
dist: dist
26+
failOnError: true
27+
setCommitStatus: true
28+
build: |
29+
npm install
30+
npm run build
31+
- name: Skip Surge preview
32+
if: ${{ env.SURGE_TOKEN == '' }}
33+
run: echo "SURGE_TOKEN is not configured; skip Surge preview."

0 commit comments

Comments
 (0)