Add a crashlytics stub to allow the app to build #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and upload the F-Droid APKs | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*.fdroid' | |
| permissions: read-all | |
| jobs: | |
| fdroid-apks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout mobile code | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| - name: Read Flutter version | |
| run: echo "FLUTTER_VERSION=$(cat flutter-version)" >> $GITHUB_ENV | |
| - name: Install Flutter | |
| uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0 | |
| with: | |
| channel: stable | |
| flutter-version-file: pubspec.yaml | |
| - name: Patch Flutter | |
| run: | | |
| git -C ${{ env.FLUTTER_ROOT }} apply $GITHUB_WORKSPACE/flutter.patch | |
| rm ${{ env.FLUTTER_ROOT }}/bin/cache/flutter_tools.snapshot | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Patch dependencies | |
| run: | | |
| sed -i 's/-Wl,/-Wl,--build-id=none,/' ~/.pub-cache/hosted/pub.dev/jni-*/src/CMakeLists.txt | |
| sed -i 's/-Wl,/-Wl,--build-id=none,/' ~/.pub-cache/hosted/pub.dev/multistockfish_chess-*/src/CMakeLists.txt | |
| sed -i 's/-Wl,/-Wl,--build-id=none,/' ~/.pub-cache/hosted/pub.dev/multistockfish_sf16-*/src/CMakeLists.txt | |
| sed -i 's/-Wl,/-Wl,--build-id=none,/' ~/.pub-cache/hosted/pub.dev/multistockfish_variant-*/android/CMakeLists.txt | |
| truncate -s 0 ~/.pub-cache/hosted/pub.dev/webcrypto-*/android/CMakeLists.txt | |
| - name: Code generation | |
| run: dart run build_runner build | |
| - name: Configure Keystore | |
| run: | | |
| echo "${{ secrets.FDROID_KEYSTORE_FILE }}" | base64 --decode > app/lichess-fdroid.keystore | |
| echo "storeFile=lichess-fdroid.keystore" >> key.properties | |
| echo "keyAlias=${{ secrets.FDROID_KEYSTORE_KEY_ALIAS }}" >> key.properties | |
| echo "storePassword=${{ secrets.FDROID_KEYSTORE_STORE_PASSWORD }}" >> key.properties | |
| echo "keyPassword=${{ secrets.FDROID_KEYSTORE_KEY_PASSWORD }}" >> key.properties | |
| working-directory: android | |
| - name: Build APKs | |
| run: | | |
| export SOURCE_DATE_EPOCH=0 | |
| flutter build apk --split-per-abi --target-platform="android-x64" --dart-define=cronetHttpNoPlay=true --dart-define=LICHESS_HOST=lichess.org --dart-define=LICHESS_WS_HOST=socket.lichess.org --dart-define=LICHESS_WS_SECRET=wG1OLhUR3CSXdDybqrtIW227QGrtiM3d | |
| flutter build apk --split-per-abi --target-platform="android-arm" --dart-define=cronetHttpNoPlay=true --dart-define=LICHESS_HOST=lichess.org --dart-define=LICHESS_WS_HOST=socket.lichess.org --dart-define=LICHESS_WS_SECRET=wG1OLhUR3CSXdDybqrtIW227QGrtiM3d | |
| flutter build apk --split-per-abi --target-platform="android-arm64" --dart-define=cronetHttpNoPlay=true --dart-define=LICHESS_HOST=lichess.org --dart-define=LICHESS_WS_HOST=socket.lichess.org --dart-define=LICHESS_WS_SECRET=wG1OLhUR3CSXdDybqrtIW227QGrtiM3d | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6.2.0 | |
| with: | |
| aws-access-key-id: ${{ secrets.S3_ACCESS_KEY }} | |
| aws-secret-access-key: ${{ secrets.S3_SECRET_KEY }} | |
| aws-region: eu-west-3 | |
| - name: Upload APKs | |
| run: aws s3 cp build/app/outputs/flutter-apk "s3://lichess-fdroid-releases/${GITHUB_REF_NAME%.fdroid}" --recursive --exclude "*.sha1" |