-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (137 loc) · 5.81 KB
/
release.yml
File metadata and controls
162 lines (137 loc) · 5.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: 🚀 Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., v2.1.0)'
required: true
type: string
env:
SOLUTION_FILE: 'CalenderDemo2.sln'
PROJECT_FILE: 'CalenderDemo2/CalenderDemo2.csproj'
jobs:
create-release:
name: 📦 Create Release
runs-on: windows-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release_id: ${{ steps.create_release.outputs.id }}
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🏷️ Get version
id: get_version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
- name: 🔧 Setup MSBuild
uses: microsoft/setup-msbuild@v1.3
with:
msbuild-architecture: 'x64'
- name: 📦 Restore NuGet packages
run: |
nuget restore ${{ env.SOLUTION_FILE }}
- name: 🏗️ Build release
run: |
msbuild ${{ env.SOLUTION_FILE }} /p:Configuration=Release /p:Platform="Any CPU" /p:GenerateDocumentationFile=true /p:RestorePackages=false
- name: 📚 Generate changelog
id: changelog
run: |
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
echo "## 🎉 Release ${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "### ✨ New Features" >> $GITHUB_OUTPUT
echo "- Enhanced calendar task planning interface" >> $GITHUB_OUTPUT
echo "- Improved FullCalendar integration" >> $GITHUB_OUTPUT
echo "- Professional UI/UX improvements" >> $GITHUB_OUTPUT
echo "- Enhanced drag & drop functionality" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "### 🐛 Bug Fixes" >> $GITHUB_OUTPUT
echo "- Fixed task creation and editing issues" >> $GITHUB_OUTPUT
echo "- Improved error handling and validation" >> $GITHUB_OUTPUT
echo "- Enhanced calendar performance" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "### 📚 Documentation" >> $GITHUB_OUTPUT
echo "- Complete API documentation" >> $GITHUB_OUTPUT
echo "- Professional README with examples" >> $GITHUB_OUTPUT
echo "- Installation and usage guides" >> $GITHUB_OUTPUT
echo "EOF"
- name: 📦 Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: 'CalenderTaskPlanner ${{ steps.get_version.outputs.VERSION }}'
body: ${{ steps.changelog.outputs.CHANGELOG }}
draft: false
prerelease: false
build-and-package:
name: 🏗️ Build and Package
runs-on: windows-latest
needs: create-release
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
- name: 🔧 Setup MSBuild
uses: microsoft/setup-msbuild@v1.3
with:
msbuild-architecture: 'x64'
- name: 📦 Restore NuGet packages
run: |
nuget restore ${{ env.SOLUTION_FILE }}
- name: 🏗️ Build release
run: |
msbuild ${{ env.SOLUTION_FILE }} /p:Configuration=Release /p:Platform="Any CPU" /p:GenerateDocumentationFile=true /p:RestorePackages=false
- name: 📦 Create ZIP package
run: |
$version = "${{ github.ref_name }}"
$zipName = "CalenderTaskPlanner-$version.zip"
# Ana proje dosyalarını kopyala
Copy-Item -Path "CalenderDemo2\bin\*" -Destination "release" -Recurse -Force
# Dokümantasyon dosyalarını kopyala
Copy-Item -Path "README.md" -Destination "release" -Force
Copy-Item -Path "CHANGELOG.md" -Destination "release" -Force
Copy-Item -Path "LICENSE" -Destination "release" -Force
Copy-Item -Path "API_DOCUMENTATION.md" -Destination "release" -Force
Copy-Item -Path "CONTRIBUTING.md" -Destination "release" -Force
# Examples klasörünü kopyala
Copy-Item -Path "Examples" -Destination "release\Examples" -Recurse -Force
# ZIP oluştur
Compress-Archive -Path "release\*" -DestinationPath $zipName -Force
echo "ZIP_NAME=$zipName" >> $env:GITHUB_OUTPUT
- name: 📦 Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ steps.create_zip.outputs.ZIP_NAME }}
asset_name: ${{ steps.create_zip.outputs.ZIP_NAME }}
asset_content_type: application/zip
notify:
name: 📢 Notify
runs-on: windows-latest
needs: [create-release, build-and-package]
if: always()
steps:
- name: 📢 Release notification
run: |
echo "Release ${{ github.ref_name }} has been created!"
echo "Download: https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}"
- name: 📊 Release summary
run: |
echo "## 🎉 Release Summary" >> $GITHUB_STEP_SUMMARY
echo "- **Version**: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
echo "- **Status**: ✅ Success" >> $GITHUB_STEP_SUMMARY
echo "- **Download**: [Release Page](https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }})" >> $GITHUB_STEP_SUMMARY
echo "- **Changelog**: [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md)" >> $GITHUB_STEP_SUMMARY