new(ci): Separate build and deploy jobs, allow selecting build platforms

This commit is contained in:
Jagandeep Brar
2022-01-16 22:49:01 -05:00
parent b9032cb486
commit 6d36c2d528
16 changed files with 439 additions and 122 deletions

View File

@@ -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 }}

View File

@@ -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

View File

@@ -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

View File

@@ -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

45
.github/workflows/deploy_android.yml vendored Normal file
View File

@@ -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

62
.github/workflows/deploy_ios.yml vendored Normal file
View File

@@ -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

62
.github/workflows/deploy_macos.yml vendored Normal file
View File

@@ -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

View File

@@ -1,4 +1,4 @@
name: '[Issues] Feature Requests'
name: '[GitHub] Issues - Feature Requests'
on:
issues:

View File

@@ -1,4 +1,4 @@
name: '[Issues] Support'
name: '[GitHub] Issues - Support'
on:
issues:

1
.ruby-version Normal file
View File

@@ -0,0 +1 @@
2.7.5

View File

@@ -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,

View File

@@ -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

View File

@@ -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

View File

@@ -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
----

View File

@@ -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

View File

@@ -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
----