on: pull_request: branches: - main paths: - frontend/** name: Build and release debug APK defaults: run: working-directory: frontend/android jobs: build: name: Build APK runs-on: macos env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps BUNDLE_GEMFILE: ${{ gitea.workspace }}/frontend/android/Gemfile steps: - uses: https://gitea.com/actions/checkout@v4 # Selfhosted actions require a few extra steps - name: Install prerequisites run: | apt-get update apt-get install -y jq - uses: https://github.com/actions/setup-java@v4 with: java-version: '17' distribution: 'zulu' - name: Fix flutter SDK folder permission run: git config --global --add safe.directory "*" - uses: https://github.com/subosito/flutter-action@v2 with: channel: stable flutter-version: 3.22.0 cache: true - name: Setup Android SDK uses: https://github.com/android-actions/setup-android@v3 - run: flutter pub get working-directory: ./frontend - name: Set up ruby env and install fastlane uses: https://github.com/ruby/setup-ruby@v1 with: ruby-version: 3.3 bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Add required secrets run: | echo "${{ secrets.ANDROID_SECRET_PROPERTIES_BASE64 }}" | base64 -d > secrets.properties echo "${{ secrets.ANDROID_GOOGLE_PLAY_JSON_BASE64 }}" | base64 -d > google-key.json echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > release.keystore working-directory: android - name: Run fastlane lane run: bundle exec fastlane deploy_release working-directory: android env: BUILD_NUMBER: ${{ github.run_number }} # BUILD_NAME is implicitly available GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}