@@ -14,21 +14,46 @@ jobs:
14
14
steps :
15
15
- uses : actions/setup-java@v4
16
16
with :
17
- distribution : ' oracle'
18
- java-version : ' 17 '
17
+ distribution : " oracle"
18
+ java-version : " 17 "
19
19
- name : Cloing repository
20
20
uses : actions/checkout@v4
21
21
- name : Setup Flutter
22
22
uses : subosito/flutter-action@v2
23
23
with :
24
- flutter-version : 3.24.1
24
+ flutter-version : 3.27.1
25
+ cache : true
26
+
27
+ # Download the keystore file (from GitHub Secrets or other storage)
28
+ - name : Download keystore
29
+ env :
30
+ KEYSTORE_BASE64 : ${{ secrets.APK_SIGN }}
31
+ run : echo "$KEYSTORE_BASE64" | base64 --decode > android/app/dartotsu.jks
32
+ # Set up environment variables for signing
33
+ - name : Set up signing variables
34
+ env :
35
+ KEYSTORE_PASSWORD : ${{ secrets.KEYSTORE_PASSWORD }}
36
+ KEY_PASSWORD : ${{ secrets.KEYSTORE_PASSWORD }}
37
+ KEY_ALIAS : ${{ secrets.KEY_ALIAS}}
38
+ run : |
39
+ echo "storePassword=$KEYSTORE_PASSWORD" > android/key.properties
40
+ echo "keyPassword=$KEY_PASSWORD" >> android/key.properties
41
+ echo "keyAlias=$KEY_ALIAS" >> android/key.properties
42
+ echo "storeFile=dartotsu.jks" >> android/key.properties
43
+ # Optimize Flutter build
25
44
- run : flutter pub get
26
- - run : flutter build apk
27
- - run : mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/Dantotsu_Android_${{github.ref_name}}.apk
28
- - name : Android Apk Release
29
- uses : softprops/action-gh-release@master
30
- with :
31
- files : build/app/outputs/flutter-apk/Dantotsu_Android_${{github.ref_name}}.apk
45
+ - run : flutter build apk --release --split-per-abi
46
+ - name : Rename APKs
47
+ run : |
48
+ for file in build/app/outputs/flutter-apk/app-*-release.apk; do
49
+ abi=$(basename $file | sed 's/app-\(.*\)-release.apk/\1/')
50
+ mv $file build/app/outputs/flutter-apk/Dartotsu_Android_${abi}_${{github.ref_name}}.apk
51
+ done
52
+ ls build/app/outputs/flutter-apk
53
+ # - name: Android Apk Release
54
+ # uses: softprops/action-gh-release@master
55
+ # with:
56
+ # files: build/app/outputs/flutter-apk/Dantotsu_Android_${{github.ref_name}}.apk
32
57
build_windows :
33
58
runs-on : windows-latest
34
59
permissions :
@@ -38,23 +63,37 @@ jobs:
38
63
steps :
39
64
- name : Cloing repository
40
65
uses : actions/checkout@v4
66
+ # This is a self made cert file that is used to sign the windows app
67
+ - name : Set up Signing Tool
68
+ run : |
69
+ mkdir $env:USERPROFILE\certs
70
+ [System.IO.File]::WriteAllBytes("$env:USERPROFILE\certs\Dartotsu.pfx", [Convert]::FromBase64String("${{secrets.PFX_FILE}}"))
71
+ # Setup Flutter with caching
41
72
- name : Setup Flutter
42
73
uses : subosito/flutter-action@v2
43
74
with :
44
- flutter-version : 3.24.1
75
+ flutter-version : 3.27.1
76
+ cache : true
77
+ # Enable Windows desktop support
78
+ - name : Enable Windows desktop support
79
+ run : flutter config --enable-windows-desktop
80
+ # Get dependencies with cached packages
45
81
- run : flutter pub get
46
- - run : flutter build windows
47
- - name : Archive App
48
- uses : thedoctor0/zip-release@master
49
- with :
50
- type : ' zip'
51
- filename : Dantotsu_Windows_${{github.ref_name}}.zip
52
- directory : build\windows\x64\runner\Release
53
- - run : ls build\windows\x64\runner\Release
54
- - name : Release Windows Zip
55
- uses : softprops/action-gh-release@master
56
- with :
57
- files : build/windows/x64/runner/Release/Dantotsu_Windows_${{github.ref_name}}.zip
82
+ # Extract version from pubspec.yaml
83
+ - name : Extract Version
84
+ id : get_version
85
+ run : |
86
+ $version = (Get-Content pubspec.yaml | Select-String -Pattern 'version: ([\d.]+)').Matches.Groups[1].Value
87
+ echo "version=$version" >> $env:GITHUB_ENV
88
+
89
+ - name : Build and Sign Setup
90
+ run : |
91
+ dart run inno_bundle:build --sign-tool-params '"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /fd sha256 /f "C:\Users\runneradmin\certs\Dartotsu.pfx" /p "${{secrets.PFX_PASSWORD}}" /t http://timestamp.digicert.com /v $f' --release
92
+ - run : build\windows\x64\installer\Release
93
+ # - name: Release Windows Zip
94
+ # uses: softprops/action-gh-release@master
95
+ # with:
96
+ # files: build/windows/x64/runner/Release/Dantotsu_Windows_${{github.ref_name}}.zip
58
97
59
98
60
99
build_linux :
@@ -64,60 +103,104 @@ jobs:
64
103
pull-requests : write
65
104
repository-projects : write
66
105
steps :
67
- - name : Cloing repository
106
+ # Step 1: Clone repository
107
+ - name : Cloning repository
68
108
uses : actions/checkout@v4
109
+
110
+ # Step 2: Setup Flutter
69
111
- name : Setup Flutter
70
112
uses : subosito/flutter-action@v2
71
113
with :
72
- flutter-version : 3.24.1
73
- - run : |
114
+ flutter-version : 3.27.1
115
+ cache : true
116
+
117
+ # Step 3: Setup system dependencies
118
+ - name : Install system dependencies
119
+ run : |
74
120
sudo apt-get update -y
75
121
sudo apt-get install -y ninja-build libgtk-3-dev webkit2gtk-4.1
76
- - run : flutter pub get
77
- - run : flutter build linux
122
+ # Step 5: Fetch Flutter dependencies
123
+ - name : Fetch Flutter dependencies
124
+ run : flutter pub get
125
+ # Step 6: Build the Linux application
126
+ - name : Build Flutter Linux app
127
+ run : flutter build linux
128
+ # Step 7: Archive the Linux app
78
129
- name : Archive app
79
130
uses : thedoctor0/zip-release@master
80
131
with :
81
132
type : ' zip'
82
133
filename : Dantotsu_Linux_${{github.ref_name}}.zip
83
134
directory : build/linux/x64/release/bundle
84
- - name : Release Linux Zip
85
- uses : softprops/action-gh-release@master
86
- with :
87
- files : build/linux/x64/release/bundle/Dantotsu_Linux_${{github.ref_name}}.zip
88
- build_ios_and_macos :
89
- runs-on : macos-13
135
+ # - name: Release Linux Zip
136
+ # uses: softprops/action-gh-release@master
137
+ # with:
138
+ # files: build/linux/x64/release/bundle/Dantotsu_Linux_${{github.ref_name}}.zip
139
+ build_ios :
140
+ runs-on : macos-latest
90
141
permissions :
91
142
contents : write
92
143
pull-requests : write
93
144
repository-projects : write
94
145
steps :
95
- - name : Cloing repository
146
+ # Step 1: Clone repository
147
+ - name : Cloning repository
96
148
uses : actions/checkout@v4
149
+
150
+ # Step 2: Setup Flutter
97
151
- name : Setup Flutter
98
152
uses : subosito/flutter-action@v2
99
153
with :
100
- flutter-version : 3.24.1
101
- - run : flutter pub get
102
- - run : flutter build ios --release --no-codesign
103
- - name : Release ios App
104
- uses : softprops/action-gh-release@master
105
- with :
106
- files : build/ios/iphoneos/Runner.app
107
- - run : flutter build macos
108
- - name : Archive App
109
- uses : thedoctor0/zip-release@master
110
- with :
111
- type : ' zip'
112
- filename : Dantotsu_MacOS_${{github.ref_name}}.zip
113
- directory : build/macos/Build/Products/Release
114
- - name : Release MacOS Zip
115
- uses : softprops/action-gh-release@master
154
+ flutter-version : 3.27.1
155
+ cache : true
156
+
157
+ # Step 3 Get Dependencies
158
+ - name : Get Dependencies
159
+ run : flutter pub get
160
+ # Step 4 Build app for iOS
161
+ - name : Build iOS
162
+ run : |
163
+ flutter build ios --release --no-codesign
164
+ cd build/ios/iphoneos
165
+ mkdir -p Payload
166
+ cd Payload
167
+ ln -s ../Runner.app
168
+ cd ..
169
+ zip -r Dartotsu-iOS-${{ github.ref_name }}.ipa Payload
170
+ build_macos :
171
+ runs-on : macos-latest
172
+ permissions :
173
+ contents : write
174
+ pull-requests : write
175
+ repository-projects : write
176
+ steps :
177
+ # Step 1: Clone repository
178
+ - name : Cloning repository
179
+ uses : actions/checkout@v4
180
+
181
+ # Step 2: Setup Flutter
182
+ - name : Setup Flutter
183
+ uses : subosito/flutter-action@v2
116
184
with :
117
- files : build/macos/Build/Products/Release/Dantotsu_MacOS_${{github.ref_name}}.zip
185
+ flutter-version : 3.27.1
186
+ cache : true
187
+
188
+ # Step 3 Get Dependencies
189
+ - name : Get Dependencies
190
+ run : flutter pub get
191
+ # Step 4 Build app for iOS
192
+ - name : Build macOS
193
+ run : flutter build macos --release
194
+ # - name: Release macOS Zip
195
+ # uses: softprops/action-gh-release@master
196
+ # with:
197
+ # files: build/macos/Build/Products/Release/Dantotsu_MacOS_${{github.ref_name}}.zip
198
+
199
+
200
+
118
201
upload_download_url :
119
202
runs-on : ubuntu-latest
120
- needs : [build_android,build_windows,build_linux,build_ios_and_macos ]
203
+ needs : [build_android,build_windows,build_linux,build_ios,build_macos ]
121
204
steps :
122
205
- name : Checkout code
123
206
uses : actions/checkout@v3
@@ -180,7 +263,7 @@ jobs:
180
263
181
264
generate-changelog :
182
265
runs-on : ubuntu-latest
183
- needs : [build_android,build_windows,build_linux,build_ios_and_macos ]
266
+ needs : [build_android,build_windows,build_linux,build_ios,build_macos ]
184
267
steps :
185
268
- name : Checkout Code
186
269
uses : actions/checkout@v4
0 commit comments