-
Notifications
You must be signed in to change notification settings - Fork 12
97 lines (94 loc) · 3.33 KB
/
deploy-apps.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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
- run: |
bundle install
bundle exec fastlane actions
working-directory: ./app/android
- name: Set up flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- 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: Decrypt files
id: decrypt_files
run: |
echo "${{ secrets.STUDYU_ANDROID_KEYSTORE }}" > keystore.jks.asc
gpg -d --passphrase "${{ secrets.STUDYU_ANDROID_KEYSTORE_PASSWORD }}" --batch keystore.jks.asc > app/android/app/studyu-keystore.jks
echo "${{ secrets.STUDYU_KEY_PROPERTIES}}" > app/android/key.properties
# cd app/android/
# bundle install
# bundle exec fastlane actions
# working-directory: ./app
# - 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
# todo key also needs to involve decrypted files
# key: flutter_v${{ env.flutter_version_hash }}-${{ hashFiles('**/pubspec.lock') }}-${{ runner.os }}
# restore-keys: |
# flutter_v${{ env.flutter_version_hash }}-${{ hashFiles('**/pubspec.lock') }}-
- name: Build StudyU app bundle
if: steps.cache-studyu-app-bundle-restore.outputs.cache-hit != 'true'
# todo add --release
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: Fastlane upload
run: bundle exec fastlane deploy_internal
working-directory: ./app/android
env:
PLAY_CREDS_JSON: ${{ secrets.PLAY_CREDS_JSON }}