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