Skip to content

Commit 1c0a091

Browse files
committed
ci: add native Windows desktop builds to CI/CD
Added separate workflow for Windows desktop builds that integrates with the main release process. Changes: - Created .github/workflows/build-windows.yml for Windows builds - Moved Windows build configuration to separate reusable workflow - Integrated Windows builds into release and summary jobs - Removed disabled inline Windows job from build-desktop.yml The Windows workflow: - Triggers on push to main (for frontend/Go changes) and version tags - Builds Flutter Windows desktop app using package-windows.ps1 - Uploads windows-amd64-zip artifact - Automatically included in GitHub releases for version tags Benefits: - Independent Windows CI/CD pipeline - Native Windows .exe applications in releases - Better organization and maintainability - Can be triggered separately via workflow_dispatch
1 parent b552a19 commit 1c0a091

File tree

2 files changed

+108
-70
lines changed

2 files changed

+108
-70
lines changed

.github/workflows/build-desktop.yml

Lines changed: 9 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -111,74 +111,8 @@ jobs:
111111
retention-days: 7
112112

113113
# Временно отключили windows-сборку
114-
build-windows:
115-
runs-on: windows-latest
116-
if: false
117-
steps:
118-
- name: Checkout
119-
uses: actions/checkout@v4
120-
121-
- name: Setup Go
122-
uses: actions/setup-go@v5
123-
with:
124-
go-version: '1.22.x'
125-
126-
- name: Setup Flutter
127-
uses: subosito/flutter-action@v2
128-
with:
129-
flutter-version: '3.x'
130-
channel: 'stable'
131-
132-
- name: Cache Flutter dependencies
133-
uses: actions/cache@v4
134-
with:
135-
path: |
136-
~\AppData\Local\Pub\Cache
137-
frontend\.dart_tool
138-
key: ${{ runner.os }}-flutter-${{ hashFiles('frontend/pubspec.lock') }}
139-
restore-keys: |
140-
${{ runner.os }}-flutter-
141-
142-
- name: Cache Go modules
143-
uses: actions/cache@v4
144-
with:
145-
path: ~\go\pkg\mod
146-
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
147-
restore-keys: |
148-
${{ runner.os }}-go-
149-
150-
- name: Flutter pub get
151-
working-directory: frontend
152-
run: flutter pub get
153-
154-
- name: Enable Windows desktop
155-
working-directory: frontend
156-
run: |
157-
flutter config --enable-windows-desktop
158-
flutter create --platforms=windows .
159-
160-
- name: Set version
161-
id: version
162-
shell: bash
163-
run: |
164-
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
165-
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
166-
else
167-
echo "VERSION=dev-${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
168-
fi
169-
170-
- name: Build Windows ZIP
171-
shell: pwsh
172-
run: |
173-
$env:VERSION = "${{ steps.version.outputs.VERSION }}"
174-
./scripts/package-windows.ps1 -Version $env:VERSION
175-
176-
- name: Upload ZIP artifact
177-
uses: actions/upload-artifact@v4
178-
with:
179-
name: windows-amd64-zip
180-
path: dist/*.zip
181-
retention-days: 7
114+
# Windows builds moved to separate workflow: build-windows.yml
115+
# This allows independent execution and better CI/CD organization
182116

183117
build-linux:
184118
runs-on: ubuntu-latest
@@ -387,9 +321,13 @@ jobs:
387321
dist/*.zip
388322
retention-days: 7
389323

324+
# Windows desktop build - calls separate workflow
325+
build-windows:
326+
uses: ./.github/workflows/build-windows.yml
327+
390328
# Release job - only runs on version tags
391329
release:
392-
needs: [build-macos, build-linux, build-web]
330+
needs: [build-macos, build-linux, build-web, build-windows]
393331
runs-on: ubuntu-latest
394332
if: startsWith(github.ref, 'refs/tags/v')
395333
permissions:
@@ -432,7 +370,7 @@ jobs:
432370

433371
# Summary job
434372
summary:
435-
needs: [build-macos, build-linux, build-web]
373+
needs: [build-macos, build-linux, build-web, build-windows]
436374
runs-on: ubuntu-latest
437375
if: always()
438376
steps:
@@ -444,4 +382,5 @@ jobs:
444382
echo "|----------|--------|" >> $GITHUB_STEP_SUMMARY
445383
echo "| macOS Desktop | ${{ needs.build-macos.result }} |" >> $GITHUB_STEP_SUMMARY
446384
echo "| Linux Desktop | ${{ needs.build-linux.result }} |" >> $GITHUB_STEP_SUMMARY
385+
echo "| Windows Desktop | ${{ needs.build-windows.result }} |" >> $GITHUB_STEP_SUMMARY
447386
echo "| Web Binaries | ${{ needs.build-web.result }} |" >> $GITHUB_STEP_SUMMARY
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Build Windows Desktop
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'frontend/**'
8+
- '**.go'
9+
- 'go.mod'
10+
- 'go.sum'
11+
- 'scripts/package-windows.ps1'
12+
- '.github/workflows/build-windows.yml'
13+
push:
14+
tags:
15+
- 'v*'
16+
workflow_dispatch:
17+
workflow_call:
18+
19+
jobs:
20+
build-windows:
21+
runs-on: windows-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Go
27+
uses: actions/setup-go@v5
28+
with:
29+
go-version: '1.22.x'
30+
31+
- name: Setup Flutter
32+
uses: subosito/flutter-action@v2
33+
with:
34+
flutter-version: '3.x'
35+
channel: 'stable'
36+
37+
- name: Cache Flutter dependencies
38+
uses: actions/cache@v4
39+
with:
40+
path: |
41+
~\AppData\Local\Pub\Cache
42+
frontend\.dart_tool
43+
key: ${{ runner.os }}-flutter-${{ hashFiles('frontend/pubspec.lock') }}
44+
restore-keys: |
45+
${{ runner.os }}-flutter-
46+
47+
- name: Cache Go modules
48+
uses: actions/cache@v4
49+
with:
50+
path: ~\go\pkg\mod
51+
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
52+
restore-keys: |
53+
${{ runner.os }}-go-
54+
55+
- name: Flutter pub get
56+
working-directory: frontend
57+
run: flutter pub get
58+
59+
- name: Enable Windows desktop
60+
working-directory: frontend
61+
run: |
62+
flutter config --enable-windows-desktop
63+
flutter create --platforms=windows .
64+
65+
- name: Set version
66+
id: version
67+
shell: bash
68+
run: |
69+
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
70+
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
71+
else
72+
echo "VERSION=dev-${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
73+
fi
74+
75+
- name: Build Windows ZIP
76+
shell: pwsh
77+
run: |
78+
$env:VERSION = "${{ steps.version.outputs.VERSION }}"
79+
./scripts/package-windows.ps1 -Version $env:VERSION
80+
81+
- name: Upload ZIP artifact
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: windows-amd64-zip
85+
path: dist/*.zip
86+
retention-days: 7
87+
88+
summary:
89+
needs: [build-windows]
90+
runs-on: ubuntu-latest
91+
if: always()
92+
steps:
93+
- name: Build Summary
94+
run: |
95+
echo "## Windows Desktop Build Summary" >> $GITHUB_STEP_SUMMARY
96+
echo "" >> $GITHUB_STEP_SUMMARY
97+
echo "| Platform | Status |" >> $GITHUB_STEP_SUMMARY
98+
echo "|----------|--------|" >> $GITHUB_STEP_SUMMARY
99+
echo "| Windows amd64 | ${{ needs.build-windows.result }} |" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)