Skip to content

Commit

Permalink
Fix the build and release workflow for Android (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsRefsgaard committed Aug 14, 2023
1 parent 4f59c0a commit cb9d3d4
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy_play_store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ jobs:
- name: Setup Fastlane
uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251 # v1.150.0
with:
ruby-version: "2.6"
ruby-version: "head"
bundler-cache: true
working-directory: android

- name: Configure Keystore
run: |
echo "$PLAY_STORE_UPLOAD_KEY" | base64 --decode > app/upload-keystore.jks
echo "$PLAY_STORE_CONFIG_JSON" > PLAY_STORE_CONFIG.json
echo "storeFile=upload-keystore.jks" >> key.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> key.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> key.properties
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> key.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> key.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> key.properties
echo "storeFile=upload-keystore.jks" >> key.properties
env:
PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
Expand All @@ -77,5 +77,5 @@ jobs:
- name: Deploy to Play Store
run: bundle exec fastlane ${{ inputs.lane || 'beta' }}
env:
PLAY_STORE_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG_JSON }}
PLAY_STORE_JSON_KEY: ${{ secrets.PLAY_STORE_JSON_KEY }}
working-directory: android
10 changes: 6 additions & 4 deletions .github/workflows/deploy_play_store_beta.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name: Deploy to Play Store beta
on:
# Enable manual run
push:
branches:
- 'master'
tags:
- '*'
workflow_dispatch:



# Declare default permissions as read only.
permissions: read-all

jobs:
workflow_run:
uses: cph-cachet/carp-studies-app/.github/workflows/deploy_play_store.yml@master
uses: cph-cachet/carp-studies-app/.github/workflows/deploy_play_store.yml@LarsRefsgaard/issue163
secrets: inherit
with:
lane: 'beta'
9 changes: 5 additions & 4 deletions .github/workflows/deploy_play_store_prod.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Deploy to Play Store production
on:
# Enable manual run
push:
tags:
- '*'
release:
types:
- released
workflow_dispatch:


# Declare default permissions as read only.
Expand All @@ -12,5 +12,6 @@ permissions: read-all
jobs:
workflow_run:
uses: cph-cachet/carp-studies-app/.github/workflows/deploy_play_store.yml@master
secrets: inherit
with:
lane: 'promote_to_production'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,4 @@ app.*.map.json
lib/blocs/credentials.dart
carp/carpspec.yaml
android/key.properties
android/fastlane/report.xml
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (flutterRoot == null) {

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '18'
flutterVersionCode = '19'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
Expand Down
2 changes: 1 addition & 1 deletion android/fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package_name("dk.cachet.carp_study_app") #
json_key_file("PLAY_STORE_CONFIG.json")
json_key_file("PLAY_STORE_CONFIG.json")

0 comments on commit cb9d3d4

Please sign in to comment.