chore(sample-app): update workflow and fix flutter web for deployment
Signed-off-by: xsahil03x <xdsahil@gmail.com>
This commit is contained in:
+37
-23
@@ -17,21 +17,26 @@ concurrency:
|
||||
jobs:
|
||||
build_and_deploy_ios:
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 40
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer
|
||||
- name: Install RubyGems
|
||||
run: |
|
||||
cd ios
|
||||
bundle install
|
||||
- uses: subosito/flutter-action@v2
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'stable'
|
||||
- name: Flutter setup
|
||||
run: |
|
||||
flutter pub get
|
||||
channel: stable
|
||||
cache: true
|
||||
|
||||
- name: Setup Ruby and Gems
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
working-directory: ios
|
||||
bundler-cache: true
|
||||
|
||||
- name: Copy production config
|
||||
run: echo "${{ secrets.PRODUCTION_CONFIG }}" > lib/app_config.dart
|
||||
|
||||
- name: Build and release
|
||||
env:
|
||||
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
|
||||
@@ -41,39 +46,48 @@ jobs:
|
||||
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }}
|
||||
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}
|
||||
run: |
|
||||
flutter build ios --release --no-codesign
|
||||
flutter build ios --no-codesign
|
||||
cd ios
|
||||
bundle exec fastlane deploy_to_testflight
|
||||
|
||||
build_and_deploy_android:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-java@v1
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: stable
|
||||
cache: true
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '12.x'
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'stable'
|
||||
- run: |
|
||||
flutter pub get
|
||||
|
||||
- name: Copy production config
|
||||
run: echo "${{ secrets.PRODUCTION_CONFIG }}" > lib/app_config.dart
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
flutter build apk
|
||||
- name: upload apk
|
||||
run: flutter build apk
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: android-stream-chat-v1
|
||||
path: packages/stream_chat_v1/build/app/outputs/apk/release/app-release.apk
|
||||
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v2
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
aws-region: us-east-1
|
||||
- name: Upload APK
|
||||
|
||||
- name: Upload to S3
|
||||
run: |
|
||||
cp build/app/outputs/apk/release/app-release.apk flutter-sample-app.apk
|
||||
aws s3 cp flutter-sample-app.apk s3://${{ secrets.AWS_S3_BUCKET }} --sse AES256
|
||||
|
||||
@@ -15,55 +15,59 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
cleanup-runs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: rokroskar/workflow-run-cleanup-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
build_and_deploy_ios:
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 40
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer
|
||||
- name: Install RubyGems
|
||||
run: |
|
||||
cd ios
|
||||
bundle install
|
||||
- uses: subosito/flutter-action@v2
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'stable'
|
||||
channel: stable
|
||||
cache: true
|
||||
|
||||
- name: Setup Ruby and Gems
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
working-directory: ios
|
||||
bundler-cache: true
|
||||
|
||||
- name: Install firebase-tools
|
||||
run: npm install -g firebase-tools
|
||||
- name: Flutter setup
|
||||
run: |
|
||||
flutter pub get
|
||||
|
||||
- name: Build and release
|
||||
env:
|
||||
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
|
||||
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
|
||||
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
|
||||
run: |
|
||||
flutter build ios --release --no-codesign
|
||||
flutter build ios --no-codesign
|
||||
cd ios
|
||||
bundle exec fastlane deploy_to_firebase
|
||||
|
||||
build_and_deploy_android:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-java@v1
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '12.x'
|
||||
- uses: subosito/flutter-action@v2
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'stable'
|
||||
- run: |
|
||||
flutter pub get
|
||||
channel: stable
|
||||
cache: true
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
flutter build apk
|
||||
run: flutter build apk
|
||||
|
||||
- name: Deploy
|
||||
uses: wzieba/Firebase-Distribution-Github-Action@v1
|
||||
with:
|
||||
@@ -72,7 +76,8 @@ jobs:
|
||||
groups: stream-testers
|
||||
debug: true
|
||||
file: packages/stream_chat_v1/build/app/outputs/apk/release/app-release.apk
|
||||
- name: upload apk
|
||||
|
||||
- name: Upload APK
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: android-stream-chat-v1
|
||||
@@ -80,20 +85,28 @@ jobs:
|
||||
|
||||
build_and_deploy_web:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: config git
|
||||
run: |
|
||||
git config --global user.email "$(git log --format='%ae' HEAD^!)"
|
||||
git config --global user.name "$(git log --format='%an' HEAD^!)"
|
||||
git fetch origin gh-pages:gh-pages
|
||||
- uses: subosito/flutter-action@v2
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'stable'
|
||||
- run: flutter pub get
|
||||
channel: stable
|
||||
cache: true
|
||||
|
||||
- name: Copy production config
|
||||
run: echo "${{ secrets.PRODUCTION_CONFIG }}" > lib/app_config.dart
|
||||
- uses: bluefireteam/flutter-gh-pages@v7
|
||||
|
||||
- name: Build and Deploy
|
||||
uses: bluefireteam/flutter-gh-pages@v7
|
||||
with:
|
||||
webRenderer: canvaskit
|
||||
workingDir: packages/stream_chat_v1
|
||||
|
||||
@@ -1,34 +1,60 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
If you are serving your web app in a path other than the root, change the
|
||||
href value below to reflect the base path you are serving from.
|
||||
|
||||
The path provided below has to start and end with a slash "/" in order for
|
||||
it to work correctly.
|
||||
|
||||
For more details:
|
||||
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
|
||||
|
||||
This is a placeholder for base href that will be replaced by the value of
|
||||
the `--base-href` argument provided to `flutter build`.
|
||||
-->
|
||||
<base href="$FLUTTER_BASE_HREF">
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
||||
<meta name="description" content="A new Flutter project.">
|
||||
<meta name="description" content="Sample app for the Stream Chat Flutter SDK.">
|
||||
|
||||
<!-- iOS meta tags & icons -->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="apple-mobile-web-app-title" content="example">
|
||||
<meta name="apple-mobile-web-app-title" content="Stream Chat V1">
|
||||
<link rel="apple-touch-icon" href="icons/Icon-192.png">
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/png" href="favicon.png"/>
|
||||
|
||||
<title>example</title>
|
||||
<title>Stream Chat V1</title>
|
||||
<link rel="manifest" href="manifest.json">
|
||||
|
||||
<script>
|
||||
// The value below is injected by flutter build, do not touch.
|
||||
var serviceWorkerVersion = null;
|
||||
</script>
|
||||
<!-- This script adds the flutter initialization JS code -->
|
||||
<script defer src="flutter.js"></script>
|
||||
<script defer src="sql-wasm.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- This script installs service_worker.js to provide PWA functionality to
|
||||
application. For more information, see:
|
||||
https://developers.google.com/web/fundamentals/primers/service-workers -->
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', function () {
|
||||
navigator.serviceWorker.register('flutter_service_worker.js');
|
||||
<script>
|
||||
window.addEventListener('load', function(ev) {
|
||||
// Download main.dart.js
|
||||
_flutter.loader.loadEntrypoint({
|
||||
serviceWorker: {
|
||||
serviceWorkerVersion: serviceWorkerVersion,
|
||||
}
|
||||
}).then(function(engineInitializer) {
|
||||
return engineInitializer.initializeEngine();
|
||||
}).then(function(appRunner) {
|
||||
return appRunner.runApp();
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script defer src="sql-wasm.js"></script>
|
||||
<script src="main.dart.js" type="application/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user