ci: adjust memory settings when building

This commit is contained in:
PeanutMelonSeedBigAlmond
2025-09-29 12:24:12 +08:00
parent f9a0ee0aec
commit ccd976c0fd

View File

@@ -28,23 +28,31 @@ jobs:
uses: subosito/flutter-action@v2 uses: subosito/flutter-action@v2
with: with:
channel: stable channel: stable
- name: set up JDK 17 - name: set up JDK 21
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: '17' java-version: '21'
distribution: 'adopt' distribution: 'adopt'
cache: gradle cache: gradle
- name: Increase Gradle memory settings
run: |
echo "" >> android/gradle.properties
echo "org.gradle.jvmargs=-Xmx8192m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" >> android/gradle.properties
echo "android.enableR8=true" >> android/gradle.properties
- name: Clean workspace
run: flutter clean
- name: Decode Keystore - name: Decode Keystore
env: env:
ENCODED_STRING: ${{ secrets.SIGNING_STORE_BASE64 }} ENCODED_STRING: ${{ secrets.SIGNING_STORE_BASE64 }}
run: echo $ENCODED_STRING | base64 -di > android/app/keystore.jks run: echo $ENCODED_STRING | base64 -di > android/app/keystore.jks
- name: Build apk - name: Build apk
run: flutter build apk --release --split-per-abi -P --debug run: flutter build apk --release --split-per-abi
env: env:
CI: true CI: true
SIGNING_KEY_ALIAS: release SIGNING_KEY_ALIAS: release
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
FLUTTER_BUILD_ARGS: "--extra-gen-snapshot-options=--vm-args=-Xmx8G"
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with: