Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cd): enable deployments via GitHub releases #128

Merged
merged 4 commits into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: CD

on:
push:
branches:
- deploy
on: [release]

env:
FB_APP_ID: ${{ secrets.FB_APP_ID }}
Expand All @@ -18,9 +15,17 @@ jobs:
deploy:
# This job will run on ubuntu virtual machine
runs-on: ubuntu-latest
# This job will run if the release is based on master branch
if: github.event.release.target_commitish == 'master'
steps:
# Setup Java environment in order to build the Android app.
- uses: actions/checkout@v1

# Extract the release type
- name: set release type
id: release
run: echo ::set-output name=type::${{ endsWith(github.event.release.tag_name, 'beta') && 'beta' || 'prod' }}
Nitish145 marked this conversation as resolved.
Show resolved Hide resolved

# Setup Java environment in order to build the Android apps
- uses: actions/setup-java@v1
with:
java-version: "12.x"
Expand Down Expand Up @@ -60,8 +65,8 @@ jobs:
# Build appbundle.
- run: flutter build appbundle --dart-define=FB_APP_ID=${FB_APP_ID} --dart-define=FB_APP_NAME=${FB_APP_NAME} --dart-define=GITHUB_OAUTH_CLIENT_ID=${GITHUB_OAUTH_CLIENT_ID} --dart-define=GITHUB_OAUTH_CLIENT_SECRET=${GITHUB_OAUTH_CLIENT_SECRET}

# Run fastlane internal
# Ship the appbundle.
- uses: maierj/fastlane-action@v1.4.0
with:
lane: internal
lane: ${{ release.outputs.type }}
subdirectory: android
14 changes: 11 additions & 3 deletions android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,18 @@
default_platform(:android)

platform :android do
desc "Push a new internal build to Play Store"
lane :internal do
desc "Push a new beta build to Play Store"
lane :beta do
upload_to_play_store(
track: "internal",
track: "beta",
aab: "../build/app/outputs/bundle/release/app-release.aab"
)
end

desc "Push a new production build to Play Store"
lane :prod do
upload_to_play_store(
track: "production",
aab: "../build/app/outputs/bundle/release/app-release.aab"
)
end
Expand Down