Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into pr/11227
Browse files Browse the repository at this point in the history
  • Loading branch information
qiancai committed Jan 23, 2025
2 parents 2361cef + 5be170b commit 150eee0
Show file tree
Hide file tree
Showing 1,046 changed files with 45,871 additions and 16,652 deletions.
12 changes: 5 additions & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@ By default, **CHOOSE MASTER ONLY** so your changes will be applied to the next T
For details, see [tips for choosing the affected versions (in Chinese)](https://github.com/pingcap/docs-cn/blob/master/CONTRIBUTING.md#版本选择指南).

- [ ] master (the latest development version)
- [ ] v7.6 (TiDB 7.6 versions)
- [ ] v9.0 (TiDB 9.0 versions)
- [ ] v8.5 (TiDB 8.5 versions)
- [ ] v8.4 (TiDB 8.4 versions)
- [ ] v8.3 (TiDB 8.3 versions)
- [ ] v8.1 (TiDB 8.1 versions)
- [ ] v7.5 (TiDB 7.5 versions)
- [ ] v7.4 (TiDB 7.4 versions)
- [ ] v7.3 (TiDB 7.3 versions)
- [ ] v7.1 (TiDB 7.1 versions)
- [ ] v6.5 (TiDB 6.5 versions)
- [ ] v6.1 (TiDB 6.1 versions)
- [ ] v5.4 (TiDB 5.4 versions)
- [ ] v5.3 (TiDB 5.3 versions)
- [ ] v5.2 (TiDB 5.2 versions)
- [ ] v5.1 (TiDB 5.1 versions)
- [ ] v5.0 (TiDB 5.0 versions)

### What is the related PR or file link(s)?

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- uses: actions/setup-node@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "16"
- name: Verify duplicated file names
Expand Down
49 changes: 28 additions & 21 deletions .github/workflows/flush-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,46 @@ jobs:
flush-pdf:
name: Flush PDF by Version
runs-on: ubuntu-latest
env:
TENCENTCLOUD_SECRET_ID: ${{ secrets.TENCENTCLOUD_SECRET_ID }}
TENCENTCLOUD_SECRET_KEY: ${{ secrets.TENCENTCLOUD_SECRET_KEY }}
CDN_BASE_URL: "https://docs-download.pingcap.com/pdf"
steps:
- name: install qiniu qshell
uses: foxundermoon/setup-qshell@v5
- name: Set up Python environment
uses: actions/setup-python@v5
with:
version: '2.6.2'
python-version: '3.12'
architecture: 'x64'

- name: print pdf to a file (tidb)
- name: Install Tencent Cloud CLI
run: pip3 install tccli

- name: Print PDF to a file (tidb)
if: ${{ inputs.type == 'tidb' }}
run: |
echo "https://download.pingcap.org/tidb-${{inputs.version}}-en-manual.pdf" >> pdf.txt
echo "https://download.pingcap.org/tidb-${{inputs.version}}-zh-manual.pdf" >> pdf.txt
cat pdf.txt
echo "${CDN_BASE_URL}/tidb-${{inputs.version}}-en-manual.pdf" >> links.txt
echo "${CDN_BASE_URL}/tidb-${{inputs.version}}-zh-manual.pdf" >> links.txt
cat links.txt
- name: print pdf to a file (tidb cloud)
- name: Print PDF to a file (tidb cloud)
if: ${{ inputs.type == 'tidb cloud' }}
run: |
echo "https://download.pingcap.org/tidbcloud-en-manual.pdf" > pdf.txt
cat pdf.txt
echo "${CDN_BASE_URL}/tidbcloud-en-manual.pdf" > links.txt
cat links.txt
- name: print pdf to a file (tidb operator)
- name: Print PDF to a file (tidb operator)
if: ${{ inputs.type == 'tidb operator' }}
run: |
echo "https://download.pingcap.org/tidb-in-kubernetes-${{inputs.version}}-en-manual.pdf" >> pdf.txt
echo "https://download.pingcap.org/tidb-in-kubernetes-${{inputs.version}}-zh-manual.pdf" >> pdf.txt
cat pdf.txt
echo "${CDN_BASE_URL}/tidb-in-kubernetes-${{inputs.version}}-en-manual.pdf" >> links.txt
echo "${CDN_BASE_URL}/tidb-in-kubernetes-${{inputs.version}}-zh-manual.pdf" >> links.txt
cat links.txt
- name: refresh url
- name: Refresh URLs
run: |
qshell account ${{ secrets.QINIU_ACCESS_KEY }} ${{ secrets.QINIU_SECRET_KEY }} tidb
result=$(qshell cdnrefresh -i pdf.txt)
if echo $result | grep -w '200'; then
echo 'CDN refresh success'
else
echo "CDN refresh failed: $result"
cat links.txt | jq -nR '[inputs | select(length>0)]' | tee links.json
tccli cdn PurgeUrlsCache --Urls "$(cat links.json)" | tee result.json
task_id="$(cat result.json | jq .TaskId)"
if [ -z "${task_id}" ]; then
echo "Unable to find TaskId, CDN refresh might fail"
exit 1
fi
26 changes: 16 additions & 10 deletions .github/workflows/flush.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,30 @@ jobs:
flush-pdf:
name: Flush PDF
runs-on: ubuntu-latest
env:
TENCENTCLOUD_SECRET_ID: ${{ secrets.TENCENTCLOUD_SECRET_ID }}
TENCENTCLOUD_SECRET_KEY: ${{ secrets.TENCENTCLOUD_SECRET_KEY }}
steps:
- name: install qiniu qshell
uses: foxundermoon/setup-qshell@v5
- name: Set up Python environment
uses: actions/setup-python@v5
with:
version: '2.6.2'
python-version: '3.12'
architecture: 'x64'

- name: Install Tencent Cloud CLI
run: pip3 install tccli

- name: Download PDF list
run: |
curl https://raw.githubusercontent.com/pingcap/docs-cn/master/resources/cdnfresh.txt --output cdnfresh.txt
cat cdnfresh.txt
- name: refresh url
- name: Refresh URLs
run: |
qshell account ${{ secrets.QINIU_ACCESS_KEY }} ${{ secrets.QINIU_SECRET_KEY }} tidb
result=$(qshell cdnrefresh -i cdnfresh.txt)
if echo $result | grep -w '200'; then
echo 'CDN refresh success'
else
echo "CDN refresh failed: $result"
cat cdnfresh.txt | jq -nR '[inputs | select(length>0)]' | tee cdnfresh.json
tccli cdn PurgeUrlsCache --Urls "$(cat cdnfresh.json)" | tee result.json
task_id="$(cat result.json | jq .TaskId)"
if [ -z "${task_id}" ]; then
echo "Unable to find TaskId, CDN refresh might fail"
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/link-fail-fast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/link.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Download Exclude Path
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/media.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Upload media files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Must use at least depth 2!
fetch-depth: 2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prevent-deletion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout base
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Fetch head
run: |
git remote add head ${{ github.event.pull_request.head.repo.clone_url }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.REBASE_SECRET_KEY }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
Expand Down
Binary file added .vaunt/1st_place.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .vaunt/2nd_place.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .vaunt/3rd_place.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .vaunt/4th_place.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .vaunt/5th_place.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions .vaunt/add-tidb-docs-dash-badge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 如何在你的 GitHub 个人资料页上添加 TiDB 文档挑战赛徽章

[GitHub 个人资料页](https://docs.github.com/zh/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/about-your-profile)不仅仅是你的 GitHub 仓库的集合,更是你在编程领域中的专业身份标志。

本指南介绍如何在你的 GitHub 个人资料页上添加 [2024 TiDB 文档挑战赛](https://asktug.com/t/topic/1019364) (TiDB Docs Dash) 活动徽章。

## 第 1 步:创建一个仓库,存放个人资料 README

如果你已经配置了 GitHub 个人资料 README,请跳过以下步骤,直接进入[第 2 步:编辑个人资料 README](#第-2-步编辑个人资料-readme)

1. 在 GitHub 任一页面的右上角,点击 **+**,然后点击 **New repository**

<img src="https://docs.github.com/assets/cb-34248/mw-1440/images/help/repository/repo-create-global-nav-update.webp" width="350" />

2. 以你的 GitHub 用户名命名该仓库。例如,如果你的用户名为 `ilovetidb`,则仓库名必须为 `ilovetidb`
3. 选择 **Public** 将该仓库设置为公共可见。
4.**Initialize this repository with:** 下面,选择 **Add a README file**
5. 点击 **Create repository**

## 第 2 步:编辑个人资料 README

1. 在你的 `<github_username>` 仓库的 GitHub 页面上,点击右侧边栏上方的 **Edit README**
2. 在 README 文件中添加以下代码,并将 `{{github_username}}` 替换为你的 GitHub 用户名,然后提交更改。

```HTML
<p>
<img src="https://api.vaunt.dev/v1/github/entities/{{github_username}}/achievements?format=svg&limit=3" width="350" />
</p>
```

此时,刷新你的 GitHub 个人资料页,即可看到 TiDB Docs Dash 活动徽章。

关于如何管理个人资料 README 的更多信息,请参阅 [GitHub 文档](https://docs.github.com/zh/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/managing-your-profile-readme)。

## (可选)通过 Vaunt 添加更多展示

本次 TiDB 文档挑战赛的徽章是通过 [Vaunt](https://vaunt.dev/) 授予的,Vaunt 是一个开发者关系平台,旨在赋能和发展开发者社区。

通过 Vaunt 提供的以下功能,你还可以在你的个人资料 README 中展示你在其它开源项目中做出的贡献:

- 集成你的 developer card 到个人资料 README

示例卡片:

<p>
<a href="https://vaunt.dev">
<img src="https://api.vaunt.dev/v1/github/entities/jeff1010322/contributions?format=svg" width="350" />
</a>
</p>

如需集成你的 developer card,请将以下代码添加到你的 README 文件中,并将 `{{github_username}}` 替换为你的用户名。

```HTML
<p>
<a href="https://vaunt.dev">
<img src="https://api.vaunt.dev/v1/github/entities/{{github_username}}/contributions?format=svg" width="350" />
</a>
</p>
```

- 集成你的社区贡献看板到个人资料 README

社区贡献看板通过视图的形式,可以综合展示你在 GitHub 各个仓库的贡献统计数据。

[![VauntCommunity](https://api.vaunt.dev/v1/github/entities/pingcap/badges/community)](https://community.vaunt.dev/board/pingcap)

- 查看[你的社区看板](https://community.vaunt.dev/)。
- 如需集成你的社区看板,请将以下代码添加到你的 README 文件中,并将 `{{github_username}}` 替换为你的 GitHub 用户名:

```Markdown
[![VauntCommunity](https://api.vaunt.dev/v1/github/entities/{{github_username}}/badges/community)](https://community.vaunt.dev/board/{{github_username}})
```
Loading

0 comments on commit 150eee0

Please sign in to comment.