|
|
||
|---|---|---|
| .gitattributes | ||
| .gitignore | ||
| README.md | ||
| action.yaml | ||
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