mirror of
https://github.com/meditohq/medito-app.git
synced 2024-08-16 15:40:36 +03:00
chore(ci): add fastlane beta github action workflow for Android
This commit is contained in:
parent
343fc9de2e
commit
7851877c5f
7
.github/scripts/create_auth_dart.sh
vendored
Executable file
7
.github/scripts/create_auth_dart.sh
vendored
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Fixme in https://github.com/meditohq/medito-app/issues/151
|
||||
echo "const BASE_URL = '$BASE_URL';" >> lib/network/auth.dart && \
|
||||
echo "const SENTRY_URL = '$SENTRY_URL';" >> lib/network/auth.dart && \
|
||||
echo "const CONTENT_TOKEN = '$CONTENT_TOKEN';" >> lib/network/auth.dart && \
|
||||
echo "const INIT_TOKEN = '$INIT_TOKEN';" >> lib/network/auth.dart
|
71
.github/workflows/deploy_to_playstore.yml
vendored
Normal file
71
.github/workflows/deploy_to_playstore.yml
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
name: Deploy to Play Store
|
||||
on:
|
||||
workflow_dispatch:
|
||||
# Enable manual run
|
||||
inputs:
|
||||
lane:
|
||||
description: 'Fastlane lane to use (beta OR promote_to_production OR production)'
|
||||
required: true
|
||||
default: 'beta'
|
||||
push:
|
||||
# Sequence of patterns matched against refs/tags
|
||||
tags:
|
||||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
||||
|
||||
jobs:
|
||||
fastlane-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Set up Flutter.
|
||||
- name: Clone Flutter repository with stable channel
|
||||
uses: subosito/flutter-action@v1.5.0
|
||||
with:
|
||||
channel: stable
|
||||
- run: flutter doctor -v
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Fixme: https://github.com/meditohq/medito-app/issues/151
|
||||
- name: Create auth.dart
|
||||
run: sh ./.github/scripts/create_auth_dart.sh
|
||||
env:
|
||||
- BASE_URL: ${{ secrets.AUTH_BASE_URL }}
|
||||
- SENTRY_URL: ${{ secrets.AUTH_SENTRY_URL }}
|
||||
- CONTENT_TOKEN: ${{ secrets.AUTH_CONTENT_TOKEN }}
|
||||
- INIT_TOKEN: ${{ secrets.AUTH_INIT_TOKEN }}
|
||||
|
||||
- name: Get dependencies
|
||||
run: flutter pub get
|
||||
- name: Analyze code
|
||||
run: flutter analyze --no-fatal-warnings --no-fatal-infos .
|
||||
- name: Run test
|
||||
run: flutter test
|
||||
|
||||
# Setup Ruby, Bundler, and Gemfile dependencies
|
||||
- name: Setup Fastlane
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '2.7.2'
|
||||
bundler-cache: true
|
||||
working-directory: android
|
||||
|
||||
- name: Create Upload Keystore file
|
||||
run: |
|
||||
echo "$PLAY_STORE_UPLOAD_KEY" | base64 --decode > app/upload-keystore.jks
|
||||
env:
|
||||
PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }}
|
||||
working-directory: android
|
||||
|
||||
# Build and deploy with Fastlane (by default, to beta track) 🚀.
|
||||
# Naturally, promote_to_production only deploys.
|
||||
- run: bundle exec fastlane ${{ github.event.inputs.lane || 'beta' }}
|
||||
env:
|
||||
PLAY_STORE_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG_JSON }}
|
||||
FCI_KEYSTORE_PATH: 'upload-keystore.jks' # The file is created in the previous step
|
||||
FCI_KEY_ALIAS: ${{ secrets.FCI_KEY_ALIAS }}
|
||||
FCI_KEY_PASSWORD: ${{ secrets.FCI_KEY_PASSWORD }}
|
||||
FCI_KEYSTORE_PASSWORD: ${{ secrets.FCI_KEYSTORE_PASSWORD }}
|
||||
working-directory: android
|
||||
|
||||
# TODO: Build APK, create GH release and upload APK
|
6
android/Gemfile
Normal file
6
android/Gemfile
Normal file
@ -0,0 +1,6 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "fastlane"
|
||||
|
||||
plugins_path = File.join(File.dirname(__FILE__), '.', 'Pluginfile')
|
||||
eval_gemfile(plugins_path) if File.exist?(plugins_path)
|
205
android/Gemfile.lock
Normal file
205
android/Gemfile.lock
Normal file
@ -0,0 +1,205 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.3)
|
||||
addressable (2.7.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
artifactory (3.0.15)
|
||||
atomos (0.1.3)
|
||||
aws-eventstream (1.1.1)
|
||||
aws-partitions (1.461.0)
|
||||
aws-sdk-core (3.114.0)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
aws-partitions (~> 1, >= 1.239.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
jmespath (~> 1.0)
|
||||
aws-sdk-kms (1.43.0)
|
||||
aws-sdk-core (~> 3, >= 3.112.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-s3 (1.95.0)
|
||||
aws-sdk-core (~> 3, >= 3.112.0)
|
||||
aws-sdk-kms (~> 1)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sigv4 (1.2.3)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
babosa (1.0.4)
|
||||
claide (1.0.3)
|
||||
colored (1.2)
|
||||
colored2 (3.1.2)
|
||||
commander (4.6.0)
|
||||
highline (~> 2.0.0)
|
||||
declarative (0.0.20)
|
||||
digest-crc (0.6.3)
|
||||
rake (>= 12.0.0, < 14.0.0)
|
||||
domain_name (0.5.20190701)
|
||||
unf (>= 0.0.5, < 1.0.0)
|
||||
dotenv (2.7.6)
|
||||
emoji_regex (3.2.2)
|
||||
excon (0.81.0)
|
||||
faraday (1.4.2)
|
||||
faraday-em_http (~> 1.0)
|
||||
faraday-em_synchrony (~> 1.0)
|
||||
faraday-excon (~> 1.1)
|
||||
faraday-net_http (~> 1.0)
|
||||
faraday-net_http_persistent (~> 1.1)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
ruby2_keywords (>= 0.0.4)
|
||||
faraday-cookie_jar (0.0.7)
|
||||
faraday (>= 0.8.0)
|
||||
http-cookie (~> 1.0.0)
|
||||
faraday-em_http (1.0.0)
|
||||
faraday-em_synchrony (1.0.0)
|
||||
faraday-excon (1.1.0)
|
||||
faraday-net_http (1.0.1)
|
||||
faraday-net_http_persistent (1.1.0)
|
||||
faraday_middleware (1.0.0)
|
||||
faraday (~> 1.0)
|
||||
fastimage (2.2.3)
|
||||
fastlane (2.184.0)
|
||||
CFPropertyList (>= 2.3, < 4.0.0)
|
||||
addressable (>= 2.3, < 3.0.0)
|
||||
artifactory (~> 3.0)
|
||||
aws-sdk-s3 (~> 1.0)
|
||||
babosa (>= 1.0.3, < 2.0.0)
|
||||
bundler (>= 1.12.0, < 3.0.0)
|
||||
colored
|
||||
commander (~> 4.6)
|
||||
dotenv (>= 2.1.1, < 3.0.0)
|
||||
emoji_regex (>= 0.1, < 4.0)
|
||||
excon (>= 0.71.0, < 1.0.0)
|
||||
faraday (~> 1.0)
|
||||
faraday-cookie_jar (~> 0.0.6)
|
||||
faraday_middleware (~> 1.0)
|
||||
fastimage (>= 2.1.0, < 3.0.0)
|
||||
gh_inspector (>= 1.1.2, < 2.0.0)
|
||||
google-apis-androidpublisher_v3 (~> 0.1)
|
||||
google-apis-playcustomapp_v1 (~> 0.1)
|
||||
google-cloud-storage (~> 1.31)
|
||||
highline (~> 2.0)
|
||||
json (< 3.0.0)
|
||||
jwt (>= 2.1.0, < 3)
|
||||
mini_magick (>= 4.9.4, < 5.0.0)
|
||||
multipart-post (~> 2.0.0)
|
||||
naturally (~> 2.2)
|
||||
plist (>= 3.1.0, < 4.0.0)
|
||||
rubyzip (>= 2.0.0, < 3.0.0)
|
||||
security (= 0.1.3)
|
||||
simctl (~> 1.6.3)
|
||||
terminal-notifier (>= 2.0.0, < 3.0.0)
|
||||
terminal-table (>= 1.4.5, < 2.0.0)
|
||||
tty-screen (>= 0.6.3, < 1.0.0)
|
||||
tty-spinner (>= 0.8.0, < 1.0.0)
|
||||
word_wrap (~> 1.0.0)
|
||||
xcodeproj (>= 1.13.0, < 2.0.0)
|
||||
xcpretty (~> 0.3.0)
|
||||
xcpretty-travis-formatter (>= 0.0.3)
|
||||
gh_inspector (1.1.3)
|
||||
google-apis-androidpublisher_v3 (0.3.0)
|
||||
google-apis-core (~> 0.1)
|
||||
google-apis-core (0.3.0)
|
||||
addressable (~> 2.5, >= 2.5.1)
|
||||
googleauth (~> 0.14)
|
||||
httpclient (>= 2.8.1, < 3.0)
|
||||
mini_mime (~> 1.0)
|
||||
representable (~> 3.0)
|
||||
retriable (>= 2.0, < 4.0)
|
||||
rexml
|
||||
signet (~> 0.14)
|
||||
webrick
|
||||
google-apis-iamcredentials_v1 (0.3.0)
|
||||
google-apis-core (~> 0.1)
|
||||
google-apis-playcustomapp_v1 (0.2.0)
|
||||
google-apis-core (~> 0.1)
|
||||
google-apis-storage_v1 (0.3.0)
|
||||
google-apis-core (~> 0.1)
|
||||
google-cloud-core (1.6.0)
|
||||
google-cloud-env (~> 1.0)
|
||||
google-cloud-errors (~> 1.0)
|
||||
google-cloud-env (1.5.0)
|
||||
faraday (>= 0.17.3, < 2.0)
|
||||
google-cloud-errors (1.1.0)
|
||||
google-cloud-storage (1.31.1)
|
||||
addressable (~> 2.5)
|
||||
digest-crc (~> 0.4)
|
||||
google-apis-iamcredentials_v1 (~> 0.1)
|
||||
google-apis-storage_v1 (~> 0.1)
|
||||
google-cloud-core (~> 1.2)
|
||||
googleauth (~> 0.9)
|
||||
mini_mime (~> 1.0)
|
||||
googleauth (0.16.2)
|
||||
faraday (>= 0.17.3, < 2.0)
|
||||
jwt (>= 1.4, < 3.0)
|
||||
memoist (~> 0.16)
|
||||
multi_json (~> 1.11)
|
||||
os (>= 0.9, < 2.0)
|
||||
signet (~> 0.14)
|
||||
highline (2.0.3)
|
||||
http-cookie (1.0.3)
|
||||
domain_name (~> 0.5)
|
||||
httpclient (2.8.3)
|
||||
jmespath (1.4.0)
|
||||
json (2.5.1)
|
||||
jwt (2.2.3)
|
||||
memoist (0.16.2)
|
||||
mini_magick (4.11.0)
|
||||
mini_mime (1.1.0)
|
||||
multi_json (1.15.0)
|
||||
multipart-post (2.0.0)
|
||||
nanaimo (0.3.0)
|
||||
naturally (2.2.1)
|
||||
os (1.1.1)
|
||||
plist (3.6.0)
|
||||
public_suffix (4.0.6)
|
||||
rake (13.0.3)
|
||||
representable (3.1.1)
|
||||
declarative (< 0.1.0)
|
||||
trailblazer-option (>= 0.1.1, < 0.2.0)
|
||||
uber (< 0.2.0)
|
||||
retriable (3.1.2)
|
||||
rexml (3.2.5)
|
||||
rouge (2.0.7)
|
||||
ruby2_keywords (0.0.4)
|
||||
rubyzip (2.3.0)
|
||||
security (0.1.3)
|
||||
signet (0.15.0)
|
||||
addressable (~> 2.3)
|
||||
faraday (>= 0.17.3, < 2.0)
|
||||
jwt (>= 1.5, < 3.0)
|
||||
multi_json (~> 1.10)
|
||||
simctl (1.6.8)
|
||||
CFPropertyList
|
||||
naturally
|
||||
terminal-notifier (2.0.0)
|
||||
terminal-table (1.8.0)
|
||||
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||
trailblazer-option (0.1.1)
|
||||
tty-cursor (0.7.1)
|
||||
tty-screen (0.8.1)
|
||||
tty-spinner (0.9.3)
|
||||
tty-cursor (~> 0.7)
|
||||
uber (0.1.0)
|
||||
unf (0.1.4)
|
||||
unf_ext
|
||||
unf_ext (0.0.7.7)
|
||||
unicode-display_width (1.7.0)
|
||||
webrick (1.7.0)
|
||||
word_wrap (1.0.0)
|
||||
xcodeproj (1.19.0)
|
||||
CFPropertyList (>= 2.3.3, < 4.0)
|
||||
atomos (~> 0.1.3)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.3.0)
|
||||
xcpretty (0.3.0)
|
||||
rouge (~> 2.0.7)
|
||||
xcpretty-travis-formatter (1.0.1)
|
||||
xcpretty (~> 0.2, >= 0.0.7)
|
||||
|
||||
PLATFORMS
|
||||
x86_64-darwin-20
|
||||
|
||||
DEPENDENCIES
|
||||
fastlane
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.15
|
@ -82,7 +82,7 @@ android {
|
||||
signingConfigs {
|
||||
signingConfigs {
|
||||
release {
|
||||
if (System.getenv()["CI"]) { // CI=true is exported by Codemagic
|
||||
if (System.getenv()["CI"]) { // CI=true is exported by Codemagic or GH Actions
|
||||
storeFile file(System.getenv()["FCI_KEYSTORE_PATH"])
|
||||
storePassword System.getenv()["FCI_KEYSTORE_PASSWORD"]
|
||||
keyAlias System.getenv()["FCI_KEY_ALIAS"]
|
||||
|
1
android/fastlane/Appfile
Normal file
1
android/fastlane/Appfile
Normal file
@ -0,0 +1 @@
|
||||
package_name("meditofoundation.medito") # e.g. com.krausefx.app
|
76
android/fastlane/Fastfile
Normal file
76
android/fastlane/Fastfile
Normal file
@ -0,0 +1,76 @@
|
||||
# This file contains the fastlane.tools configuration
|
||||
# You can find the documentation at https://docs.fastlane.tools
|
||||
#
|
||||
# For a list of all available actions, check out
|
||||
#
|
||||
# https://docs.fastlane.tools/actions
|
||||
#
|
||||
# For a list of all available plugins, check out
|
||||
#
|
||||
# https://docs.fastlane.tools/plugins/available-plugins
|
||||
#
|
||||
|
||||
# Uncomment the line if you want fastlane to automatically update itself
|
||||
# update_fastlane
|
||||
|
||||
default_platform(:android)
|
||||
|
||||
platform :android do
|
||||
desc "Runs all the tests"
|
||||
lane :test do
|
||||
gradle(task: "test")
|
||||
end
|
||||
|
||||
desc "Submit a new beta build to Google Play"
|
||||
lane :beta do
|
||||
sh "flutter build appbundle -v"
|
||||
upload_to_play_store(
|
||||
track: 'beta',
|
||||
aab: '../build/app/outputs/bundle/release/app-release.aab',
|
||||
json_key_data: ENV['PLAY_STORE_CONFIG_JSON'],
|
||||
# Skip all the metadata and screenshots for now
|
||||
skip_upload_metadata: true,
|
||||
skip_upload_images: true,
|
||||
skip_upload_screenshots: true,
|
||||
skip_upload_changelogs: true,
|
||||
# set as "draft" to complete the release at some other time
|
||||
# TODO: remove this after verify fastlane setup works correctly
|
||||
release_status: "draft",
|
||||
)
|
||||
end
|
||||
|
||||
desc "Promote beta track to prod"
|
||||
lane :promote_to_production do
|
||||
upload_to_play_store(
|
||||
track: 'beta',
|
||||
track_promote_to: 'production',
|
||||
json_key_data: ENV['PLAY_STORE_CONFIG_JSON'],
|
||||
# Skip all the metadata and screenshots for now
|
||||
skip_upload_metadata: true,
|
||||
skip_upload_images: true,
|
||||
skip_upload_screenshots: true,
|
||||
skip_upload_changelogs: true,
|
||||
# set as "draft" to complete the release at some other time
|
||||
# TODO: remove this after verify fastlane setup works correctly
|
||||
release_status: "draft",
|
||||
)
|
||||
end
|
||||
|
||||
desc "Submit a new production build to Google Play"
|
||||
lane :production do
|
||||
sh "flutter build appbundle -v"
|
||||
upload_to_play_store(
|
||||
track: 'production',
|
||||
aab: '../build/app/outputs/bundle/release/app-release.aab',
|
||||
json_key_data: ENV['PLAY_STORE_CONFIG_JSON'],
|
||||
# Skip all the metadata and screenshots for now
|
||||
skip_upload_metadata: true,
|
||||
skip_upload_images: true,
|
||||
skip_upload_screenshots: true,
|
||||
skip_upload_changelogs: true,
|
||||
# set as "draft" to complete the release at some other time
|
||||
# TODO: remove this after verify fastlane setup works correctly
|
||||
release_status: "draft",
|
||||
)
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user