ci: 修正 Tailwind CLI 包名并收敛重复的环境准备步骤
Tailwind v4 将 CLI 拆为独立包 @tailwindcss/cli,核心包 tailwindcss 不再注册 bin,导致 npx tailwindcss 报 "could not determine executable to run"。CI 改为安装 @tailwindcss/cli。 同时将 check 与 build 两个 job 重复的 checkout、镜像、Rust/Node/dx/ tailwind 安装步骤抽到 .gitea/actions/setup 复合 action,顶层 env 统一管理 Rust 镜像配置。AGENTS.md 同步说明 v4 拆包这一坑。
This commit is contained in:
parent
a2ccc3da1a
commit
76ad4ec8fb
49
.gitea/actions/setup/action.yml
Normal file
49
.gitea/actions/setup/action.yml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
name: Setup toolchain
|
||||||
|
description: Checkout + configure Cargo mirror + install Rust, Node, wasm target, Dioxus CLI and Tailwind CSS CLI
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
git init
|
||||||
|
git remote add origin https://git.rua.plus/${{ github.repository }}.git
|
||||||
|
git fetch --depth 1 origin ${{ github.sha }}
|
||||||
|
git checkout ${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Configure Cargo mirror
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p "$HOME/.cargo"
|
||||||
|
printf '%s\n' '[source.crates-io]' "replace-with = 'rsproxy'" '' "[source.rsproxy]" 'registry = "sparse+https://rsproxy.cn/index/"' > "$HOME/.cargo/config.toml"
|
||||||
|
|
||||||
|
# Rust mirror env (RUSTUP_UPDATE_ROOT / RUSTUP_DIST_SERVER) is inherited
|
||||||
|
# from the top-level workflow env.
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
for i in 1 2 3; do
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable && break
|
||||||
|
echo "rustup install attempt $i failed, retrying..."
|
||||||
|
sleep 15
|
||||||
|
done
|
||||||
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Install Node.js
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y nodejs npm
|
||||||
|
|
||||||
|
- name: Install Rust target
|
||||||
|
shell: bash
|
||||||
|
run: rustup target add wasm32-unknown-unknown
|
||||||
|
|
||||||
|
- name: Install Dioxus CLI
|
||||||
|
shell: bash
|
||||||
|
run: cargo install dioxus-cli --locked
|
||||||
|
|
||||||
|
- name: Install Tailwind CSS CLI
|
||||||
|
shell: bash
|
||||||
|
run: npm install -g @tailwindcss/cli
|
||||||
@ -14,40 +14,7 @@ jobs:
|
|||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: ./.gitea/actions/setup
|
||||||
run: |
|
|
||||||
git init
|
|
||||||
git remote add origin https://git.rua.plus/${{ github.repository }}.git
|
|
||||||
git fetch --depth 1 origin ${{ github.sha }}
|
|
||||||
git checkout ${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Configure Cargo mirror
|
|
||||||
run: |
|
|
||||||
mkdir -p "$HOME/.cargo"
|
|
||||||
printf '%s\n' '[source.crates-io]' "replace-with = 'rsproxy'" '' "[source.rsproxy]" 'registry = "sparse+https://rsproxy.cn/index/"' > "$HOME/.cargo/config.toml"
|
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
run: |
|
|
||||||
for i in 1 2 3; do
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable && break
|
|
||||||
echo "rustup install attempt $i failed, retrying..."
|
|
||||||
sleep 15
|
|
||||||
done
|
|
||||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y nodejs npm
|
|
||||||
|
|
||||||
- name: Install Rust target
|
|
||||||
run: rustup target add wasm32-unknown-unknown
|
|
||||||
|
|
||||||
- name: Install Dioxus CLI
|
|
||||||
run: cargo install dioxus-cli --locked
|
|
||||||
|
|
||||||
- name: Install Tailwind CSS CLI
|
|
||||||
run: npm install -g tailwindcss
|
|
||||||
|
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
run: cargo fmt -- --check
|
run: cargo fmt -- --check
|
||||||
@ -64,44 +31,8 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: check
|
needs: check
|
||||||
env:
|
|
||||||
RUSTUP_UPDATE_ROOT: https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup
|
|
||||||
RUSTUP_DIST_SERVER: https://mirrors.tuna.tsinghua.edu.cn/rustup
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: ./.gitea/actions/setup
|
||||||
run: |
|
|
||||||
git init
|
|
||||||
git remote add origin https://git.rua.plus/${{ github.repository }}.git
|
|
||||||
git fetch --depth 1 origin ${{ github.sha }}
|
|
||||||
git checkout ${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Configure Cargo mirror
|
|
||||||
run: |
|
|
||||||
mkdir -p "$HOME/.cargo"
|
|
||||||
printf '%s\n' '[source.crates-io]' "replace-with = 'rsproxy'" '' "[source.rsproxy]" 'registry = "sparse+https://rsproxy.cn/index/"' > "$HOME/.cargo/config.toml"
|
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
run: |
|
|
||||||
for i in 1 2 3; do
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable && break
|
|
||||||
echo "rustup install attempt $i failed, retrying..."
|
|
||||||
sleep 15
|
|
||||||
done
|
|
||||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y nodejs npm
|
|
||||||
|
|
||||||
- name: Install Rust target
|
|
||||||
run: rustup target add wasm32-unknown-unknown
|
|
||||||
|
|
||||||
- name: Install Dioxus CLI
|
|
||||||
run: cargo install dioxus-cli --locked
|
|
||||||
|
|
||||||
- name: Install Tailwind CSS CLI
|
|
||||||
run: npm install -g tailwindcss
|
|
||||||
|
|
||||||
- name: Build release
|
- name: Build release
|
||||||
run: make build
|
run: make build
|
||||||
|
|||||||
@ -18,7 +18,7 @@ make clean # cargo clean + rm public/style.css
|
|||||||
|
|
||||||
- Rust 1.95+ with `wasm32-unknown-unknown` target
|
- Rust 1.95+ with `wasm32-unknown-unknown` target
|
||||||
- `dx` CLI (`cargo install dioxus-cli`)
|
- `dx` CLI (`cargo install dioxus-cli`)
|
||||||
- `tailwindcss` CLI v4 (standalone binary)
|
- `tailwindcss` CLI v4 — install via `npm install -g @tailwindcss/cli` (v4 splits the CLI into its own package; the `tailwindcss` core package has no `bin`), or use the standalone binary
|
||||||
- PostgreSQL running locally
|
- PostgreSQL running locally
|
||||||
|
|
||||||
## Environment
|
## Environment
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user