From 94319d3411e3af52f1949df4de52ac166fa5d810 Mon Sep 17 00:00:00 2001 From: xfy Date: Mon, 15 Jun 2026 13:22:29 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E5=9B=9E=E9=80=80=20composite=20action?= =?UTF-8?q?=EF=BC=8C=E4=BB=85=E4=BF=9D=E7=95=99=20Tailwind=20CLI=20?= =?UTF-8?q?=E5=8C=85=E5=90=8D=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gitea act_runner 对本地 composite action(uses: ./...)支持不稳定, 报 'failed to read action.yml ... file does not exist'。回退为内联 步骤,仅保留 @tailwindcss/cli 包名修正(v4 将 CLI 拆为独立包)。 --- .gitea/actions/setup/action.yml | 49 ---------------------- .gitea/workflows/ci.yaml | 73 ++++++++++++++++++++++++++++++++- 2 files changed, 71 insertions(+), 51 deletions(-) delete mode 100644 .gitea/actions/setup/action.yml diff --git a/.gitea/actions/setup/action.yml b/.gitea/actions/setup/action.yml deleted file mode 100644 index 6177467..0000000 --- a/.gitea/actions/setup/action.yml +++ /dev/null @@ -1,49 +0,0 @@ -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 diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 5fdf81a..69dfb7e 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -14,7 +14,40 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: ./.gitea/actions/setup + - name: Checkout + 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/cli - name: Check formatting run: cargo fmt -- --check @@ -31,8 +64,44 @@ jobs: build: runs-on: ubuntu-latest 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: - - uses: ./.gitea/actions/setup + - name: Checkout + 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/cli - name: Build release run: make build