88 workflow_dispatch :
99
1010jobs :
11- build :
11+ build-gui :
12+ name : Build GUI Application (Windows)
1213 runs-on : windows-latest
1314
15+ strategy :
16+ matrix :
17+ build-type : [self-contained, framework-dependent]
18+
1419 steps :
1520 - name : Checkout code
1621 uses : actions/checkout@v4
@@ -20,32 +25,53 @@ jobs:
2025 with :
2126 dotnet-version : ' 9.0.x'
2227
23- - name : Restore dependencies (win-x64)
24- run : dotnet restore GDeflateGUI/GDeflateGUI.csproj -- runtime win-x64
28+ - name : Restore dependencies
29+ run : dotnet restore GDeflateGUI/GDeflateGUI.csproj ${{ matrix.build-type == 'self-contained' && '-- runtime win-x64' || '' }}
2530
26- - name : Build application
31+ - name : Build GUI application
2732 run : dotnet build GDeflateGUI/GDeflateGUI.csproj --configuration Release --no-restore
2833
29- - name : Publish application
30- run : dotnet publish GDeflateGUI/GDeflateGUI.csproj --configuration Release --output ./publish --self-contained true --runtime win-x64
34+ - name : Publish GUI application (Self-contained)
35+ if : matrix.build-type == 'self-contained'
36+ run : dotnet publish GDeflateGUI/GDeflateGUI.csproj --configuration Release --output ./publish-gui --self-contained true --runtime win-x64
3137
32- - name : Upload executable artifact
33- uses : actions/upload-artifact@v4
34- with :
35- name : GDeflate-Compressor-Windows-x64
36- path : ./publish/
37- retention-days : 30
38-
39- - name : Create release build info
38+ - name : Publish GUI application (Framework-dependent)
39+ if : matrix.build-type == 'framework-dependent'
40+ run : dotnet publish GDeflateGUI/GDeflateGUI.csproj --configuration Release --output ./publish-gui --no-build --self-contained false
41+
42+ - name : Create build info
4043 run : |
41- echo "Build completed successfully!" > ./publish/BUILD_INFO.txt
42- echo "Build Date: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss UTC')" >> ./publish/BUILD_INFO.txt
43- echo "Commit SHA: ${{ github.sha }}" >> ./publish/BUILD_INFO.txt
44- echo "Branch: ${{ github.ref_name }}" >> ./publish/BUILD_INFO.txt
44+ echo "GDeflate GUI Application - ${{ matrix.build-type }}" > ./publish-gui/BUILD_INFO.txt
45+ echo "Build Date: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss UTC')" >> ./publish-gui/BUILD_INFO.txt
46+ echo "Commit SHA: ${{ github.sha }}" >> ./publish-gui/BUILD_INFO.txt
47+ echo "Branch: ${{ github.ref_name }}" >> ./publish-gui/BUILD_INFO.txt
48+ echo "Build Type: ${{ matrix.build-type }}" >> ./publish-gui/BUILD_INFO.txt
49+ echo "Platform: Windows x64" >> ./publish-gui/BUILD_INFO.txt
4550 shell : pwsh
4651
47- build-framework-dependent :
48- runs-on : windows-latest
52+ - name : Upload GUI artifact
53+ uses : actions/upload-artifact@v4
54+ with :
55+ name : GDeflate-GUI-Windows-${{ matrix.build-type }}
56+ path : ./publish-gui/
57+ retention-days : 30
58+
59+ build-console :
60+ name : Build Console Application
61+ runs-on : ${{ matrix.os }}
62+
63+ strategy :
64+ matrix :
65+ include :
66+ - os : windows-latest
67+ runtime : win-x64
68+ name : Windows
69+ - os : ubuntu-latest
70+ runtime : linux-x64
71+ name : Linux
72+ - os : macos-latest
73+ runtime : osx-x64
74+ name : macOS
4975
5076 steps :
5177 - name : Checkout code
@@ -57,17 +83,74 @@ jobs:
5783 dotnet-version : ' 9.0.x'
5884
5985 - name : Restore dependencies
60- run : dotnet restore GDeflateGUI/GDeflateGUI .csproj
86+ run : dotnet restore GDeflateConsole/GDeflateConsole .csproj --runtime ${{ matrix.runtime }}
6187
62- - name : Build application
63- run : dotnet build GDeflateGUI/GDeflateGUI.csproj --configuration Release --no-restore
88+ - name : Build console application
89+ run : dotnet build GDeflateConsole/GDeflateConsole.csproj --configuration Release --no-restore
90+
91+ - name : Test console application
92+ run : dotnet run --project GDeflateConsole --configuration Release test
93+
94+ - name : Publish console application (Self-contained)
95+ run : dotnet publish GDeflateConsole/GDeflateConsole.csproj --configuration Release --output ./publish-console --self-contained true --runtime ${{ matrix.runtime }}
96+
97+ - name : Create build info (Windows)
98+ if : matrix.os == 'windows-latest'
99+ run : |
100+ echo "GDeflate Console Application - Self-contained" > ./publish-console/BUILD_INFO.txt
101+ echo "Build Date: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss UTC')" >> ./publish-console/BUILD_INFO.txt
102+ echo "Commit SHA: ${{ github.sha }}" >> ./publish-console/BUILD_INFO.txt
103+ echo "Branch: ${{ github.ref_name }}" >> ./publish-console/BUILD_INFO.txt
104+ echo "Platform: ${{ matrix.name }} (${{ matrix.runtime }})" >> ./publish-console/BUILD_INFO.txt
105+ echo "GPU Support: Available on Windows with CUDA/nvCOMP" >> ./publish-console/BUILD_INFO.txt
106+ echo "Fallback Mode: Simulation mode on systems without GPU" >> ./publish-console/BUILD_INFO.txt
107+ shell : pwsh
64108
65- - name : Publish framework-dependent application
66- run : dotnet publish GDeflateGUI/GDeflateGUI.csproj --configuration Release --output ./publish-fd --no-build --self-contained false
109+ - name : Create build info (Unix)
110+ if : matrix.os != 'windows-latest'
111+ run : |
112+ echo "GDeflate Console Application - Self-contained" > ./publish-console/BUILD_INFO.txt
113+ echo "Build Date: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" >> ./publish-console/BUILD_INFO.txt
114+ echo "Commit SHA: ${{ github.sha }}" >> ./publish-console/BUILD_INFO.txt
115+ echo "Branch: ${{ github.ref_name }}" >> ./publish-console/BUILD_INFO.txt
116+ echo "Platform: ${{ matrix.name }} (${{ matrix.runtime }})" >> ./publish-console/BUILD_INFO.txt
117+ echo "GPU Support: Simulation mode (CUDA not available on this platform)" >> ./publish-console/BUILD_INFO.txt
118+ echo "Fallback Mode: Full functionality in simulation mode" >> ./publish-console/BUILD_INFO.txt
67119
68- - name : Upload framework-dependent artifact
120+ - name : Upload console artifact
69121 uses : actions/upload-artifact@v4
70122 with :
71- name : GDeflate-Compressor-Framework-Dependent
72- path : ./publish-fd/
73- retention-days : 30
123+ name : GDeflate-Console-${{ matrix.name }}-${{ matrix.runtime }}
124+ path : ./publish-console/
125+ retention-days : 30
126+
127+ build-summary :
128+ name : Build Summary
129+ runs-on : ubuntu-latest
130+ needs : [build-gui, build-console]
131+ if : always()
132+
133+ steps :
134+ - name : Create build summary
135+ run : |
136+ echo "# GDeflate Compressor Build Summary" >> $GITHUB_STEP_SUMMARY
137+ echo "" >> $GITHUB_STEP_SUMMARY
138+ echo "## Build Status" >> $GITHUB_STEP_SUMMARY
139+ echo "- **GUI Application**: ${{ needs.build-gui.result }}" >> $GITHUB_STEP_SUMMARY
140+ echo "- **Console Application**: ${{ needs.build-console.result }}" >> $GITHUB_STEP_SUMMARY
141+ echo "" >> $GITHUB_STEP_SUMMARY
142+ echo "## Artifacts Generated" >> $GITHUB_STEP_SUMMARY
143+ echo "### GUI Application (Windows only)" >> $GITHUB_STEP_SUMMARY
144+ echo "- GDeflate-GUI-Windows-self-contained" >> $GITHUB_STEP_SUMMARY
145+ echo "- GDeflate-GUI-Windows-framework-dependent" >> $GITHUB_STEP_SUMMARY
146+ echo "" >> $GITHUB_STEP_SUMMARY
147+ echo "### Console Application (Cross-platform)" >> $GITHUB_STEP_SUMMARY
148+ echo "- GDeflate-Console-Windows-win-x64" >> $GITHUB_STEP_SUMMARY
149+ echo "- GDeflate-Console-Linux-linux-x64" >> $GITHUB_STEP_SUMMARY
150+ echo "- GDeflate-Console-macOS-osx-x64" >> $GITHUB_STEP_SUMMARY
151+ echo "" >> $GITHUB_STEP_SUMMARY
152+ echo "## Features" >> $GITHUB_STEP_SUMMARY
153+ echo "- **GPU Acceleration**: Available on Windows with CUDA/nvCOMP" >> $GITHUB_STEP_SUMMARY
154+ echo "- **Simulation Mode**: Automatic fallback for testing and non-GPU systems" >> $GITHUB_STEP_SUMMARY
155+ echo "- **Cross-platform**: Console app runs on Windows, Linux, and macOS" >> $GITHUB_STEP_SUMMARY
156+ echo "- **Built-in Testing**: Comprehensive test suite included" >> $GITHUB_STEP_SUMMARY
0 commit comments