Skip to content

Commit e268161

Browse files
radxa-chenchongbiaoRadxaYuntian
authored andcommitted
chore: set mdbook version to v0.4.52
指定 mdbook 的版本, 避免后续 mdbook 更新版本与模板不匹配引入错误, 本地版本与部署版本保持一致, 方便发现问题. workflows 使用 devenv 运行运行环境.
1 parent b88e293 commit e268161

File tree

4 files changed

+29
-41
lines changed

4 files changed

+29
-41
lines changed

.github/workflows/docs.yaml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,17 @@ jobs:
3535
uses: actions/checkout@v5
3636
with:
3737
fetch-depth: 0
38-
- name: Setup mdBook
39-
uses: peaceiris/actions-mdbook@v2
38+
- name: Install Nix
39+
uses: cachix/install-nix-action@v26
40+
- name: Use cachix
41+
uses: cachix/cachix-action@v14
4042
with:
41-
mdbook-version: 'latest'
42-
- name: Install mdbook plugins
43-
shell: bash
44-
run: |
45-
for i in mdbook-admonish mdbook-linkcheck mdbook-i18n-helpers mdbook-toc mdbook-cmdrun
46-
do
47-
cargo install "$i"
48-
done
43+
name: devenv
44+
- name: Install devenv.sh
45+
run: nix profile install nixpkgs#devenv
4946
- name: Build
5047
run: |
51-
mdbook build
48+
devenv shell mdbook build
5249
for po_lang in zh-CN
5350
do
5451
POT_CREATION_DATE=$(grep --max-count 1 '^"POT-Creation-Date:' po/$po_lang.po | sed -E 's/".*: (.*)\\n"/\1/')
@@ -65,7 +62,7 @@ jobs:
6562
MDBOOK_BOOK__LANGUAGE=$po_lang \
6663
MDBOOK_OUTPUT__HTML__SITE_URL=/rsdk/$po_lang/ \
6764
MDBOOK_OUTPUT__HTML__REDIRECT='{}' \
68-
mdbook build -d book/$po_lang
65+
devenv shell mdbook build -d book/$po_lang
6966
mv book/$po_lang/html book/html/$po_lang
7067
echo "::endgroup::"
7168
done

devenv.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@
7474
},
7575
"nixpkgs": {
7676
"locked": {
77-
"lastModified": 1749903597,
77+
"lastModified": 1756819007,
7878
"owner": "NixOS",
7979
"repo": "nixpkgs",
80-
"rev": "41da1e3ea8e23e094e5e3eeb1e6b830468a7399e",
80+
"rev": "aaff8c16d7fc04991cac6245bee1baa31f72b1e1",
8181
"type": "github"
8282
},
8383
"original": {

src/share/rsdk/infra-package/.github/workflows/docs.yaml.jsonnet

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,34 +49,25 @@ function(
4949
},
5050
},
5151
{
52-
name: "Setup mdBook",
53-
uses: "peaceiris/actions-mdbook@v2",
52+
name: "Install Nix",
53+
uses: "cachix/install-nix-action@v26",
54+
},
55+
{
56+
name: "Use cachix",
57+
uses: "cachix/cachix-action@v14",
5458
with: {
55-
"mdbook-version": "latest",
59+
name: devenv,
5660
},
5761
},
5862
{
59-
name: "Install mdbook plugins",
60-
shell: "bash",
61-
run: |||
62-
plugins=(
63-
mdbook-admonish
64-
mdbook-linkcheck
65-
mdbook-i18n-helpers
66-
mdbook-toc
67-
mdbook-cmdrun
68-
)
69-
for i in "${plugins[@]}"
70-
do
71-
cargo install "$i"
72-
done
73-
|||,
63+
name: "Install devenv.sh",
64+
run: "nix profile install nixpkgs#devenv",
7465
},
7566
{
7667
name: "Build",
7768
shell: "bash",
7869
run: |||
79-
mdbook build
70+
devenv shell mdbook build
8071
for po_lang in zh-CN
8172
do
8273
POT_CREATION_DATE=$(grep --max-count 1 '^"POT-Creation-Date:' po/$po_lang.po | sed -E 's/".*: (.*)\\n"/\1/')
@@ -92,7 +83,7 @@ function(
9283
MDBOOK_BOOK__LANGUAGE=$po_lang \
9384
MDBOOK_OUTPUT__HTML__SITE_URL=/%(target)s/$po_lang/ \
9485
MDBOOK_OUTPUT__HTML__REDIRECT='{}' \
95-
mdbook build -d book/$po_lang
86+
devenv shell mdbook build -d book/$po_lang
9687
mv book/$po_lang/html book/html/$po_lang
9788
echo "::endgroup::"
9889
done

src/share/rsdk/infra-package/devenv.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,16 @@
7474
},
7575
"nixpkgs": {
7676
"locked": {
77-
"lastModified": 1746807397,
78-
"owner": "cachix",
79-
"repo": "devenv-nixpkgs",
80-
"rev": "c5208b594838ea8e6cca5997fbf784b7cca1ca90",
77+
"lastModified": 1756819007,
78+
"owner": "NixOS",
79+
"repo": "nixpkgs",
80+
"rev": "aaff8c16d7fc04991cac6245bee1baa31f72b1e1",
8181
"type": "github"
8282
},
8383
"original": {
84-
"owner": "cachix",
85-
"ref": "rolling",
86-
"repo": "devenv-nixpkgs",
84+
"owner": "NixOS",
85+
"ref": "nixpkgs-unstable",
86+
"repo": "nixpkgs",
8787
"type": "github"
8888
}
8989
},

0 commit comments

Comments
 (0)