-
Notifications
You must be signed in to change notification settings - Fork 23
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
[PR] Adding deployment guide #343
Draft
LuchoTurtle
wants to merge
39
commits into
main
Choose a base branch
from
deployment#342
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
0b0b421
fix: Upgrading the `flutter-quill` dependencies and adding multidex s…
LuchoTurtle e1178fc
chore: Upgrading deps.
LuchoTurtle 757455b
chore: Add pre-requisites in deployment documentation. #342
LuchoTurtle d779502
chore: Add google play instructions.
LuchoTurtle fd3dcd7
chore: Adding app signings.
LuchoTurtle 66a1e1d
chore: Add new rest of sections in Google.
LuchoTurtle 19bce03
chore: Beginning Apple section.
LuchoTurtle 90a0803
fix: Fixing service_worker.js patch file.
LuchoTurtle a1ea765
chore: Temporarily checking if deploy works.
LuchoTurtle cf9e1f9
chore: Reverting last commit.
LuchoTurtle 81e57d5
chore: Refactoring workflows. #344
LuchoTurtle a922485
Merge branch 'fix_ci#344' into deployment#342
LuchoTurtle 73ff784
chore: Only running `deploy_web` after build succeeds.
LuchoTurtle cb079e6
chore: Starting out Android deploy.
LuchoTurtle a0200e4
chore: Creating bundle. #342
LuchoTurtle df19266
chore: Temporarily checking if android works. #342
LuchoTurtle ad96f9e
chore: Trying to fix creating keystore file. #342
LuchoTurtle 02ed0eb
chore: Trying to fix.
LuchoTurtle 85f041c
chore: Debugging info folder. #342
LuchoTurtle 2baae5d
chore: Check key properties keystore file. #342
LuchoTurtle 6d73625
chore: Checking the location of key.properties.
LuchoTurtle 3694416
chore: Checking decoded android keystore location
LuchoTurtle cd41693
fix: Hopefully fixing the signing error. #342
LuchoTurtle dc8d75a
chore: Testing if deploying works on Android. #342
LuchoTurtle ea4c710
fix: Making worflow only work on `main`.
LuchoTurtle d6e6a16
chore: Add section on pre-requisites for Android release roll out. #342
LuchoTurtle 6846822
chore: Testing if release actually works when bumping version and not…
LuchoTurtle 4d56c82
chore: Change pubspec see if it works now.
LuchoTurtle 3a26a09
Revert "chore: Testing if release actually works when bumping version…
LuchoTurtle a9533cd
chore: Add disclaimer about version code increasing.
LuchoTurtle b98ffa5
chore: Adding disclaimers and comments. #342
LuchoTurtle 11f4552
feat: Finishing Android section and changing app name to unused "org.…
LuchoTurtle ee23878
chore: Adding iOS workflow file. #342
LuchoTurtle f79dbf5
feat: Adding deployment section for iOS to guide. #342
LuchoTurtle d499d03
chore: Adding pre-requisites section. #342
LuchoTurtle 88e2686
chore: Adding section to registering app. #342
LuchoTurtle db141b8
chore: Add rest of section for Apple. #342
LuchoTurtle 58cb2bb
chore: Fixing version and deps.
LuchoTurtle 2ffb242
chore: Add comment.
LuchoTurtle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,78 @@ | ||
name: Build & Test | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: "3.13.5" | ||
channel: "stable" | ||
|
||
- name: Install dependencies | ||
run: flutter pub get | ||
|
||
- name: Flutter analyze | ||
run: flutter analyze | ||
|
||
# Your project will need to have tests in test/ and a dependency on | ||
# package:test for this step to succeed. | ||
- name: Run tests | ||
run: flutter test --coverage | ||
|
||
- uses: codecov/codecov-action@v3 | ||
with: | ||
files: coverage/lcov.info | ||
verbose: true | ||
|
||
|
||
# Continuous Deployment to Fly.io | ||
# https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/ | ||
# flutter_deploy: | ||
# name: Deploy Flutter app | ||
# runs-on: ubuntu-latest | ||
# | ||
# needs: [build] | ||
# # https://stackoverflow.com/questions/58139406/only-run-job-on-specific-branch-with-github-actions | ||
# if: github.ref == 'refs/heads/main' | ||
# env: | ||
# FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# | ||
# - name: Install Flutter | ||
# uses: subosito/flutter-action@v2 | ||
# with: | ||
# channel: 'stable' | ||
# | ||
# # Your project will need to have tests in test/ and a dependency on | ||
# # package:test for this step to succeed. Note that Flutter projects will | ||
# # want to change this to 'flutter test'. | ||
# - name: Check build | ||
# run: flutter analyze | ||
# | ||
# - name: Create release build | ||
# # github.com/dwyl/app/issues/315#issuecomment-1443747737 | ||
# run: flutter build web --release --web-renderer html | ||
# | ||
# | ||
# # See https://github.com/dwyl/app/issues/326. | ||
# # This will fetch files concurrently needed for the app and not wait for `flutter.js` to load | ||
# - name: Run post-build script to download files concurrently | ||
# run: | | ||
# chmod +x ./build_tools/patch_web.sh | ||
# sh ./build_tools/patch_web.sh --ignore-whitespace | ||
# | ||
# - uses: superfly/[email protected] | ||
# with: | ||
# args: "deploy" |
This file was deleted.
Oops, something went wrong.
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,86 @@ | ||
name: Deploy Android (Google Play Store) | ||
on: | ||
# Only trigger, when the "build" workflow succeeded (only works in the Master Branch) | ||
workflow_run: | ||
workflows: ["Build & Test"] | ||
types: | ||
- completed | ||
|
||
# Only trigger, when pushing into the `main` branch | ||
push: | ||
branches: [main] | ||
|
||
# DELETE THIS | ||
#pull_request: | ||
# branches: [ "main" ] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-and-deploy_android: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: ⬇️ Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# Needed to base64 decode the upload keystore | ||
- name: ⚙️ Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: "12.x" | ||
cache: 'gradle' | ||
id: java | ||
|
||
# Needed to run Flutter-based commands | ||
- name: 🐦 Install Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
# If the flutter version that is used in development increases, it's recommended this one increases as well | ||
flutter-version: "3.13.5" | ||
channel: "stable" | ||
|
||
- name: 📚 Install dependencies | ||
run: flutter pub get | ||
|
||
- name: 🔒 Retrieve base64 keystore and decode it to a file | ||
env: | ||
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_FILE_BASE64 }} | ||
run: echo $KEYSTORE_BASE64 | base64 --decode > "${{ github.workspace }}/decoded_android-keystore.jks" | ||
|
||
# Creates keystore file. | ||
# Needs to be the same as the one defined in `android/app/build.gradle` | ||
- name: 📝🔐 Create key.properties file | ||
env: | ||
KEYSTORE_PROPERTIES_PATH: ${{ github.workspace }}/android/key.properties | ||
run: | | ||
touch $KEYSTORE_PROPERTIES_PATH | ||
echo 'storeFile=${{ github.workspace }}/decoded_android-keystore.jks' > $KEYSTORE_PROPERTIES_PATH | ||
echo 'keyAlias=${{ secrets.KEYSTORE_KEY_ALIAS }}' >> $KEYSTORE_PROPERTIES_PATH | ||
echo 'storePassword=${{ secrets.KEYSTORE_PASSWORD }}' >> $KEYSTORE_PROPERTIES_PATH | ||
echo 'keyPassword=${{ secrets.KEYSTORE_KEY_PASSWORD }}' >> $KEYSTORE_PROPERTIES_PATH | ||
|
||
|
||
- name: 📦 Create Android appbundle release | ||
run: | | ||
flutter build appbundle \ | ||
--obfuscate \ | ||
--split-debug-info=${{ github.workspace }}/build/app/outputs/symbols | ||
|
||
- name: 🚀 Upload Android Release to Play Store | ||
uses: r0adkll/[email protected] | ||
with: | ||
# MUST match the package name defined in `android/app/build.gradle` | ||
# Change all instances of of the package name to this one | ||
packageName: org.dwyl.app | ||
|
||
# Can be 'alpha'/'beta'/'internal'/'production'. | ||
# 'production' is relevant to the final stable version released to ALL clients | ||
# 'internal' can be used for development versions and testing | ||
# 'alpha' and 'beta' can be used for pre-release/staging purposes, with a smaller userbase | ||
track: production | ||
|
||
releaseFiles: ${{ github.workspace }}/build/app/outputs/bundle/release/app-release.aab | ||
serviceAccountJsonPlainText: "${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_KEY_JSON }}" |
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,92 @@ | ||
name: Deploy iOS (Apple App Store) | ||
on: | ||
# Only trigger, when the "build" workflow succeeded (only works in the Master Branch) | ||
workflow_run: | ||
workflows: ["Build & Test"] | ||
types: | ||
- completed | ||
|
||
# Only trigger, when pushing into the `main` branch | ||
push: | ||
branches: [main] | ||
|
||
# DELETE THIS | ||
#pull_request: | ||
# branches: [ "main" ] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-and-deploy_ios: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
|
||
- name: ⬇️ Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🔐 Install Apple certificate and provisioning profile | ||
env: | ||
P12_DISTRIBUTION_CERTIFICATE_BASE64: "${{ secrets.IOS_P12_DISTRIBUTION_CERTIFICATE_BASE64 }}" | ||
P12_DISTRIBUTION_CERTIFICATE_PASSWORD: "${{ secrets.IOS_P12_DISTRIBUTION_CERTIFICATE_PASSWORD }}" | ||
DISTRIBUTION_PROVISIONING_PROFILE_BASE64: "${{ secrets.IOS_DISTRIBUTION_PROVISIONING_PROFILE_BASE64 }}" | ||
KEYCHAIN_PASSWORD: "${{ secrets.IOS_RUNNER_LOCAL_KEYCHAIN_PASSWORD }}" | ||
EXPORT_OPTIONS_BASE64: "${{ secrets.IOS_EXPORT_OPTIONS_BASE64 }}" | ||
run: | | ||
# create variables | ||
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | ||
PROVISIONING_PROFILE_PATH=$RUNNER_TEMP/build_pp.mobileprovision | ||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | ||
EXPORT_OPTIONS_PATH="${{ github.workspace }}/app/ios/Runner/ExportOptions.plist" | ||
|
||
# import certificate, provisioning profile and export options from secrets | ||
echo -n "$P12_DISTRIBUTION_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH | ||
echo -n "$DISTRIBUTION_PROVISIONING_PROFILE_BASE64" | base64 --decode -o $PROVISIONING_PROFILE_PATH | ||
echo -n "$EXPORT_OPTIONS_BASE64" | base64 --decode -o $EXPORT_OPTIONS_PATH | ||
|
||
# create temporary keychain | ||
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | ||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
|
||
# import certificate to keychain | ||
security import $CERTIFICATE_PATH -P "$P12_DISTRIBUTION_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | ||
security list-keychain -d user -s $KEYCHAIN_PATH | ||
|
||
# apply provisioning profile | ||
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | ||
cp $PROVISIONING_PROFILE_PATH ~/Library/MobileDevice/Provisioning\ Profiles | ||
|
||
|
||
# Needed to run Flutter-based commands | ||
- name: 🐦 Install Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
# If the flutter version that is used in development increases, it's recommended this one increases as well | ||
flutter-version: "3.13.5" | ||
channel: "stable" | ||
id: flutter | ||
|
||
# Setting up Melos, which will | ||
#- name: ⚙️ Setup Melos | ||
# uses: bluefireteam/melos-action@v2 | ||
|
||
- name: 📚 Install dependencies | ||
run: flutter pub get | ||
|
||
- name: 🍏📦 Create iOS appbundle release | ||
run: | | ||
flutter build ipa \ | ||
--release \ | ||
--export-options-plist=ios/Runner/ExportOptions.plist | ||
--obfuscate \ | ||
--split-debug-info=${{ github.workspace }}/build/app/outputs/symbols | ||
|
||
- name: 🍏🚀 Deploy to App Store (Testflight) | ||
uses: apple-actions/upload-testflight-build@v1 | ||
with: | ||
app-path: ${{ github.workspace }}/app/build/ios/ipa/flutter_ci_cd_demo.ipa | ||
issuer-id: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} | ||
api-key-id: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} | ||
api-private-key: ${{ secrets.APP_STORE_CONNECT_API_PRIVATE_KEY }} |
21 changes: 15 additions & 6 deletions
21
.github/workflows/deploy.yml → .github/workflows/deploy_web.yml
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. 🙏 ❤️