feat: Update github action and fastlane configuration

This commit is contained in:
Anton Stubenbord
2023-06-10 16:46:30 +02:00
parent 1b957ab9b7
commit d517159fdb
2 changed files with 19 additions and 71 deletions

View File

@@ -5,21 +5,18 @@ on:
# Enable manual run
workflow_dispatch:
inputs:
lane:
description: "Fastlane lane"
required: true
default: "alpha"
track:
description: "Track"
type: choice
default: beta
options:
- internal
- promote_to_alpha
- alpha
- promote_to_beta
- beta
- promote_to_production
- production
is_draft:
description: "Only create a draft and don't automatically publish?"
description: "Mark as draft"
required: true
default: true
type: boolean
@@ -64,8 +61,7 @@ jobs:
working-directory: android
# Build and deploy with Fastlane
# Naturally, promote_to_{alpha|beta|production} only deploys.
- run: bundle exec fastlane ${{ github.event.inputs.lane }} is_draft:${{ github.event.inputs.is_draft }}
- run: bundle exec fastlane publish_in_play_store is_draft:${{ github.event.inputs.is_draft }} track:${{ github.event.inputs.track }}
env:
PLAY_STORE_CREDENTIALS: ${{ secrets.PLAY_STORE_CREDENTIALS }}
working-directory: android

View File

@@ -21,78 +21,30 @@ platform :android do |options|
gradle(task: "test")
end
desc "Submit a new internal build to Google Play"
lane :internal do |options|
desc "Submit build to Google Play"
lane :publish_in_play_store do |options|
release_status = (options[:is_draft] ? "draft" : "completed")
track = (options[:track])
sh "flutter build appbundle -v"
upload_to_play_store(
track: 'internal',
track: track,
release_status: release_status,
aab: '../build/app/outputs/bundle/release/app-release.aab',
json_key_data: ENV['PLAY_STORE_CREDENTIALS'],
release_status: options[:is_draft] ? "draft" : "completed",
)
end
desc "Promote internal track to alpha"
lane :promote_to_alpha do |options|
desc "Promote track"
lane :play_store_promote do |options|
track = options[:track]
promote_to = options[:promote_to_track]
upload_to_play_store(
track: 'internal',
track_promote_to: 'alpha',
track: track,
track_promote_to: promote_to,
json_key_data: ENV['PLAY_STORE_CREDENTIALS'],
)
end
desc "Submit a new alpha build to Google Play"
lane :alpha do |options|
sh "flutter build appbundle -v"
upload_to_play_store(
track: 'alpha',
aab: '../build/app/outputs/bundle/release/app-release.aab',
json_key_data: ENV['PLAY_STORE_CREDENTIALS'],
release_status: options[:is_draft] ? "draft" : "completed",
)
end
desc "Promote alpha track to beta"
lane :promote_to_beta do |options|
upload_to_play_store(
track: 'alpha',
track_promote_to: 'beta',
json_key_data: ENV['PLAY_STORE_CREDENTIALS'],
)
end
desc "Submit a new beta build to Google Play"
lane :beta do |options|
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_CREDENTIALS'],
release_status: options[:is_draft] ? "draft" : "completed",
)
end
desc "Promote beta track to prod"
lane :promote_to_production do |options|
upload_to_play_store(
track: 'beta',
track_promote_to: 'production',
json_key_data: ENV['PLAY_STORE_CREDENTIALS'],
)
end
desc "Submit a new production build to Google Play"
lane :production do |options|
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_CREDENTIALS'],
release_status: options[:is_draft] ? "draft" : "completed",
)
end
desc "Builds apks and creates a new release on GitHub"
lane :github do |options|
sh "flutter build apk --split-per-abi --release"