Files
stack/.gitea/workflows/build-tutorial.yml
T

54 lines
2.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Build Tutorial
# 主仓库 gitea.idealjs.com/idealjs/stack 的 CI:
# 打包新教程站(apps/tutorial,Vite MPA,含设计系统四册页)
# 环境约束:runner 为 host 模式 Alpine——无 docker、无 node。
# 方案:从自家 release 资产装便携 node(musl,提取自 node:24-alpine 镜像,
# 镜像本体在阿里云 registry.cn-hangzhou.aliyuncs.com/idealjs/node:24.14.0-alpine)
# 写入 GITHUB_PATH,之后 JS 动作(checkout/upload-artifact)与 yarn 全部可用。
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
env:
# musl 构建托管在自家 release 资产(tag ci-node-v20.19.5-musl)——runner 同机房拉取快;
# 原始来源 unofficial-builds(npmmirror 无 musl)
NODE_DIST: https://gitea.idealjs.com/attachments/edad7a7e-3b3d-4d1b-9551-1a978fdf95d1
YARN_NPM_REGISTRY_SERVER: https://registry.npmmirror.com
jobs:
build:
name: Build @stack/tutorial
runs-on: ubuntu-latest
steps:
- name: Install portable node (host 无 node,无 docker)
run: |
wget -q "$NODE_DIST" -O /tmp/node.tar.xz
mkdir -p "$RUNNER_TEMP/node"
tar -xJf /tmp/node.tar.xz -C "$RUNNER_TEMP/node" --strip-components=1
echo "$RUNNER_TEMP/node/bin" >> "$GITHUB_PATH"
# unofficial musl 构建仍动态依赖 libstdc++/libgcc——bundle 自带,指给它
echo "LD_LIBRARY_PATH=$RUNNER_TEMP/node/lib" >> "$GITHUB_ENV"
export LD_LIBRARY_PATH="$RUNNER_TEMP/node/lib"
"$RUNNER_TEMP/node/bin/node" -v
- uses: actions/checkout@v4
- name: Enable corepack (yarn 4 via packageManager)
run: corepack enable && yarn -v
- name: Install dependencies
run: yarn install --immutable
- name: Build tutorial (Vite MPA 七页 + 设计系统四册)
run: yarn workspace @stack/tutorial build
- name: Upload dist artifact
uses: actions/upload-artifact@v4
with:
name: tutorial-dist
path: apps/tutorial/dist/
retention-days: 14