Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/ISSUE_TEMPLATE/release_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: 发布请求
about: 请求创建新版本发布
title: '🚀 Release v[版本号]'
labels: ['release', 'enhancement']
assignees: ''

---

## 发布信息

**版本号**: (例如: v2.1.0)

**发布类型**:
- [ ] 主要版本 (Major) - 包含不兼容的 API 更改
- [ ] 次要版本 (Minor) - 向下兼容的新功能
- [ ] 修补版本 (Patch) - 向下兼容的错误修复

## 更新内容

### 新功能
- [ ] 功能1
- [ ] 功能2

### 改进
- [ ] 改进1
- [ ] 改进2

### 错误修复
- [ ] 修复1
- [ ] 修复2

### 破坏性更改 (仅限主要版本)
- [ ] 更改1
- [ ] 更改2

## 发布检查清单

- [ ] 代码已合并到主分支
- [ ] 所有测试通过
- [ ] 文档已更新
- [ ] 版本号已确定
- [ ] 发布说明已准备

## 其他说明

[其他需要说明的内容]

---

**发布流程提醒**:
1. 创建 Git 标签: `git tag v[版本号] && git push origin v[版本号]`
2. 或使用 GitHub Releases 界面创建发布
3. GitHub Actions 将自动构建并发布

详细说明请参考 [流水线使用指南](https://github.com/cmcxn/auto-deploy-tool/blob/main/docs/PIPELINE_GUIDE.md)。
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Test

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Restore dependencies
run: dotnet restore AutoDeployTool.csproj

- name: Build application
run: dotnet build AutoDeployTool.csproj --configuration Release --no-restore

- name: Run tests (if any)
run: dotnet test AutoDeployTool.csproj --configuration Release --no-build --verbosity normal || echo "No tests found, skipping test execution"
continue-on-error: true
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and Release

on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag version (e.g., v1.0.0)'
required: true
type: string

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Restore dependencies
run: dotnet restore AutoDeployTool.csproj

- name: Build application
run: dotnet build AutoDeployTool.csproj --configuration Release --no-restore

- name: Publish application
run: dotnet publish AutoDeployTool.csproj --configuration Release --no-build --output ./publish

- name: Create release package
run: |
Compress-Archive -Path ./publish/* -DestinationPath AutoDeployTool-${{ github.ref_name }}.zip
shell: pwsh

- name: Create Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
name: AutoDeployTool ${{ github.ref_name }}
body: |
## AutoDeployTool ${{ github.ref_name }}

### 下载和安装
1. 从下方下载 `AutoDeployTool-${{ github.ref_name }}.zip`
2. 解压到任意目录
3. 运行 `AutoDeployTool.exe`

### 系统要求
- Windows 10/Windows Server 2016 或更高版本
- .NET 8.0 Runtime

### 更新内容
请查看 [README.md](https://github.com/cmcxn/auto-deploy-tool/blob/main/README.md) 了解完整功能说明。

---

**完整版本历史和功能说明请参考项目 README**
files: ./AutoDeployTool-${{ github.ref_name }}.zip
draft: false
prerelease: false
50 changes: 50 additions & 0 deletions Build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 本地构建和打包脚本
# Build and Package Script for AutoDeployTool

param(
[string]$Version = "local",
[switch]$Clean = $false
)

Write-Host "AutoDeployTool 本地构建脚本" -ForegroundColor Green
Write-Host "版本: $Version" -ForegroundColor Yellow

# 清理构建目录
if ($Clean) {
Write-Host "清理构建目录..." -ForegroundColor Yellow
if (Test-Path "bin") { Remove-Item "bin" -Recurse -Force }
if (Test-Path "obj") { Remove-Item "obj" -Recurse -Force }
if (Test-Path "publish") { Remove-Item "publish" -Recurse -Force }
}

try {
# 恢复依赖项
Write-Host "恢复 NuGet 包..." -ForegroundColor Yellow
dotnet restore AutoDeployTool.csproj
if ($LASTEXITCODE -ne 0) { throw "依赖项恢复失败" }

# 构建项目
Write-Host "构建项目..." -ForegroundColor Yellow
dotnet build AutoDeployTool.csproj --configuration Release --no-restore
if ($LASTEXITCODE -ne 0) { throw "构建失败" }

# 发布项目
Write-Host "发布项目..." -ForegroundColor Yellow
dotnet publish AutoDeployTool.csproj --configuration Release --no-build --output ./publish
if ($LASTEXITCODE -ne 0) { throw "发布失败" }

# 创建发布包
$zipName = "AutoDeployTool-$Version.zip"
Write-Host "创建发布包: $zipName" -ForegroundColor Yellow

if (Test-Path $zipName) { Remove-Item $zipName -Force }
Compress-Archive -Path ./publish/* -DestinationPath $zipName

Write-Host "构建完成!" -ForegroundColor Green
Write-Host "发布包位置: $zipName" -ForegroundColor Green
Write-Host "发布目录: ./publish" -ForegroundColor Green

} catch {
Write-Host "构建失败: $_" -ForegroundColor Red
exit 1
}
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@

## 安装

1. 从Releases页面下载最新版本
1. 从 [Releases 页面](https://github.com/cmcxn/auto-deploy-tool/releases) 下载最新版本
2. 解压到任意目录
3. 运行`AutoDeployTool.exe`
3. 运行 `AutoDeployTool.exe`

> 📦 **自动化发布**: 每次创建新的 Git 标签时,都会自动构建并发布新版本到 GitHub Releases。详情请参考 [发布指南](RELEASE.md) 和 [流水线使用指南](docs/PIPELINE_GUIDE.md)。

## 快速开始

Expand Down Expand Up @@ -122,6 +124,16 @@

欢迎提交Issue和Pull Request来改进这个工具。

## CI/CD 流水线

本项目配置了完整的 GitHub Actions CI/CD 流水线:

- **持续集成**: 每次 PR 和推送到主分支时自动构建验证
- **自动发布**: 创建 Git 标签时自动构建并发布到 GitHub Releases
- **多种触发方式**: 支持标签推送、GitHub 界面和手动触发

详细使用说明请参考 [流水线使用指南](docs/PIPELINE_GUIDE.md)。

## 许可证

此项目使用MIT许可证。
Expand Down
55 changes: 55 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 发布指南

## 自动发布流程

这个项目配置了 GitHub Actions 来自动构建和发布 AutoDeployTool。

### 创建新版本发布

1. **创建新的版本标签**:
```bash
git tag v2.1.0
git push origin v2.1.0
```

2. **或者通过 GitHub 网页界面**:
- 转到 GitHub 仓库页面
- 点击 "Releases" 标签
- 点击 "Create a new release"
- 输入标签版本(如 `v2.1.0`)
- 添加发布说明
- 点击 "Publish release"

### 手动触发构建

你也可以通过 GitHub Actions 页面手动触发构建:

1. 转到 Actions 标签
2. 选择 "Build and Release" 工作流
3. 点击 "Run workflow"
4. 输入要发布的标签版本

### 构建产物

每次发布都会自动生成:
- `AutoDeployTool-{version}.zip` - 包含完整的可执行文件和依赖项
- 自动创建的 GitHub Release 页面
- 中文发布说明和下载指南

### 版本命名规范

建议使用语义化版本控制:
- `v1.0.0` - 主要版本更新
- `v1.1.0` - 功能更新
- `v1.0.1` - 错误修复

### 系统要求

构建需要:
- Windows 运行器(Windows Server 2022)
- .NET 8.0 SDK
- GitHub Actions 权限

发布的应用程序需要:
- Windows 10 或更高版本
- .NET 8.0 Runtime(如果未包含在发布包中)
Loading
Loading