Skip to content

Commit 314469c

Browse files
authored
chore: use mise to maintain toolcahin (#191)
1 parent 9a1ea27 commit 314469c

12 files changed

Lines changed: 463 additions & 1026 deletions

.github/workflows/build.yml

Lines changed: 46 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ concurrency:
1616

1717
env:
1818
CARGO_TERM_COLOR: always
19-
CEF_VERSION: "147.0.14"
2019
CEF_PATH: ${{ github.workspace }}/cef
2120
SCCACHE_GHA_ENABLED: "true"
22-
RUSTC_WRAPPER: "sccache"
2321

2422
jobs:
2523
build-macos:
@@ -34,10 +32,13 @@ jobs:
3432
- name: Checkout repository
3533
uses: actions/checkout@v4
3634

37-
- name: Install Rust toolchain
38-
uses: dtolnay/rust-toolchain@nightly
35+
- name: Setup mise toolchain
36+
uses: jdx/mise-action@v2
3937
with:
40-
targets: aarch64-apple-darwin,x86_64-apple-darwin
38+
cache: true
39+
40+
- name: Install Rust targets
41+
run: rustup target add aarch64-apple-darwin x86_64-apple-darwin
4142

4243
- name: Setup sccache
4344
uses: mozilla-actions/sccache-action@v0.0.9
@@ -49,31 +50,20 @@ jobs:
4950
~/.cargo/registry
5051
~/.cargo/git
5152
target
52-
key: macos-universal-cargo-${{ hashFiles('**/Cargo.lock') }}
53+
key: macos-universal-cargo-${{ hashFiles('**/Cargo.lock', 'mise.toml') }}
5354
restore-keys: |
5455
macos-universal-cargo-
5556
56-
- name: Cache cargo bin
57-
uses: actions/cache@v4
58-
id: cargo-bin-cache
59-
with:
60-
path: ~/.cargo/bin
61-
key: cargo-bin-export-cef-dir-macos-v1
62-
63-
- name: Install CEF export tool
64-
if: steps.cargo-bin-cache.outputs.cache-hit != 'true'
65-
run: cargo install export-cef-dir
66-
6757
- name: Cache CEF binaries (ARM64)
6858
uses: actions/cache@v4
6959
id: cef-cache-arm64
7060
with:
7161
path: ${{ env.CEF_PATH_ARM64 }}
72-
key: cef-${{ env.CEF_VERSION }}-macos-arm64
62+
key: cef-${{ hashFiles('mise.toml') }}-macos-arm64
7363

7464
- name: Download CEF binaries (ARM64)
7565
if: steps.cef-cache-arm64.outputs.cache-hit != 'true'
76-
run: export-cef-dir --version "${{ env.CEF_VERSION }}" --force --target aarch64-apple-darwin ${{ env.CEF_PATH_ARM64 }}
66+
run: mise exec -- sh -c 'export-cef-dir --version "$CEF_VERSION" --force --target aarch64-apple-darwin "$CEF_PATH_ARM64"'
7767

7868
- name: Copy CEF binaries (ARM64)
7969
run: |
@@ -85,14 +75,16 @@ jobs:
8575
id: cef-cache-x64
8676
with:
8777
path: ${{ env.CEF_PATH_X64 }}
88-
key: cef-${{ env.CEF_VERSION }}-macos-x64
78+
key: cef-${{ hashFiles('mise.toml') }}-macos-x64
8979

9080
- name: Download CEF binaries (X64)
9181
if: steps.cef-cache-x64.outputs.cache-hit != 'true'
92-
run: export-cef-dir --version "${{ env.CEF_VERSION }}" --force --target x86_64-apple-darwin ${{ env.CEF_PATH_X64 }}
82+
run: mise exec -- sh -c 'export-cef-dir --version "$CEF_VERSION" --force --target x86_64-apple-darwin "$CEF_PATH_X64"'
9383

9484
- name: Build and bundle for macOS (Universal)
95-
run: cargo xtask bundle --release
85+
env:
86+
RUSTC_WRAPPER: sccache
87+
run: mise exec -- cargo xtask bundle --release
9688

9789
- name: Prepare artifacts
9890
run: |
@@ -115,10 +107,13 @@ jobs:
115107
- name: Checkout repository
116108
uses: actions/checkout@v4
117109

118-
- name: Install Rust toolchain
119-
uses: dtolnay/rust-toolchain@nightly
110+
- name: Setup mise toolchain
111+
uses: jdx/mise-action@v2
120112
with:
121-
targets: x86_64-pc-windows-msvc
113+
cache: true
114+
115+
- name: Install Rust target
116+
run: rustup target add x86_64-pc-windows-msvc
122117

123118
- name: Setup sccache
124119
uses: mozilla-actions/sccache-action@v0.0.9
@@ -130,34 +125,26 @@ jobs:
130125
~/.cargo/registry
131126
~/.cargo/git
132127
target
133-
key: windows-x86_64-cargo-${{ hashFiles('**/Cargo.lock') }}
128+
key: windows-x86_64-cargo-${{ hashFiles('**/Cargo.lock', 'mise.toml') }}
134129
restore-keys: |
135130
windows-x86_64-cargo-
136131
137-
- name: Cache cargo bin
138-
uses: actions/cache@v4
139-
id: cargo-bin-cache
140-
with:
141-
path: ~/.cargo/bin
142-
key: cargo-bin-export-cef-dir-windows-v1
143-
144-
- name: Install CEF export tool
145-
if: steps.cargo-bin-cache.outputs.cache-hit != 'true'
146-
run: cargo install export-cef-dir
147-
148132
- name: Cache CEF binaries
149133
uses: actions/cache@v4
150134
id: cef-cache
151135
with:
152136
path: ${{ env.CEF_PATH }}
153-
key: cef-${{ env.CEF_VERSION }}-windows-x64
137+
key: cef-${{ hashFiles('mise.toml') }}-windows-x64
154138

155139
- name: Download CEF binaries
156140
if: steps.cef-cache.outputs.cache-hit != 'true'
157-
run: export-cef-dir --version "${{ env.CEF_VERSION }}" --force ${{ env.CEF_PATH }}
141+
shell: pwsh
142+
run: mise exec -- pwsh -NoProfile -Command 'export-cef-dir --version $env:CEF_VERSION --force $env:CEF_PATH'
158143

159144
- name: Build and bundle for Windows
160-
run: cargo xtask bundle --release
145+
env:
146+
RUSTC_WRAPPER: sccache
147+
run: mise exec -- cargo xtask bundle --release
161148

162149
- name: Prepare artifacts
163150
shell: pwsh
@@ -220,10 +207,13 @@ jobs:
220207
libpango1.0-dev \
221208
libasound2-dev
222209
223-
- name: Install Rust toolchain
224-
uses: dtolnay/rust-toolchain@nightly
210+
- name: Setup mise toolchain
211+
uses: jdx/mise-action@v2
225212
with:
226-
targets: x86_64-unknown-linux-gnu
213+
cache: true
214+
215+
- name: Install Rust target
216+
run: rustup target add x86_64-unknown-linux-gnu
227217

228218
- name: Setup sccache
229219
uses: mozilla-actions/sccache-action@v0.0.9
@@ -235,34 +225,25 @@ jobs:
235225
~/.cargo/registry
236226
~/.cargo/git
237227
target
238-
key: linux-x86_64-cargo-${{ hashFiles('**/Cargo.lock') }}
228+
key: linux-x86_64-cargo-${{ hashFiles('**/Cargo.lock', 'mise.toml') }}
239229
restore-keys: |
240230
linux-x86_64-cargo-
241231
242-
- name: Cache cargo bin
243-
uses: actions/cache@v4
244-
id: cargo-bin-cache
245-
with:
246-
path: ~/.cargo/bin
247-
key: cargo-bin-export-cef-dir-linux-v1
248-
249-
- name: Install CEF export tool
250-
if: steps.cargo-bin-cache.outputs.cache-hit != 'true'
251-
run: cargo install export-cef-dir
252-
253232
- name: Cache CEF binaries
254233
uses: actions/cache@v4
255234
id: cef-cache
256235
with:
257236
path: ${{ env.CEF_PATH }}
258-
key: cef-${{ env.CEF_VERSION }}-linux-x64
237+
key: cef-${{ hashFiles('mise.toml') }}-linux-x64
259238

260239
- name: Download CEF binaries
261240
if: steps.cef-cache.outputs.cache-hit != 'true'
262-
run: export-cef-dir --version "${{ env.CEF_VERSION }}" --force ${{ env.CEF_PATH }}
241+
run: mise exec -- sh -c 'export-cef-dir --version "$CEF_VERSION" --force "$CEF_PATH"'
263242

264243
- name: Build and bundle for Linux
265-
run: cargo xtask bundle --release
244+
env:
245+
RUSTC_WRAPPER: sccache
246+
run: mise exec -- cargo xtask bundle --release
266247

267248
- name: Prepare artifacts
268249
run: |
@@ -300,8 +281,10 @@ jobs:
300281
- name: Checkout repository
301282
uses: actions/checkout@v4
302283

303-
- name: Install Rust toolchain
304-
uses: dtolnay/rust-toolchain@nightly
284+
- name: Setup mise toolchain
285+
uses: jdx/mise-action@v2
286+
with:
287+
cache: true
305288

306289
- name: Setup sccache
307290
uses: mozilla-actions/sccache-action@v0.0.9
@@ -312,9 +295,11 @@ jobs:
312295
path: artifacts
313296

314297
- name: Pack Godot addon
298+
env:
299+
RUSTC_WRAPPER: sccache
315300
run: |
316301
# Use staging directory to avoid deleting source addon files
317-
cargo xtask pack \
302+
mise exec -- cargo xtask pack \
318303
--artifacts artifacts \
319304
--output dist/addons/godot_cef \
320305
--addon-src addons/godot_cef

.github/workflows/deploy-docs.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ on:
66
paths:
77
- 'docs/**'
88
- 'package.json'
9+
- 'pnpm-lock.yaml'
10+
- 'mise.toml'
911
- '.github/workflows/deploy-docs.yml'
1012
pull_request:
1113
branches: [main]
1214
paths:
1315
- 'docs/**'
1416
- 'package.json'
17+
- 'pnpm-lock.yaml'
18+
- 'mise.toml'
1519
- '.github/workflows/deploy-docs.yml'
1620
workflow_dispatch:
1721

@@ -33,19 +37,16 @@ jobs:
3337
with:
3438
fetch-depth: 0
3539

36-
- name: Setup pnpm
37-
uses: pnpm/action-setup@v4
38-
39-
- name: Setup Node.js
40-
uses: actions/setup-node@v6
40+
- name: Setup mise toolchain
41+
uses: jdx/mise-action@v2
4142
with:
42-
node-version: '24'
43+
cache: true
4344

4445
- name: Install dependencies
45-
run: pnpm install
46+
run: mise exec -- pnpm install --frozen-lockfile
4647

4748
- name: Build documentation
48-
run: pnpm docs:build
49+
run: mise exec -- pnpm docs:build
4950

5051
- name: Add .nojekyll file
5152
run: touch docs/.vitepress/dist/.nojekyll

0 commit comments

Comments
 (0)