From 6d36c2d528165b7de802cf7dd3c81e93e9431d0a Mon Sep 17 00:00:00 2001 From: Jagandeep Brar Date: Sun, 16 Jan 2022 22:49:01 -0500 Subject: [PATCH] new(ci): Separate build and deploy jobs, allow selecting build platforms --- ...and_deploy.yml => build_all_platforms.yml} | 86 +++++++++++++++---- .github/workflows/build_android.yml | 37 +++++--- .github/workflows/build_ios.yml | 55 ++++++------ .github/workflows/build_macos.yml | 55 ++++++------ .github/workflows/deploy_android.yml | 45 ++++++++++ .github/workflows/deploy_ios.yml | 62 +++++++++++++ .github/workflows/deploy_macos.yml | 62 +++++++++++++ ....yml => github_issues_feature_request.yml} | 2 +- ...{support.yml => github_issues_support.yml} | 2 +- .ruby-version | 1 + android/fastlane/Fastfile | 12 ++- android/fastlane/README.md | 14 ++- ios/fastlane/Fastfile | 34 +++++--- ios/fastlane/README.md | 30 ++++++- macos/fastlane/Fastfile | 34 +++++--- macos/fastlane/README.md | 30 ++++++- 16 files changed, 439 insertions(+), 122 deletions(-) rename .github/workflows/{build_and_deploy.yml => build_all_platforms.yml} (61%) create mode 100644 .github/workflows/deploy_android.yml create mode 100644 .github/workflows/deploy_ios.yml create mode 100644 .github/workflows/deploy_macos.yml rename .github/workflows/{feature_request.yml => github_issues_feature_request.yml} (94%) rename .github/workflows/{support.yml => github_issues_support.yml} (95%) create mode 100644 .ruby-version diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_all_platforms.yml similarity index 61% rename from .github/workflows/build_and_deploy.yml rename to .github/workflows/build_all_platforms.yml index a1ec1674..d56cdcab 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_all_platforms.yml @@ -1,4 +1,4 @@ -name: 'Build & Deploy' +name: 'Build & Deploy All Platforms' on: workflow_dispatch: @@ -6,14 +6,33 @@ on: flavor: type: choice required: true - description: 'Build Flavor?' + description: 'Build Flavor' options: + - 'internal' - 'alpha' - 'beta' - - 'production' + + android: + type: boolean + required: true + description: 'Build for Android' + default: "true" + + ios: + type: boolean + required: true + description: 'Build for iOS' + default: "true" + + macos: + type: boolean + required: true + description: 'Build for macOS' + default: "true" jobs: - android: + build_android: + if: ${{ github.event.inputs.android == 'true' }} uses: CometTools/LunaSea/.github/workflows/build_android.yml@master with: flavor: ${{ github.event.inputs.flavor }} @@ -21,26 +40,62 @@ jobs: GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} KEY_JKS: ${{ secrets.KEY_JKS }} KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }} - GOOGLE_PLAY_API: ${{ secrets.GOOGLE_PLAY_API }} - ios: + + build_ios: + if: ${{ github.event.inputs.ios == 'true' }} uses: CometTools/LunaSea/.github/workflows/build_ios.yml@master with: flavor: ${{ github.event.inputs.flavor }} secrets: APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} - APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }} - APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} - APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} - APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} GOOGLE_SERVICE_INFO_PLIST: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} - MATCH_SSH_PRIVATE_KEY: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} - macos: + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + MATCH_SSH_PRIVATE_KEY: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} + + build_macos: + if: ${{ github.event.inputs.macos == 'true' }} uses: CometTools/LunaSea/.github/workflows/build_macos.yml@master + with: + flavor: ${{ github.event.inputs.flavor }} + secrets: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + GOOGLE_SERVICE_INFO_PLIST: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} + MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} + MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + MATCH_SSH_PRIVATE_KEY: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} + + deploy_android: + needs: build_android + uses: CometTools/LunaSea/.github/workflows/deploy_android.yml@master + with: + flavor: ${{ github.event.inputs.flavor }} + secrets: + GOOGLE_PLAY_API: ${{ secrets.GOOGLE_PLAY_API }} + + deploy_ios: + needs: build_ios + uses: CometTools/LunaSea/.github/workflows/deploy_ios.yml@master + with: + flavor: ${{ github.event.inputs.flavor }} + secrets: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} + APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }} + APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} + APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} + APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + + deploy_macos: + needs: build_macos + uses: CometTools/LunaSea/.github/workflows/deploy_macos.yml@master with: flavor: ${{ github.event.inputs.flavor }} secrets: @@ -51,8 +106,3 @@ jobs: APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - GOOGLE_SERVICE_INFO_PLIST: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} - MATCH_SSH_PRIVATE_KEY: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} - MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} diff --git a/.github/workflows/build_android.yml b/.github/workflows/build_android.yml index eb50b79b..61e8c169 100644 --- a/.github/workflows/build_android.yml +++ b/.github/workflows/build_android.yml @@ -1,6 +1,17 @@ -name: '[Build] Android' +name: '[Android] Build' on: + workflow_dispatch: + inputs: + flavor: + type: choice + required: true + description: 'Build Flavor' + options: + - 'internal' + - 'alpha' + - 'beta' + workflow_call: inputs: flavor: @@ -13,11 +24,10 @@ on: required: true KEY_PROPERTIES: required: true - GOOGLE_PLAY_API: - required: true jobs: build: + name: 'Build Signed Android App Bundle' runs-on: macos-latest steps: @@ -30,27 +40,26 @@ jobs: - name: Set Flavor working-directory: ${{ github.workspace }} run: | - echo $'FLAVOR=${{ inputs.flavor }}\nCOMMIT=${{ github.sha }}' > .flavor + echo $'FLAVOR=${{ (github.event.inputs || inputs).flavor }}\nCOMMIT=${{ github.sha }}' > .flavor - name: Install Secret Keys + working-directory: ${{ github.workspace }} run: | echo ${{ secrets.GOOGLE_SERVICES_JSON }} | base64 --decode > android/app/google-services.json echo ${{ secrets.KEY_JKS }} | base64 --decode > android/key.jks echo ${{ secrets.KEY_PROPERTIES }} | base64 --decode > android/key.properties - echo ${{ secrets.GOOGLE_PLAY_API }} | base64 --decode > .fastlane-android-auth.json - name: Install Ruby uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7.5' - name: Install Java - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: - java-version: '12.x' + distribution: 'zulu' + java-version: '11' - name: Install Flutter - uses: subosito/flutter-action@v2.0.3 + uses: subosito/flutter-action@v2 with: channel: 'beta' @@ -66,4 +75,10 @@ jobs: SUPPLY_JSON_KEY: ${{ github.workspace }}/.fastlane-android-auth.json run: | bundle install - bundle exec fastlane build_and_deploy + bundle exec fastlane build + + - name: Upload App Bundle Artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ github.sha }}-${{ (github.event.inputs || inputs).flavor }}-android + path: ${{ github.workspace }}/build/app/outputs/bundle/release/app-release.aab diff --git a/.github/workflows/build_ios.yml b/.github/workflows/build_ios.yml index 54907f05..7e7bb364 100644 --- a/.github/workflows/build_ios.yml +++ b/.github/workflows/build_ios.yml @@ -1,6 +1,17 @@ -name: '[Build] iOS' +name: '[iOS] Build' on: + workflow_dispatch: + inputs: + flavor: + type: choice + required: true + description: 'Build Flavor' + options: + - 'internal' + - 'alpha' + - 'beta' + workflow_call: inputs: flavor: @@ -11,29 +22,22 @@ on: required: true APPLE_ITC_TEAM_ID: required: true - APPLE_STORE_CONNECT_KEY: - required: true - APPLE_STORE_CONNECT_KEY_FILEPATH: - required: true - APPLE_STORE_CONNECT_KEY_ID: - required: true - APPLE_STORE_CONNECT_ISSUER_ID: - required: true APPLE_TEAM_ID: required: true GOOGLE_SERVICE_INFO_PLIST: required: true - MATCH_SSH_PRIVATE_KEY: - required: true - MATCH_PASSWORD: - required: true MATCH_KEYCHAIN_NAME: required: true MATCH_KEYCHAIN_PASSWORD: required: true + MATCH_PASSWORD: + required: true + MATCH_SSH_PRIVATE_KEY: + required: true jobs: build: + name: 'Build Signed iOS App Package' runs-on: macos-latest steps: @@ -46,7 +50,7 @@ jobs: - name: Set Flavor working-directory: ${{ github.workspace }} run: | - echo $'FLAVOR=${{ inputs.flavor }}\nCOMMIT=${{ github.sha }}' > .flavor + echo $'FLAVOR=${{ (github.event.inputs || inputs).flavor }}\nCOMMIT=${{ github.sha }}' > .flavor - name: Select Xcode Version uses: maxim-lobanov/setup-xcode@v1 @@ -57,8 +61,7 @@ jobs: working-directory: ${{ github.workspace }} run: | echo ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} | base64 --decode > ios/GoogleService-Info.plist - echo ${{ secrets.APPLE_STORE_CONNECT_KEY }} | base64 --decode > ios/${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} - + - name: Setup SSH Agent uses: webfactory/ssh-agent@v0.5.4 with: @@ -66,16 +69,9 @@ jobs: - name: Install Ruby uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7.5' - - - name: Install Java - uses: actions/setup-java@v1 - with: - java-version: '12.x' - name: Install Flutter - uses: subosito/flutter-action@v2.0.3 + uses: subosito/flutter-action@v2 with: channel: 'beta' @@ -99,9 +95,12 @@ jobs: MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} - APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} - APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} - APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} run: | bundle install - bundle exec fastlane build_and_deploy + bundle exec fastlane build + + - name: Upload App Package Artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ github.sha }}-${{ (github.event.inputs || inputs).flavor }}-ios + path: ${{ github.workspace }}/ios/Runner.ipa diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml index 7a996385..46469dbd 100644 --- a/.github/workflows/build_macos.yml +++ b/.github/workflows/build_macos.yml @@ -1,6 +1,17 @@ -name: '[Build] macOS' +name: '[macOS] Build' on: + workflow_dispatch: + inputs: + flavor: + type: choice + required: true + description: 'Build Flavor' + options: + - 'internal' + - 'alpha' + - 'beta' + workflow_call: inputs: flavor: @@ -11,29 +22,22 @@ on: required: true APPLE_ITC_TEAM_ID: required: true - APPLE_STORE_CONNECT_KEY: - required: true - APPLE_STORE_CONNECT_KEY_FILEPATH: - required: true - APPLE_STORE_CONNECT_KEY_ID: - required: true - APPLE_STORE_CONNECT_ISSUER_ID: - required: true APPLE_TEAM_ID: required: true GOOGLE_SERVICE_INFO_PLIST: required: true - MATCH_SSH_PRIVATE_KEY: - required: true - MATCH_PASSWORD: - required: true MATCH_KEYCHAIN_NAME: required: true MATCH_KEYCHAIN_PASSWORD: required: true + MATCH_PASSWORD: + required: true + MATCH_SSH_PRIVATE_KEY: + required: true jobs: build: + name: 'Build Signed macOS App Package' runs-on: macos-latest steps: @@ -46,7 +50,7 @@ jobs: - name: Set Flavor working-directory: ${{ github.workspace }} run: | - echo $'FLAVOR=${{ inputs.flavor }}\nCOMMIT=${{ github.sha }}' > .flavor + echo $'FLAVOR=${{ (github.event.inputs || inputs).flavor }}\nCOMMIT=${{ github.sha }}' > .flavor - name: Select Xcode Version uses: maxim-lobanov/setup-xcode@v1 @@ -57,7 +61,6 @@ jobs: working-directory: ${{ github.workspace }} run: | echo ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} | base64 --decode > macos/GoogleService-Info.plist - echo ${{ secrets.APPLE_STORE_CONNECT_KEY }} | base64 --decode > macos/${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} - name: Setup SSH Agent uses: webfactory/ssh-agent@v0.5.4 @@ -66,16 +69,9 @@ jobs: - name: Install Ruby uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7.5' - - - name: Install Java - uses: actions/setup-java@v1 - with: - java-version: '12.x' - name: Install Flutter - uses: subosito/flutter-action@v2.0.3 + uses: subosito/flutter-action@v2 with: channel: 'beta' @@ -97,12 +93,15 @@ jobs: APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} - APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} - APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} - APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} run: | bundle install - bundle exec fastlane build_and_deploy + bundle exec fastlane build + + - name: Upload App Package Artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ github.sha }}-${{ (github.event.inputs || inputs).flavor }}-macos + path: ${{ github.workspace }}/macos/LunaSea.pkg diff --git a/.github/workflows/deploy_android.yml b/.github/workflows/deploy_android.yml new file mode 100644 index 00000000..9ae5e10f --- /dev/null +++ b/.github/workflows/deploy_android.yml @@ -0,0 +1,45 @@ +name: '[Android] Deploy' + +on: + workflow_call: + inputs: + flavor: + required: true + type: string + secrets: + GOOGLE_PLAY_API: + required: true + +jobs: + deploy: + name: 'Deploy to Google Play Store' + runs-on: macos-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + with: + ref: 'master' + fetch-depth: 0 + + - name: Download App Bundle Artifact + uses: actions/download-artifact@v2 + with: + name: ${{ github.sha }}-${{ (github.event.inputs || inputs).flavor }}-android + path: ${{ github.workspace }} + + - name: Install Secret Keys + working-directory: ${{ github.workspace }} + run: | + echo ${{ secrets.GOOGLE_PLAY_API }} | base64 --decode > .fastlane-android-auth.json + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + + - name: Deploy to Google Play Store + working-directory: ${{ github.workspace }}/android + env: + SUPPLY_JSON_KEY: ${{ github.workspace }}/.fastlane-android-auth.json + run: | + bundle install + bundle exec fastlane deploy flavor:${{ (github.event.inputs || inputs).flavor }} aab:${{ github.workspace }}/app-release.aab diff --git a/.github/workflows/deploy_ios.yml b/.github/workflows/deploy_ios.yml new file mode 100644 index 00000000..279b35bb --- /dev/null +++ b/.github/workflows/deploy_ios.yml @@ -0,0 +1,62 @@ +name: '[iOS] Deploy' + +on: + workflow_call: + inputs: + flavor: + required: true + type: string + secrets: + APPLE_ID: + required: true + APPLE_ITC_TEAM_ID: + required: true + APPLE_STORE_CONNECT_ISSUER_ID: + required: true + APPLE_STORE_CONNECT_KEY: + required: true + APPLE_STORE_CONNECT_KEY_FILEPATH: + required: true + APPLE_STORE_CONNECT_KEY_ID: + required: true + APPLE_TEAM_ID: + required: true + +jobs: + deploy: + name: 'Deploy to App Store Connect' + runs-on: macos-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + with: + ref: 'master' + fetch-depth: 0 + + - name: Download App Package Artifact + uses: actions/download-artifact@v2 + with: + name: ${{ github.sha }}-${{ (github.event.inputs || inputs).flavor }}-ios + path: ${{ github.workspace }} + + - name: Install Secret Keys + working-directory: ${{ github.workspace }} + run: | + echo ${{ secrets.APPLE_STORE_CONNECT_KEY }} | base64 --decode > ios/${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + + - name: Deploy to App Store Connect + working-directory: ${{ github.workspace }}/ios + env: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} + APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} + APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} + APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + run: | + bundle install + bundle exec fastlane deploy flavor:${{ (github.event.inputs || inputs).flavor }} ipa:${{ github.workspace }}/Runner.ipa diff --git a/.github/workflows/deploy_macos.yml b/.github/workflows/deploy_macos.yml new file mode 100644 index 00000000..19584e9d --- /dev/null +++ b/.github/workflows/deploy_macos.yml @@ -0,0 +1,62 @@ +name: '[macOS] Deploy' + +on: + workflow_call: + inputs: + flavor: + required: true + type: string + secrets: + APPLE_ID: + required: true + APPLE_ITC_TEAM_ID: + required: true + APPLE_STORE_CONNECT_ISSUER_ID: + required: true + APPLE_STORE_CONNECT_KEY: + required: true + APPLE_STORE_CONNECT_KEY_FILEPATH: + required: true + APPLE_STORE_CONNECT_KEY_ID: + required: true + APPLE_TEAM_ID: + required: true + +jobs: + deploy: + name: 'Deploy to App Store Connect' + runs-on: macos-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + with: + ref: 'master' + fetch-depth: 0 + + - name: Download App Package Artifact + uses: actions/download-artifact@v2 + with: + name: ${{ github.sha }}-${{ (github.event.inputs || inputs).flavor }}-macos + path: ${{ github.workspace }} + + - name: Install Secret Keys + working-directory: ${{ github.workspace }} + run: | + echo ${{ secrets.APPLE_STORE_CONNECT_KEY }} | base64 --decode > macos/${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + + - name: Deploy to App Store Connect + working-directory: ${{ github.workspace }}/macos + env: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} + APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} + APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} + APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + run: | + bundle install + bundle exec fastlane deploy flavor:${{ (github.event.inputs || inputs).flavor }} pkg:${{ github.workspace }}/LunaSea.pkg diff --git a/.github/workflows/feature_request.yml b/.github/workflows/github_issues_feature_request.yml similarity index 94% rename from .github/workflows/feature_request.yml rename to .github/workflows/github_issues_feature_request.yml index 175185d1..9c48cd28 100644 --- a/.github/workflows/feature_request.yml +++ b/.github/workflows/github_issues_feature_request.yml @@ -1,4 +1,4 @@ -name: '[Issues] Feature Requests' +name: '[GitHub] Issues - Feature Requests' on: issues: diff --git a/.github/workflows/support.yml b/.github/workflows/github_issues_support.yml similarity index 95% rename from .github/workflows/support.yml rename to .github/workflows/github_issues_support.yml index 63c82613..fa4c07ac 100644 --- a/.github/workflows/support.yml +++ b/.github/workflows/github_issues_support.yml @@ -1,4 +1,4 @@ -name: '[Issues] Support' +name: '[GitHub] Issues - Support' on: issues: diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 00000000..460b6fd4 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.7.5 \ No newline at end of file diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 25e6977f..56a1dda5 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -2,12 +2,16 @@ default_platform(:android) build_number = 1000000000 + number_of_commits() platform :android do - desc "Build and deploy a new build of LunaSea" - lane :build_and_deploy do + desc "Build App Bundle" + lane :build do sh("flutter", "build", "appbundle", "--release", "--bundle-sksl-path=shaders/android_sksl.json", "--build-number=#{build_number}") + end + + desc "Deploy to Google Play Store" + lane :deploy do |options| upload_to_play_store( - track: "alpha", - aab: "../build/app/outputs/bundle/release/app-release.aab", + track: options[:flavor] || "internal", + aab: options[:aab] || "../build/app/outputs/bundle/release/app-release.aab", skip_upload_metadata: true, skip_upload_changelogs: true, skip_upload_images: true, diff --git a/android/fastlane/README.md b/android/fastlane/README.md index 1d1f1234..9d3ce1bf 100644 --- a/android/fastlane/README.md +++ b/android/fastlane/README.md @@ -15,13 +15,21 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do ## Android -### android build_and_deploy +### android build ```sh -[bundle exec] fastlane android build_and_deploy +[bundle exec] fastlane android build ``` -Build and deploy a new build of LunaSea +Build App Bundle + +### android deploy + +```sh +[bundle exec] fastlane android deploy +``` + +Deploy to Google Play Store ### android metadata diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index a7f612a8..337705ee 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -2,8 +2,8 @@ default_platform(:ios) build_number = 1000000000 + number_of_commits() platform :ios do - desc "Build and deploy a new build of LunaSea" - lane :build_and_deploy do + desc "Setup the LunaSea Keychain" + lane :prepare_keychain do create_keychain( name: ENV["MATCH_KEYCHAIN_NAME"], password: ENV["MATCH_KEYCHAIN_PASSWORD"], @@ -19,24 +19,36 @@ platform :ios do keychain_name: ENV['MATCH_KEYCHAIN_NAME'], keychain_password: ENV["MATCH_KEYCHAIN_PASSWORD"], ) + end + desc "Destroy the LunaSea Keychain" + lane :destroy_keychain do + delete_keychain(name: ENV["MATCH_KEYCHAIN_NAME"]) + end + + desc "Build App Package" + lane :build do + prepare_keychain + sh("flutter", "build", "ios", "--release", "--bundle-sksl-path=shaders/ios_sksl.json", "--no-codesign", "--build-number=#{build_number}") + build_ios_app(scheme: "Runner", workspace: "Runner.xcworkspace", export_method: "app-store") + destroy_keychain + end + + desc "Deploy to App Store Connect" + lane :deploy do |options| api_key = app_store_connect_api_key( key_id: ENV["APPLE_STORE_CONNECT_KEY_ID"], issuer_id: ENV["APPLE_STORE_CONNECT_ISSUER_ID"], key_filepath: ENV["APPLE_STORE_CONNECT_KEY_FILEPATH"], ) - sh("flutter", "build", "ios", "--release", "--bundle-sksl-path=shaders/ios_sksl.json", "--no-codesign", "--build-number=#{build_number}") - build_ios_app(scheme: "Runner", workspace: "Runner.xcworkspace", export_method: "app-store") - upload_to_testflight( - distribute_external: false, - notify_external_testers: false, - reject_build_waiting_for_review: true, - groups: "Alpha", changelog: "The changelog is available within the application!", + distribute_external: true, + groups: options[:flavor] || "internal", + ipa: options[:ipa] || "../ios/Runner.ipa", + notify_external_testers: true, + reject_build_waiting_for_review: true, ) - - delete_keychain(name: ENV["MATCH_KEYCHAIN_NAME"]) end end diff --git a/ios/fastlane/README.md b/ios/fastlane/README.md index 5f57e4b3..64ab7556 100644 --- a/ios/fastlane/README.md +++ b/ios/fastlane/README.md @@ -15,13 +15,37 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do ## iOS -### ios build_and_deploy +### ios prepare_keychain ```sh -[bundle exec] fastlane ios build_and_deploy +[bundle exec] fastlane ios prepare_keychain ``` -Build and deploy a new build of LunaSea +Setup the LunaSea Keychain + +### ios destroy_keychain + +```sh +[bundle exec] fastlane ios destroy_keychain +``` + +Destroy the LunaSea Keychain + +### ios build + +```sh +[bundle exec] fastlane ios build +``` + +Build App Package + +### ios deploy + +```sh +[bundle exec] fastlane ios deploy +``` + +Deploy to App Store Connect ---- diff --git a/macos/fastlane/Fastfile b/macos/fastlane/Fastfile index 6b9abc2b..53b556fc 100644 --- a/macos/fastlane/Fastfile +++ b/macos/fastlane/Fastfile @@ -2,8 +2,8 @@ default_platform(:mac) build_number = 1000000000 + number_of_commits() platform :mac do - desc "Build and deploy a new build of LunaSea" - lane :build_and_deploy do + desc "Setup the LunaSea Keychain" + lane :prepare_keychain do create_keychain( name: ENV["MATCH_KEYCHAIN_NAME"], password: ENV["MATCH_KEYCHAIN_PASSWORD"], @@ -20,24 +20,36 @@ platform :mac do keychain_name: ENV["MATCH_KEYCHAIN_NAME"], keychain_password: ENV["MATCH_KEYCHAIN_PASSWORD"], ) + end + desc "Destroy the LunaSea Keychain" + lane :destroy_keychain do + delete_keychain(name: ENV["MATCH_KEYCHAIN_NAME"]) + end + + desc "Build App Package" + lane :build do + prepare_keychain + sh("flutter", "build", "macos", "--release", "--build-number=#{build_number}") + build_mac_app(scheme: "Runner", workspace: "Runner.xcworkspace", export_method: "app-store") + destroy_keychain + end + + desc "Deploy LunaSea to TestFlight" + lane :deploy do |options| api_key = app_store_connect_api_key( key_id: ENV["APPLE_STORE_CONNECT_KEY_ID"], issuer_id: ENV["APPLE_STORE_CONNECT_ISSUER_ID"], key_filepath: ENV["APPLE_STORE_CONNECT_KEY_FILEPATH"], ) - sh("flutter", "build", "macos", "--release", "--build-number=#{build_number}") - build_mac_app(scheme: "Runner", workspace: "Runner.xcworkspace", export_method: "app-store") - upload_to_testflight( - distribute_external: false, - notify_external_testers: false, - reject_build_waiting_for_review: true, - groups: "Alpha", changelog: "The changelog is available within the application!", + distribute_external: true, + groups: options[:flavor] || "internal", + pkg: options[:pkg] || "../macos/LunaSea.pkg", + notify_external_testers: true, + reject_build_waiting_for_review: true, ) - - delete_keychain(name: ENV["MATCH_KEYCHAIN_NAME"]) end end diff --git a/macos/fastlane/README.md b/macos/fastlane/README.md index 39b33352..e6aa5940 100644 --- a/macos/fastlane/README.md +++ b/macos/fastlane/README.md @@ -15,13 +15,37 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do ## Mac -### mac build_and_deploy +### mac prepare_keychain ```sh -[bundle exec] fastlane mac build_and_deploy +[bundle exec] fastlane mac prepare_keychain ``` -Build and deploy a new build of LunaSea +Setup the LunaSea Keychain + +### mac destroy_keychain + +```sh +[bundle exec] fastlane mac destroy_keychain +``` + +Destroy the LunaSea Keychain + +### mac build + +```sh +[bundle exec] fastlane mac build +``` + +Build App Package + +### mac deploy + +```sh +[bundle exec] fastlane mac deploy +``` + +Deploy LunaSea to TestFlight ----