Skip to content

Commit

Permalink
Add workflow files for todoapp, change workflow files in .github
Browse files Browse the repository at this point in the history
  • Loading branch information
JvnSlv committed Sep 19, 2024
1 parent 47fb5a6 commit a8aca13
Show file tree
Hide file tree
Showing 12 changed files with 922 additions and 170 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_and_deploy_booking_app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

build_android_app:
needs: app_version_extraction
uses: ./.github/workflows/fastlane_android_custom_build_and_deploy.yaml
uses: ./.github/workflows/fastlane_build_and_deploy_android_app.yaml
with:
flutter_version: "3.13.9"
project_path: "examples/booking_app"
Expand All @@ -46,7 +46,7 @@ jobs:

build_ios_app:
needs: app_version_extraction
uses: ./.github/workflows/fastlane_ios_custom_build_and_deploy.yaml
uses: ./.github/workflows/fastlane_build_and_deploy_ios_app.yaml
with:
flutter_version: "3.13.9"
project_path: "examples/booking_app"
Expand Down
83 changes: 0 additions & 83 deletions .github/workflows/fastlane_android_custom_build_and_deploy.yaml

This file was deleted.

113 changes: 113 additions & 0 deletions .github/workflows/fastlane_build_and_deploy_android_app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: "Custom build and deploy Android app"

on:
workflow_call:
inputs:
build_name:
type: string
required: true
description: 'The version of the app (example: 1.0.0)'
build_number:
type: string
required: true
description: 'The build number of the app'
project_path:
type: string
default: '.'
required: false
description: 'The location of the flutter project within the repository'
flutter_version:
type: string
default: ''
required: false
description: 'The flutter version used to build the project'
flavor:
type: string
default: 'production'
description: 'The app environment used to build the app'
required: false
publish_to_store:
type: boolean
default: false
description: 'Should the app be published to the Google play store'
required: false
secrets:
credential_encryption_password:
required: true
credential_repository_access_secret:
required: true

jobs:
build_android:
defaults:
run:
working-directory: ${{ inputs.project_path }}
runs-on: ubuntu-latest
env:
CREDENTIAL_ENCRYPTION_PASSWORD: ${{ secrets.credential_encryption_password }}
CREDENTIAL_REPOSITORY_ACCESS_SECRET: ${{ secrets.credential_repository_access_secret }}
BUNDLE_GEMFILE: ${{ inputs.project_path }}/Gemfile
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ inputs.flutter_version }}
channel: "stable"
- name: Setup Ruby env
uses: ruby/[email protected]
with:
ruby-version: 3.1.0
bundler-cache: true
- name: Configure Ruby
run: |
bundle install
bundle lock --add-platform ruby
bundle lock --add-platform x86_64-linux
- name: Build and sign Android app
run: |
bundle exec fastlane build_custom platform:android environment:${{ inputs.flavor }} build_name:${{ inputs.build_name }} build_number:${{ inputs.build_number }}
- name: Prepare config
run: mv "${{ inputs.project_path }}/devops/artifacts/deployment.yaml" "${{ inputs.project_path }}/devops/artifacts/android-deployment.yaml"
- name: Upload artifact - .aab
uses: actions/upload-artifact@v4
with:
name: app-${{ inputs.flavor }}-release.aab
path: "${{ inputs.project_path }}/devops/artifacts/app-${{ inputs.flavor }}-release.aab"
- name: Upload artifact - deployment config
uses: actions/upload-artifact@v4
with:
name: android-deployment.yaml
path: "${{ inputs.project_path }}/devops/artifacts/android-deployment.yaml"

deploy_to_google_play:
if: ${{ inputs.publish_to_store }}
needs: build_android
defaults:
run:
working-directory: ${{ inputs.project_path }}
runs-on: ubuntu-latest
env:
CREDENTIAL_ENCRYPTION_PASSWORD: ${{ secrets.credential_encryption_password }}
CREDENTIAL_REPOSITORY_ACCESS_SECRET: ${{ secrets.credential_repository_access_secret }}
BUNDLE_GEMFILE: ${{ inputs.project_path }}/Gemfile
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: "${{ inputs.project_path }}/devops/artifacts/"
merge-multiple: true
- name: Rename config
run: mv "${{ inputs.project_path }}/devops/artifacts/android-deployment.yaml" "${{ inputs.project_path }}/devops/artifacts/deployment.yaml"
- name: Setup Ruby env
uses: ruby/[email protected]
with:
ruby-version: 3.1.0
bundler-cache: true
- name: Configure Ruby
run: |
bundle install
bundle lock --add-platform ruby
bundle lock --add-platform x86_64-linux
- name: Publish to Google Play
run: bundle exec fastlane deploy
114 changes: 114 additions & 0 deletions .github/workflows/fastlane_build_and_deploy_ios_app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: "Custom build and deploy iOS app"

on:
workflow_call:
inputs:
build_name:
type: string
required: true
description: 'The version of the app (example: 1.0.0)'
build_number:
type: string
required: true
description: 'The build number of the app'
project_path:
type: string
default: '.'
required: false
description: 'The location of the flutter project within the repository'
flutter_version:
type: string
default: ''
required: false
description: 'The flutter version used to build the project'
flavor:
type: string
default: 'production'
description: 'The app environment used to build the app'
required: false
publish_to_store:
type: boolean
default: false
description: 'Should the app be published to the App store'
required: false
secrets:
credential_encryption_password:
required: true
credential_repository_access_secret:
required: true

jobs:
build_ios:
defaults:
run:
working-directory: ${{ inputs.project_path }}
runs-on: macos-latest
env:
CREDENTIAL_ENCRYPTION_PASSWORD: ${{ secrets.credential_encryption_password }}
CREDENTIAL_REPOSITORY_ACCESS_SECRET: ${{ secrets.credential_repository_access_secret }}
BUNDLE_GEMFILE: ${{ inputs.project_path }}/Gemfile
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ inputs.flutter_version }}
channel: "stable"
- name: Setup Ruby env
uses: ruby/[email protected]
with:
ruby-version: 3.1.0
bundler-cache: true
- name: Configure Ruby
run: |
bundle install
bundle lock --add-platform ruby
bundle lock --add-platform x86_64-darwin21
bundle exec gem install cocoapods
- name: Build and sign iOS app
run: |
bundle exec fastlane build_custom platform:ios environment:${{ inputs.flavor }} build_name:${{ inputs.build_name }} build_number:${{ inputs.build_number }}
- name: Prepare config
run: mv "${{ inputs.project_path }}/devops/artifacts/deployment.yaml" "${{ inputs.project_path }}/devops/artifacts/ios-deployment.yaml"
- name: Upload artifact - .ipa
uses: actions/upload-artifact@v4
with:
name: app-${{ inputs.flavor }}-release.ipa
path: "${{ inputs.project_path }}/devops/artifacts/Runner.ipa"
- name: Upload artifact - deployment config
uses: actions/upload-artifact@v4
with:
name: ios-deployment.yaml
path: "${{ inputs.project_path }}/devops/artifacts/ios-deployment.yaml"

deploy_to_test_flight:
if: ${{ inputs.publish_to_store }}
needs: build_ios
defaults:
run:
working-directory: ${{ inputs.project_path }}
runs-on: macos-latest
env:
CREDENTIAL_ENCRYPTION_PASSWORD: ${{ secrets.credential_encryption_password }}
CREDENTIAL_REPOSITORY_ACCESS_SECRET: ${{ secrets.credential_repository_access_secret }}
BUNDLE_GEMFILE: ${{ inputs.project_path }}/Gemfile
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: "${{ inputs.project_path }}/devops/artifacts/"
merge-multiple: true
- name: Rename config
run: mv "${{ inputs.project_path }}/devops/artifacts/ios-deployment.yaml" "${{ inputs.project_path }}/devops/artifacts/deployment.yaml"
- name: Setup Ruby env
uses: ruby/[email protected]
with:
ruby-version: 3.1.0
bundler-cache: true
- name: Configure Ruby
run: |
bundle install
bundle lock --add-platform ruby
bundle lock --add-platform x86_64-darwin21
- name: Publish to Test Flight
run: bundle exec fastlane deploy
Loading

0 comments on commit a8aca13

Please sign in to comment.