aspnet/README.md

69 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ASP.NET 编译插件
这是一个用于 Gitea Actions 的 ASP.NET 项目编译插件,可以帮助您自动化编译、构建和发布 ASP.NET 项目。
## 功能特性
- 支持自定义项目名称
- 可配置构建配置Debug/Release
- 支持目标运行时和操作系统设置
- 提供NuGet包缓存选项
- 可选的代码混淆功能使用Obfuscar
## 使用方法
在您的 GitHub Actions 工作流文件中添加以下步骤:
```yaml
- 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 |
## 示例
### 基本编译
```yaml
- name: 编译ASP.NET项目
uses: actions/aspnet@6.0
with:
project_name: MyWebApp
```
### 指定运行时和操作系统
```yaml
- name: 编译ASP.NET项目
uses: actions/aspnet@6.0
with:
project_name: MyWebApp
configuration: Release
runtime: win-x64
os: win
```
### 使用代码混淆
确保项目中存在 `obfuscar.xml` 配置文件,插件会自动检测并执行混淆:
```yaml
- name: 编译并混淆ASP.NET项目
uses: actions/aspnet@6.0
with:
project_name: MyWebApp
```