name: Publish to PyPI on: push: tags: - "v*" jobs: build-and-publish: name: Build and publish to PyPI runs-on: ubuntu-latest environment: release permissions: id-token: write steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.13" # 构建前端 → web-ui/dist/,hatchling force-include 把它打进 wheel # 的 easy_tdx/web/dist/,让 pip install easy-tdx[web] 开箱即用 UI。 - uses: actions/setup-node@v4 with: node-version: "20" cache: "npm" cache-dependency-path: web-ui/package-lock.json - name: Build frontend run: | npm ci npm run build working-directory: web-ui - run: pip install build - run: python -m build - uses: pypa/gh-action-pypi-publish@release/v1 with: # sigstore provenance 签名认证。OIDC 服务(GitHub Actions → sigstore) # 偶发 503 overflow 故障时会让整个 publish 失败,故暂时关闭; # 待服务稳定后再改回 true。上传本身用 OIDC trusted publishing,无需 API token。 attestations: false