From cf6d44fe58016f40c3833d12d81ad7e809be2584 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 2 Feb 2021 16:11:52 +0100 Subject: [PATCH] add github action --- .github/workflows/build.yml | 70 +++++++++++++++++++++++++++++++++++++ stream_chat_v1/pubspec.yaml | 2 +- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b11fd70 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,70 @@ +name: Build + +on: + push: + branches: + - main + release: + types: + - created +defaults: + run: + working-directory: stream_chat_v1 + +jobs: + build_and_deploy_ios: + runs-on: [macos-latest] + steps: + - uses: actions/checkout@v2 + - name: Install RubyGems + run: | + cd example/ios + bundle install + - uses: subosito/flutter-action@v1.4.0 + with: + channel: 'stable' + - name: Install firebase-tools + run: npm install -g firebase-tools + - name: Flutter setup + run: | + cd example + 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: | + cd example + flutter build ios --release --no-codesign + cd ios + bundle exec fastlane deploy_to_firebase + build_and_deploy_android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: '12.x' + - uses: subosito/flutter-action@v1.4.0 + with: + channel: 'stable' + - run: | + cd example + flutter pub get + - name: Decode google-services.json + env: + ANDROID_GOOGLE_SERVICES: ${{ secrets.ANDROID_GOOGLE_SERVICES }} + run: echo $ANDROID_GOOGLE_SERVICES > ./example/android/app/google-services.json + - name: Build + run: | + cd example + flutter build apk + - name: Deploy + uses: wzieba/Firebase-Distribution-Github-Action@v1.3.2 + with: + appId: ${{secrets.FIREBASE_ANDROID_APPID}} + token: ${{secrets.FIREBASE_TOKEN}} + groups: stream-testers + debug: true + file: stream_chat_v1/example/build/app/outputs/apk/release/app-release.apk \ No newline at end of file diff --git a/stream_chat_v1/pubspec.yaml b/stream_chat_v1/pubspec.yaml index a0404c8..e5e9f08 100644 --- a/stream_chat_v1/pubspec.yaml +++ b/stream_chat_v1/pubspec.yaml @@ -1,7 +1,7 @@ name: example description: A new Flutter project. publish_to: 'none' -version: 1.2.0+1 +version: 1.2.1 environment: sdk: ">=2.2.2 <3.0.0"