|
44 | 44 | - name: Get Flutter dependencies |
45 | 45 | run: flutter pub get |
46 | 46 | shell: bash |
47 | | - - name: Inject DanDan API Credentials |
48 | | - run: | |
49 | | - sed -i "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart |
50 | | - sed -i "s/rABUaBLqdz7aCSi3fe88ZDj2gwga9Vax/${{ secrets.DANDANAPI_KEY }}/g" lib/utils/mortis.dart |
51 | 47 | - name: Build Flutter for Android |
52 | 48 | run: flutter build apk --split-per-abi |
53 | 49 | shell: bash |
|
88 | 84 | distribution: 'temurin' |
89 | 85 | java-version: '18' |
90 | 86 | - run: flutter pub get |
91 | | - - name: Inject DanDan API Credentials |
92 | | - env: |
93 | | - DANDANAPI_APPID: ${{ secrets.DANDANAPI_APPID }} |
94 | | - DANDANAPI_KEY: ${{ secrets.DANDANAPI_KEY }} |
95 | | - run: | |
96 | | - (Get-Content -Path 'lib/utils/mortis.dart') -replace "kvpx7qkqjh", "$env:DANDANAPI_APPID" | Set-Content -Path 'lib/utils/mortis.dart' |
97 | | - (Get-Content -Path 'lib/utils/mortis.dart') -replace "rABUaBLqdz7aCSi3fe88ZDj2gwga9Vax", "$env:DANDANAPI_KEY" | Set-Content -Path 'lib/utils/mortis.dart' |
98 | 87 | - run: flutter build windows |
99 | 88 | - run: Compress-Archive build/windows/x64/runner/Release/* Kazumi_windows_${env:tag}.zip |
100 | 89 | - name: Upload windows outputs |
101 | 90 | uses: actions/upload-artifact@v4 |
102 | | - id: unsigned-windows-zip-artifacts |
103 | 91 | with: |
104 | 92 | name: windows_outputs |
105 | 93 | path: | |
106 | 94 | Kazumi_windows_*.zip |
107 | 95 |
|
108 | | - # Sign Zip |
109 | | - - run: New-Item -Path "build/windows/zip_signed_output" -ItemType Directory |
110 | | - - name: sign windows zip |
111 | | - uses: signpath/github-action-submit-signing-request@v1.1 |
112 | | - with: |
113 | | - api-token: '${{ secrets.SIGNPATH_API_TOKEN }}' |
114 | | - organization-id: 'fa047255-4772-4be1-b14f-5cfa62635877' |
115 | | - project-slug: 'Kazumi' |
116 | | - signing-policy-slug: 'release-signing' |
117 | | - artifact-configuration-slug: 'Packet' |
118 | | - github-artifact-id: '${{ steps.unsigned-windows-zip-artifacts.outputs.artifact-id }}' |
119 | | - wait-for-completion: true |
120 | | - output-artifact-directory: 'build/windows/zip_signed_output' |
121 | | - |
122 | | - - name: Upload windows zip signed ouputs |
123 | | - uses: actions/upload-artifact@v4 |
124 | | - id: signed-windows-zip-artifacts |
125 | | - with: |
126 | | - name: windows_zip_signed_outputs |
127 | | - path: build/windows/zip_signed_output/*.zip |
128 | | - |
129 | | - # Replace Unpacked Artifact with Signed Artifact |
130 | | - - name: Replace Unpacked Artifact with Signed Artifact |
131 | | - run: Expand-Archive -Path "build/windows/zip_signed_output/Kazumi_windows_${env:tag}.zip" -DestinationPath "build/windows/x64/runner/Release" -Force |
132 | | - |
133 | | - # Build Unsigned MSIX |
134 | | - - name: Build unsigned msix |
| 96 | + # Build MSIX |
| 97 | + - name: Build msix |
135 | 98 | run: dart run msix:create |
136 | | - - name: Upload windows msix ouputs |
| 99 | + - name: Upload windows msix outputs |
137 | 100 | uses: actions/upload-artifact@v4 |
138 | | - id: unsigned-windows-msix-artifacts |
139 | 101 | with: |
140 | 102 | name: windows_msix_outputs |
141 | 103 | path: | |
142 | 104 | build/windows/x64/runner/Release/kazumi.msix |
143 | | - |
144 | | - # Sign MSIX |
145 | | - - run: New-Item -Path "build/windows/msix_signed_output" -ItemType Directory |
146 | | - - name: sign windows msix |
147 | | - uses: signpath/github-action-submit-signing-request@v1.1 |
148 | | - with: |
149 | | - api-token: '${{ secrets.SIGNPATH_API_TOKEN }}' |
150 | | - organization-id: 'fa047255-4772-4be1-b14f-5cfa62635877' |
151 | | - project-slug: 'Kazumi' |
152 | | - signing-policy-slug: 'release-signing' |
153 | | - artifact-configuration-slug: 'MSIX' |
154 | | - github-artifact-id: '${{ steps.unsigned-windows-msix-artifacts.outputs.artifact-id }}' |
155 | | - wait-for-completion: true |
156 | | - output-artifact-directory: 'build/windows/msix_signed_output' |
157 | | - |
158 | | - - name: Upload windows msix signed ouputs |
159 | | - uses: actions/upload-artifact@v4 |
160 | | - id: signed-windows-msix-artifacts |
161 | | - with: |
162 | | - name: windows_msix_signed_outputs |
163 | | - path: build/windows/msix_signed_output/*.msix |
164 | 105 |
|
165 | 106 | flutter-build-linux: |
166 | 107 | name: "Release for Linux" |
|
201 | 142 | - name: Get Flutter dependencies |
202 | 143 | run: flutter pub get |
203 | 144 | shell: bash |
204 | | - - name: Inject DanDan API Credentials |
205 | | - run: | |
206 | | - sed -i "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart |
207 | | - sed -i "s/rABUaBLqdz7aCSi3fe88ZDj2gwga9Vax/${{ secrets.DANDANAPI_KEY }}/g" lib/utils/mortis.dart |
208 | 145 | - name: Build Flutter for Linux |
209 | 146 | run: flutter build linux |
210 | 147 | shell: bash |
|
282 | 219 | channel: stable |
283 | 220 | flutter-version-file: pubspec.yaml |
284 | 221 | - run: flutter pub get |
285 | | - - name: Inject DanDan API Credentials |
286 | | - run: | |
287 | | - sed -i '' "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart |
288 | | - sed -i '' "s/rABUaBLqdz7aCSi3fe88ZDj2gwga9Vax/${{ secrets.DANDANAPI_KEY }}/g" lib/utils/mortis.dart |
289 | 222 | - name: Build IPA |
290 | 223 | run: | |
291 | 224 | flutter build ios --release --no-codesign |
|
319 | 252 | channel: stable |
320 | 253 | flutter-version-file: pubspec.yaml |
321 | 254 | - run: flutter pub get |
322 | | - - name: Inject DanDan API Credentials |
323 | | - run: | |
324 | | - sed -i '' "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart |
325 | | - sed -i '' "s/rABUaBLqdz7aCSi3fe88ZDj2gwga9Vax/${{ secrets.DANDANAPI_KEY }}/g" lib/utils/mortis.dart |
326 | 255 | - run: flutter build macos --release |
327 | 256 | - name: Create DMG |
328 | 257 | run: | |
|
348 | 277 | - name: Extract tag name |
349 | 278 | run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV |
350 | 279 | shell: bash |
351 | | - - name: Set up JDK 17 |
352 | | - uses: actions/setup-java@v4 |
353 | | - with: |
354 | | - java-version: '17' |
355 | | - distribution: 'temurin' |
356 | | - - name: Setup Android SDK |
357 | | - uses: android-actions/setup-android@v3 |
358 | | - - name: Setup Android build tools |
359 | | - run: sdkmanager "build-tools;34.0.0" |
360 | | - |
361 | 280 | - name: Download windows zip build file |
362 | 281 | uses: actions/download-artifact@v4 |
363 | 282 | with: |
364 | | - name: windows_zip_signed_outputs |
365 | | - path: windows_zip_signed_outputs |
| 283 | + name: windows_outputs |
| 284 | + path: windows_outputs |
366 | 285 | - name: List files in windows_outputs directory |
367 | | - run: ls -l windows_zip_signed_outputs |
| 286 | + run: ls -l windows_outputs |
368 | 287 | - name: Copy windows build file to root |
369 | | - run: cp windows_zip_signed_outputs/* Kazumi_windows_${{ env.tag }}.zip |
| 288 | + run: cp windows_outputs/* Kazumi_windows_${{ env.tag }}.zip |
370 | 289 |
|
371 | 290 | - name: Download windows msix build file |
372 | 291 | uses: actions/download-artifact@v4 |
373 | 292 | with: |
374 | | - name: windows_msix_signed_outputs |
375 | | - path: windows_msix_signed_outputs |
376 | | - - name: List files in windows_msix_signed_outputs directory |
377 | | - run: ls -l windows_msix_signed_outputs |
378 | | - - name: Copy windows build file to root |
379 | | - run: cp windows_msix_signed_outputs/* Kazumi_windows_${{ env.tag }}.msix |
| 293 | + name: windows_msix_outputs |
| 294 | + path: windows_msix_outputs |
| 295 | + - name: List files in windows_msix_outputs directory |
| 296 | + run: ls -l windows_msix_outputs |
| 297 | + - name: Copy windows msix build file to root |
| 298 | + run: cp windows_msix_outputs/* Kazumi_windows_${{ env.tag }}.msix |
380 | 299 |
|
381 | 300 | - name: Download android build file |
382 | 301 | uses: actions/download-artifact@v4 |
383 | 302 | with: |
384 | 303 | name: android_outputs |
385 | | - path: android_outputs |
| 304 | + path: android_outputs |
386 | 305 | - name: List files in android_outputs directory |
387 | | - run: ls -l android_outputs |
388 | | - - name: Copy android build file to unsigned floder |
389 | | - run: | |
390 | | - mkdir build |
391 | | - mkdir build/unsigned |
392 | | - mkdir build/signed |
393 | | - cp android_outputs/* build/unsigned/Kazumi_android_${{ env.tag }}.apk |
| 306 | + run: ls -l android_outputs |
| 307 | + - name: Copy android build file to root |
| 308 | + run: cp android_outputs/* Kazumi_android_${{ env.tag }}.apk |
394 | 309 |
|
395 | 310 | - name: Download iOS build file |
396 | 311 | uses: actions/download-artifact@v4 |
|
422 | 337 | - name: Copy linux build file to root |
423 | 338 | run: cp linux_outputs/* . |
424 | 339 |
|
425 | | - - name: Sign APK |
426 | | - id: sign_app |
427 | | - uses: filippoLeporati93/android-release-signer@v1 |
428 | | - with: |
429 | | - releaseDirectory: build/unsigned |
430 | | - signingKeyBase64: ${{ secrets.SIGNING_KEY_BASE64 }} |
431 | | - alias: ${{ secrets.KEY_ALIAS }} |
432 | | - keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} |
433 | | - env: |
434 | | - BUILD_TOOLS_VERSION: "34.0.0" |
435 | | - |
436 | | - - name: Copy Signed android build file |
437 | | - run: cp ${{steps.sign_app.outputs.signedReleaseFile}} build/signed/Kazumi_android_${{ env.tag }}.apk |
438 | | - |
439 | 340 | - name: Create release |
440 | 341 | uses: softprops/action-gh-release@v2 |
441 | 342 | with: |
442 | 343 | files: | |
443 | | - build/signed/*.apk |
| 344 | + Kazumi_android_*.apk |
444 | 345 | Kazumi_windows_*.zip |
445 | 346 | Kazumi_windows_*.msix |
446 | 347 | Kazumi_macos_*.dmg |
|
0 commit comments