test_build.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: 【测试】构建字体
  2. on:
  3. workflow_dispatch:
  4. # push:
  5. # branches:
  6. # - master
  7. jobs:
  8. test-build:
  9. runs-on: ubuntu-latest
  10. permissions:
  11. contents: write
  12. pages: write
  13. id-token: write
  14. name: 【测试】构建字体
  15. steps:
  16. - name: 检出代码
  17. uses: actions/checkout@v4
  18. - name: 配置环境
  19. run: |
  20. # 安装 Python 依赖
  21. python3 -m pip install --upgrade pip
  22. pip3 install -r requirements.txt
  23. # 安装构建依赖
  24. sudo apt-get update
  25. sudo apt-get install -y build-essential wget tar gzip
  26. - name: 编译字体
  27. run: |
  28. # 运行构建脚本
  29. bash build.bash
  30. # 验证输出文件
  31. if [ ! -f "output/xibo.psfu.gz" ]; then
  32. echo "错误:字体文件生成失败"
  33. exit 1
  34. fi
  35. # 显示文件信息
  36. ls -la output/xibo.psfu.gz
  37. - name: Upload artifact
  38. if: (cancelled() || failure() || success())
  39. uses: actions/upload-artifact@v4
  40. with:
  41. path: output/*
  42. compression-level: 9 # maximum compression
  43. retention-days: 5