Skip to content

debug

debug #372

Workflow file for this run

name: Deploy apps
on:
push:
branches:
- main
- dev
# todo remove
- chore/upgrade-package-deployment
paths:
# todo remove
- '**'
- 'app/**'
- 'core/**'
- 'flutter_common/**'
workflow_dispatch:
concurrency:
group: ${{ github.ref }}-deploy-apps
cancel-in-progress: true
jobs:
play-store-release:
name: Create Play Store Release
runs-on: ubuntu-latest
steps:
- name: Await potential publishing on Pub.dev
uses: johannesvedder/await-workflow@v1
with:
workflowId: publish_pubdev.yml
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up ruby env
run: |
sudo apt-get update
sudo snap install ruby --classic
bundle install
working-directory: ./app/android
#uses: ruby/setup-ruby@v1
#with:
#ruby-version: head
#bundler-cache: true
#working-directory: ./app/android
- name: Set up flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path
architecture: x64 # optional, x64 or arm64
- name: Cache flutter version
run: |
flutter_version=$(flutter --version)
flutter_version_hash=$(flutter --version | sha256sum | awk '{print $1}')
echo "Flutter version: $flutter_version"
echo "Flutter version hash: $flutter_version_hash"
echo "flutter_version_hash=$flutter_version_hash" >> $GITHUB_ENV
- name: Restore StudyU app bundle cache
id: cache-studyu-app-bundle-restore
uses: actions/cache/restore@v4
with:
path: app/build/app/outputs/bundle/release/app-release.aab
key: flutter_v${{ env.flutter_version_hash }}-${{ hashFiles('**/pubspec.lock') }}-${{ runner.os }}
restore-keys: |
flutter_v${{ env.flutter_version_hash }}-${{ hashFiles('**/pubspec.lock') }}-
- run: |
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
echo "export LC_ALL=en_US.UTF-8" >> $HOME/.profile
echo "export LANG=en_US.UTF-8" >> $HOME/.profile
source $HOME/.profile
# ls "/home/runner/work/studyu/studyu/app/android/vendor/bundle/ruby/3.4.0+0/bin"
# echo "----------------"
# ls "/home/runner/work/studyu/studyu/app/android/vendor/bundle/ruby/3.4.0+0/gems"
# echo "----------------"
# ls
# echo "----------------"
# bundle config
# echo "----------------"
# gem list
bundle check
bundle install
ruby --version
bundle update fastlane
bundle check
bundle exec fastlane actions
echo "----------------"
bundle exec gem list
working-directory: ./app/android
- name: Build StudyU app bundle
if: steps.cache-studyu-app-bundle-restore.outputs.cache-hit != 'true'
run: |
flutter build appbundle --release --build-number ${{ github.run_number }}
working-directory: ./app
- name: Cache StudyU app bundle
id: cache-studyu-app-bundle-save
uses: actions/cache/save@v4
with:
path: app/build/app/outputs/bundle/release/app-release.aab
key: ${{ steps.cache-studyu-app-bundle-restore.outputs.cache-primary-key }}
- name: Decrypt files
id: decrypt_files
# todo where are these files used?
run: |
echo "${{ secrets.STUDYU_ANDROID_KEYSTORE }}" > keystore.jks.asc
gpg -d --passphrase "${{ secrets.STUDYU_ANDROID_KEYSTORE_PASSWORD }}" --batch keystore.jks.asc > app/android/studyu-keystore.jks
echo "${{ secrets.STUDYU_KEY_PROPERTIES}}" > app/android/key.properties
- name: Fastlane upload
run: bundle exec fastlane deploy_internal
working-directory: ./app/android
env:
PLAY_CREDS_JSON: ${{ secrets.PLAY_CREDS_JSON }}