remove dispatch options #182
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
name: android_build | |
on: | |
push: | |
branches: [main,staging,dev] | |
# workflow_dispatch: | |
# inputs: | |
# lane: | |
# description: "Fastlane lane" | |
# required: true | |
# default: "beta" | |
# type: choice | |
# options: | |
# - beta | |
# - staging | |
# - production | |
# | |
# Declare default permissions as read only. | |
permissions: read-all | |
jobs: | |
deployDev: | |
name: 'Deploy to dev environment' | |
if: github.event.ref == 'refs/heads/dev' | |
runs-on: ubuntu-latest | |
environment: development | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- uses: actions/checkout@v3 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.16.7' | |
channel: 'stable' | |
- name: Make envfile | |
uses: SpicyPizza/create-envfile@v2.0 | |
with: | |
envkey_ENVIRONMENT: ${{ secrets.ENVIRONMENT }} | |
envkey_API_URL: ${{ secrets.API_URL }} | |
file_name: .env | |
- run: flutter pub get | |
- run: flutter analyze | |
- run: flutter build apk | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: apk-release | |
path: build/app/outputs/flutter-apk/app-release.apk | |
deployStaging: | |
name: 'Deploy to staging environment' | |
if: github.event.ref == 'refs/heads/staging' | |
runs-on: ubuntu-latest | |
environment: staging | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- uses: actions/checkout@v3 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.16.7' | |
channel: 'stable' | |
- name: Make envfile | |
uses: SpicyPizza/create-envfile@v2.0 | |
with: | |
envkey_ENVIRONMENT: ${{ secrets.ENVIRONMENT }} | |
envkey_API_URL: ${{ secrets.API_URL }} | |
file_name: .env | |
# envkey_SECRET_KEY: ${{ secrets.ENV_SECRET_KEY }} | |
- run: flutter pub get | |
- run: flutter analyze | |
- run: flutter build apk | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: apk-release | |
path: build/app/outputs/flutter-apk/app-release.apk | |
deployProd: | |
name: 'Deploy to production environment' | |
if: github.event.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- uses: actions/checkout@v3 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.16.7' | |
channel: 'stable' | |
- name: Make envfile | |
uses: SpicyPizza/create-envfile@v2.0 | |
with: | |
envkey_ENVIRONMENT: ${{ secrets.ENVIRONMENT }} | |
envkey_API_URL: ${{ secrets.API_URL }} | |
file_name: .env | |
# envkey_SECRET_KEY: ${{ secrets.ENV_SECRET_KEY }} | |
- run: flutter pub get | |
- run: flutter analyze | |
- run: flutter build apk | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: apk-release | |
path: build/app/outputs/flutter-apk/app-release.apk | |
# - name: Upload artifacts to firebase app distribution | |
# uses: wzieba/Firebase-Distribution-Github-Action@v1 | |
# with: | |
# appId: ${{secrets.FIREBASE_APP_ID}} | |
# token: ${{secrets.FIREBASE_TOKEN}} | |
# # serviceCredentialsFileContent: ${{secrets.CREDENTIAL_FILE_CONTENT}} | |
# groups: android_testers | |
# file: "build/app/outputs/flutter-apk/app-release.apk" | |
# setup-fastlane: | |
# name: Fastlane build and release | |
# runs-on: ubuntu-latest | |
# needs: setup-analyze-flutter | |
# steps: | |
# - uses: subosito/flutter-action@v2 | |
# with: | |
# flutter-version: '3.3.10' | |
# channel: 'stable' | |
# - uses: ruby/setup-ruby@v1 | |
# with: | |
# ruby-version: '3.3' | |
# bundler-cache: true | |
# - uses: actions/checkout@v3 | |
# - run: flutter pub get | |
# # Setup Ruby, Bundler, and Gemfile dependencies | |
## - name: Setup Fastlane | |
# - uses: ruby/setup-ruby@360dc864d5da99d54fcb8e9148c14a84b90d3e88 # v1.165.1 | |
# with: | |
# ruby-version: "3.3" | |
# bundler-cache: true | |
# working-directory: android | |
## - name: Configure Keystore | |
# - run: | | |
# echo "$PLAY_STORE_UPLOAD_KEY" | base64 --decode > app/upload-keystore.jks | |
# echo "storeFile=upload-keystore.jks" >> key.properties | |
# echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> key.properties | |
# echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> key.properties | |
# echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> key.properties | |
# env: | |
# PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }} | |
# KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }} | |
# KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }} | |
# KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }} | |
# working-directory: android | |
# - run: bundle exec fastlane ${{ github.event.inputs.lane || 'beta' }} | |
# env: | |
# PLAY_STORE_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG_JSON }} | |
# working-directory: android | |
# release-to-firebase: | |
# name: release test apk to firebase dev channel | |
# runs-on: ubuntu-latest | |
# needs: setup-fastlane | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: actions/setup-java@v3 | |
# with: | |
# distribution: 'zulu' | |
# java-version: '17' | |
# - uses: subosito/flutter-action@v2 | |
# with: | |
# flutter-version: '3.3.10' | |
# channel: 'stable' | |
# | |
# | |