Merge pull request #353 from weblate/weblate-squawker-squawker #165
This file contains 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: ci | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
android: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, 'ci skip')" | |
steps: | |
- name: Clone the repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install and set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Install and set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.22.0' | |
channel: 'stable' | |
cache: true | |
- name: Set up signing key | |
run: echo $SIGNING_KEY | base64 -d > android/app/key.jks | |
env: | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
- name: Cache build directory | |
uses: actions/cache@v3 | |
with: | |
path: build | |
key: ${{ runner.os }}-build-${{ hashFiles('**/build') }} | |
restore-keys: | | |
${{ runner.os }}-build- | |
- name: Build APKs | |
run: | | |
flutter clean | |
flutter config --no-analytics | |
flutter pub get | |
flutter pub run flutter_oss_licenses:generate.dart | |
flutter pub run intl_utils:generate | |
# Create a directory for our release APKs | |
mkdir -pv build/app/outputs/release | |
# Build our big boy APK, and move it into the release APKs folder | |
flutter build apk --dart-define=app.flavor=github --release --no-tree-shake-icons | |
mv build/app/outputs/flutter-apk/*-release.apk build/app/outputs/release | |
# Build our ABI-specific APKs and move them into the release APKs folder | |
flutter build apk --dart-define=app.flavor=github --release --no-tree-shake-icons --split-per-abi --target-platform=android-x64,android-arm,android-arm64 | |
mv build/app/outputs/flutter-apk/*-release.apk build/app/outputs/release | |
env: | |
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
KEY_PATH: key.jks | |
- name: Archive big APK | |
uses: actions/upload-artifact@v2 | |
with: | |
name: apk | |
path: build/app/outputs/release/app-release.apk | |
- name: Archive arm APK | |
uses: actions/upload-artifact@v2 | |
with: | |
name: apk-arm | |
path: build/app/outputs/release/app-armeabi-v7a-release.apk | |
- name: Archive arm64 APK | |
uses: actions/upload-artifact@v2 | |
with: | |
name: apk-arm64 | |
path: build/app/outputs/release/app-arm64-v8a-release.apk | |
- name: Archive x86_64 APK | |
uses: actions/upload-artifact@v2 | |
with: | |
name: apk-x86_64 | |
path: build/app/outputs/release/app-x86_64-release.apk | |
# ios: | |
# runs-on: macos-latest | |
# steps: | |
# - name: Clone the repository | |
# uses: actions/checkout@v4 | |
# with: | |
# fetch-depth: 0 | |
# | |
# - name: Install and set up Java | |
# uses: actions/setup-java@v4 | |
# with: | |
# distribution: 'zulu' | |
# java-version: '17' | |
# | |
# - name: Install and set up Flutter | |
# uses: subosito/flutter-action@v2 | |
# with: | |
# flutter-version: '3.22.0' | |
# channel: 'stable' | |
# | |
# - name: Build | |
# run: | | |
# flutter config --no-analytics | |
# flutter pub get | |
# flutter pub run flutter_oss_licenses:generate.dart | |
# flutter build ipa --debug | |
# flutter build ipa --release | |
# - name: Archive debug APK | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: apk-debug | |
# path: build/app/outputs/flutter-apk/app-debug.apk | |
# | |
# - name: Archive release APK | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: apk-release | |
# path: build/app/outputs/flutter-ipa/iphoneos/app.ipa | |
# path: build/app/outputs/flutter-apk/app-release.apk |