-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): abstract out build and deployment actions
- Loading branch information
1 parent
40fc48a
commit 84578a6
Showing
11 changed files
with
365 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
name: 'Prepare for Build' | ||
description: 'Setup all required dependencies and secrets for building the given platform' | ||
|
||
inputs: | ||
platform: | ||
description: 'Platform to be Built' | ||
required: true | ||
|
||
# Secret Keys | ||
android-key-jks: | ||
description: 'Android Signing Key' | ||
required: false | ||
default: '' | ||
android-key-properties: | ||
description: 'Android Signing Key Properties' | ||
required: false | ||
default: '' | ||
appstore-connect-key: | ||
description: 'App Store Connect API Key' | ||
required: false | ||
default: '' | ||
firebase-options: | ||
description: 'Firebase Configuration' | ||
required: false | ||
default: '' | ||
google-play-key: | ||
description: 'Google Play Store API Key' | ||
required: false | ||
default: '' | ||
match-ssh-private-key: | ||
description: 'Fastlane Match SSH Key' | ||
required: false | ||
default: '' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Prepare Core | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: core-files | ||
|
||
- name: Prepare Folders | ||
shell: bash | ||
run: | | ||
mkdir -p output | ||
mkdir -p keys | ||
- name: Install Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: stable | ||
cache: true | ||
|
||
- name: Install Java | ||
if: ${{ inputs.platform == 'android' }} | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: zulu | ||
java-version: 11 | ||
|
||
- name: Install Ruby | ||
if: ${{ inputs.platform == 'android' || inputs.platform == 'ios' || inputs.platform == 'macos' }} | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
|
||
- name: Install XCode | ||
if: ${{ inputs.platform == 'ios' || inputs.platform == 'macos' }} | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: latest-stable | ||
|
||
- name: Setup Match SSH Keys | ||
if: ${{ inputs.platform == 'ios' || inputs.platform == 'macos' }} | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ inputs.match-ssh-private-key }} | ||
|
||
- name: Setup Secret Keys | ||
shell: bash | ||
run: | | ||
echo ${{ inputs.appstore-connect-key }} | base64 --decode > keys/appstore.p8 | ||
echo ${{ inputs.google-play-key }} | base64 --decode > keys/googleplay.json | ||
echo ${{ inputs.android-key-jks }} | base64 --decode > android/key.jks | ||
echo ${{ inputs.android-key-properties }} | base64 --decode > android/key.properties | ||
echo ${{ inputs.firebase-options }} | base64 --decode > lib/firebase_options.dart | ||
- name: Setup Android Platform | ||
if: ${{ inputs.platform == 'android' }} | ||
shell: bash | ||
run: | | ||
flutter pub get | ||
(cd android && bundle install) | ||
- name: Setup iOS Platform | ||
if: ${{ inputs.platform == 'ios' }} | ||
shell: bash | ||
run: | | ||
flutter pub get | ||
(cd ios && pod install --repo-update) | ||
(cd ios && bundle install) | ||
- name: Setup Linux Platform | ||
if: ${{ inputs.platform == 'linux' }} | ||
shell: bash | ||
run: | | ||
flutter config --enable-linux-desktop | ||
flutter pub get | ||
- name: Setup macOS Platform | ||
if: ${{ inputs.platform == 'macos' }} | ||
shell: bash | ||
run: | | ||
flutter config --enable-macos-desktop | ||
flutter pub get | ||
(cd macos && pod install --repo-update) | ||
(cd macos && bundle install) | ||
- name: Setup Web Platform | ||
if: ${{ inputs.platform == 'web' }} | ||
shell: bash | ||
run: | | ||
flutter pub get | ||
- name: Setup Test Platform | ||
if: ${{ inputs.platform == 'test' }} | ||
shell: bash | ||
run: | | ||
flutter pub get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: 'Prepare for Deployment' | ||
description: 'Setup all required dependencies and secrets for the given release channel' | ||
|
||
inputs: | ||
channel: | ||
description: 'Release Channel' | ||
required: true | ||
|
||
# Secret Keys | ||
appstore-connect-key: | ||
description: 'App Store Connect API Key' | ||
required: false | ||
default: '' | ||
google-play-key: | ||
description: 'Google Play Store API Key' | ||
required: false | ||
default: '' | ||
snapcraft-token: | ||
description: 'Snapcraft API Key' | ||
required: false | ||
default: '' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Prepare Folders | ||
shell: bash | ||
run: | | ||
mkdir -p output | ||
mkdir -p keys | ||
- name: Install Ruby | ||
if: ${{ inputs.channel == 'play-store' || inputs.channel == 'app-store' }} | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
|
||
- name: Install Snapcraft | ||
if: ${{ inputs.channel == 'snapcraft' }} | ||
uses: samuelmeuli/action-snapcraft@v1 | ||
with: | ||
snapcraft_token: ${{ inputs.snapcraft-token }} | ||
|
||
- name: Install XCode | ||
if: ${{ inputs.channel == 'app-store' }} | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: latest-stable | ||
|
||
- name: Setup Secret Keys | ||
shell: bash | ||
run: | | ||
echo ${{ inputs.appstore-connect-key }} | base64 --decode > keys/appstore.p8 | ||
echo ${{ inputs.google-play-key }} | base64 --decode > keys/googleplay.json | ||
- name: Setup Android Platform | ||
if: ${{ inputs.channel == 'play-store' }} | ||
shell: bash | ||
run: | | ||
cd android && bundle install | ||
- name: Setup iOS Platform | ||
if: ${{ inputs.channel == 'app-store' }} | ||
shell: bash | ||
run: | | ||
cd ios && bundle install | ||
- name: Setup macOS Platform | ||
if: ${{ inputs.channel == 'app-store' }} | ||
shell: bash | ||
run: | | ||
cd macos && bundle install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.