Skip to content

添加 dist/ 目录到 .gitignore #21

添加 dist/ 目录到 .gitignore

添加 dist/ 目录到 .gitignore #21

Workflow file for this run

name: 协调打包与发布

Check failure on line 1 in .github/workflows/nuget-publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/nuget-publish.yml

Invalid workflow file

(Line: 49, Col: 24): Unrecognized named-value: 'env'. Located at position 1 within expression: env.PACKAGE_VERSION
on:
push:
branches: [main, develop, master]
tags:
- "v*"
paths-ignore:
- 'docs/**'
- 'README.md'
- 'README_en.md'
- 'ROADMAP.md'
- 'CHANGELOG.md'
- '.github/workflows/docs-pages.yml'
pull_request:
branches: [main, develop, master]
paths-ignore:
- 'docs/**'
- 'README.md'
- 'README_en.md'
- 'ROADMAP.md'
- 'CHANGELOG.md'
- '.github/workflows/docs-pages.yml'
workflow_dispatch:
inputs:
version:
description: "版本号:支持 9.5.0.5 或 v9.5.0.5 格式"
required: true
default: "9.5.0.5"
publish_nuget:
description: "是否发布到 NuGet.org"
type: boolean
default: true
publish_github:
description: "是否发布到 GitHub Packages"
type: boolean
default: true
env:
# 版本来源:优先使用 workflow_dispatch 输入,其次使用 tag 名称。
# 注意:tag/输入值可能含有 'v' 前缀(如 v9.5.0.5),会在 prepare 步骤中去除。
PACKAGE_VERSION: ${{ github.event.inputs.version || github.ref_name }}
jobs:
prepare:
name: 调用准备阶段
uses: ./.github/workflows/prepare-release.yml
with:
package_version: ${{ env.PACKAGE_VERSION }}
permissions:
contents: read
# 1. 准备版本元数据与原生库制品
build-native:
name: 调用原生库构建阶段
needs: prepare
uses: ./.github/workflows/build-native.yml
permissions:
contents: read
# 2. 生成 NuGet 包制品
pack:
name: 调用 NuGet 打包阶段
needs: [prepare, build-native]
uses: ./.github/workflows/pack-nuget.yml
with:
package_version: ${{ needs.prepare.outputs.package_version }}
permissions:
contents: read
# 3. 仅在 tag 或手动发布时生成 demo 资产
build-demos:
name: 调用 Demo 构建阶段
needs: prepare
uses: ./.github/workflows/build-demos.yml
with:
package_version: ${{ needs.prepare.outputs.package_version }}
permissions:
contents: read
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
publish:
name: 调用发布阶段
needs: [prepare, pack, build-demos]
uses: ./.github/workflows/publish-release.yml
with:
release_tag: ${{ needs.prepare.outputs.release_tag }}
publish_nuget: ${{ startsWith(github.ref, 'refs/tags/') || github.event.inputs.publish_nuget == 'true' }}
publish_github: ${{ startsWith(github.ref, 'refs/tags/') || github.event.inputs.publish_github == 'true' }}
permissions:
contents: write
packages: write
if: |
startsWith(github.ref, 'refs/tags/') ||
(
github.event_name == 'workflow_dispatch' &&
(
github.event.inputs.publish_nuget == 'true' ||
github.event.inputs.publish_github == 'true'
)
)