1- name : Build Flutter App
1+ name : Build and Release Flutter App
22
33on :
44 push :
@@ -18,19 +18,27 @@ jobs:
1818 uses : subosito/flutter-action@v2
1919 with :
2020 channel : stable
21- flutter-version : 3.29 .0
21+ flutter-version : 3.19 .0
2222
2323 - name : Install dependencies
2424 run : flutter pub get
2525
26+ - name : Enable Linux desktop
27+ run : flutter config --enable-linux-desktop
28+
2629 - name : Build Linux executable
2730 run : flutter build linux
2831
32+ - name : Compress Linux build
33+ run : |
34+ cd build/linux/x64/release/bundle
35+ zip -r ../../../linux-build.zip .
36+
2937 - name : Upload Linux artifact
3038 uses : actions/upload-artifact@v3
3139 with :
3240 name : linux-build
33- path : build/linux/x64/release/bundle/
41+ path : build/linux-build.zip
3442
3543 build-windows :
3644 name : Build for Windows
@@ -43,19 +51,28 @@ jobs:
4351 uses : subosito/flutter-action@v2
4452 with :
4553 channel : stable
46- flutter-version : 3.29 .0
54+ flutter-version : 3.19 .0
4755
4856 - name : Install dependencies
4957 run : flutter pub get
5058
59+ - name : Enable Windows desktop
60+ run : flutter config --enable-windows-desktop
61+
5162 - name : Build Windows executable
5263 run : flutter build windows
5364
65+ - name : Compress Windows build
66+ run : |
67+ cd build/windows/runner/Release
68+ Compress-Archive -Path * -DestinationPath ../../../windows-build.zip
69+
5470 - name : Upload Windows artifact
5571 uses : actions/upload-artifact@v3
5672 with :
5773 name : windows-build
58- path : build/windows/runner/Release/
74+ path : build/windows-build.zip
75+
5976 release :
6077 name : Create GitHub Release
6178 needs : [build-linux, build-windows]
@@ -73,15 +90,15 @@ jobs:
7390 name : windows-build
7491 path : windows/
7592
76- - name : Create Release
93+ - name : Create GitHub Release
7794 uses : softprops/action-gh-release@v1
7895 with :
7996 tag_name : ${{ github.ref_name }}
8097 name : Release ${{ github.ref_name }}
8198 draft : false
8299 prerelease : false
83100 files : |
84- linux/**
85- windows/**
101+ linux/linux-build.zip
102+ windows/windows-build.zip
86103 env :
87104 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments