Go to file
qxa 8ea0f4394b 1 2025-11-08 15:14:15 +08:00
.gitattributes 6.0 2025-03-25 18:34:59 +08:00
.gitignore 优化文档 2025-11-06 13:56:38 +08:00
README.md 修复错误 2025-11-06 14:24:13 +08:00
action.yaml 1 2025-11-08 15:14:15 +08:00

README.md

ASP.NET 编译插件

这是一个用于 Gitea Actions 的 ASP.NET 项目编译插件,可以帮助您自动化编译、构建和发布 ASP.NET 项目。

功能特性

  • 支持自定义项目名称
  • 可配置构建配置Debug/Release
  • 支持目标运行时和操作系统设置
  • 提供NuGet包缓存选项
  • 可选的代码混淆功能使用Obfuscar

使用方法

在您的 GitHub Actions 工作流文件中添加以下步骤:

- name: 编译ASP.NET项目
  uses: actions/aspnet@6.0
  with:
    project_name: YourProjectName
    configuration: Release
    publish: publish

输入参数

参数名 描述 是否必需 默认值
project_name 要编译的项目名称
configuration 发布所对应的配置 Release
runtime 要发布的目标运行时
os 目标操作系统
publish 输出目录 publish
nuget_dir NuGet包还原地址 /opt/hostedtoolcache/.nuget/packages

示例

基本编译

- name: 编译ASP.NET项目
  uses: actions/aspnet@6.0
  with:
    project_name: MyWebApp

指定运行时和操作系统

- name: 编译ASP.NET项目
  uses: actions/aspnet@6.0
  with:
    project_name: MyWebApp
    configuration: Release
    runtime: win-x64
    os: win

使用代码混淆

确保项目中存在 obfuscar.xml 配置文件,插件会自动检测并执行混淆:

- name: 编译并混淆ASP.NET项目
  uses: actions/aspnet@6.0
  with:
    project_name: MyWebApp