- 根因:'Run tests (coverage gate: lines >= 95%)' 未加引号, plain scalar 中 'coverage gate:' 的冒号被解析为嵌套 mapping, 整个 workflow 解析失败 → push 不触发(v0.5.0 引入) - 修复:name 加单引号;runs-on 恢复 debian-latest(runner 实际标签) - publish.yml 同步恢复 runs-on - 验证:两个文件 YAML 解析全部通过
37 lines
753 B
YAML
37 lines
753 B
YAML
name: Publish
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*']
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: debian-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Use Node.js 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
registry-url: https://git.metona.cn/api/packages/MetonaTeam/npm/
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Type check
|
|
run: npm run typecheck
|
|
|
|
- name: Run tests
|
|
run: npx jest --forceExit --maxWorkers=2 --no-cache --coverage
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Publish to Gitea npm registry
|
|
run: npm publish --access public
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
|