From 6389bae03681592e32191cdd930710356c450519 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Tue, 24 Dec 2024 03:55:16 +0100 Subject: [PATCH 1/3] added patch and moved to manual --- .github/workflows/main_deploy.yaml | 53 ----------------------- .github/workflows/manual.yml | 69 ++++++++++++++++++++++++++++++ .github/workflows/release.yaml | 53 ----------------------- .gitignore | 1 + pubspec.yaml | 6 +-- scripts/enable_mobile_env.patch | 17 ++++++++ 6 files changed, 89 insertions(+), 110 deletions(-) create mode 100644 .github/workflows/manual.yml create mode 100644 scripts/enable_mobile_env.patch diff --git a/.github/workflows/main_deploy.yaml b/.github/workflows/main_deploy.yaml index 2b0eb6f16..af33e4cd2 100644 --- a/.github/workflows/main_deploy.yaml +++ b/.github/workflows/main_deploy.yaml @@ -94,59 +94,6 @@ jobs: - name: Update sentry run: flutter packages pub run sentry_dart_plugin - deploy_playstore_internal: - environment: staging - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: cat .github/workflows/versions.env >> $GITHUB_ENV - - uses: actions/setup-java@v4 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: 'zulu' - - uses: subosito/flutter-action@v2 - with: - flutter-version: ${{ env.FLUTTER_VERSION }} - cache: true - - name: Set up Android SDK - if: ${{ env.ACT }} # Only run on local act setups, as GitHub Actions provides the Android SDK on Ubuntu - uses: android-actions/setup-android@v2 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.3' - - name: Install Fastlane - run: gem install fastlane -NV - - name: Remove Emoji Font - run: | - rm -rf fonts/NotoEmoji - yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml - - run: flutter pub get - - name: Prepare Android Release Build - env: - PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }} - PLAY_STORE_KEYSTORE_KEY_ALIAS: ${{ secrets.PLAY_STORE_KEYSTORE_KEY_ALIAS }} - PLAY_STORE_KEYSTORE_STORE_PASSWORD: ${{ secrets.PLAY_STORE_KEYSTORE_STORE_PASSWORD }} - PLAY_STORE_KEYSTORE_KEY_PASSWORD: ${{ secrets.PLAY_STORE_KEYSTORE_KEY_PASSWORD }} - PLAY_STORE_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG_JSON }} - run: ./scripts/prepare-android-release.sh - - name: Build Android Release - run: flutter build appbundle --target-platform android-arm,android-arm64,android-x64 - - name: Deploy Android Release - run: | - mkdir -p build/android - cp build/app/outputs/bundle/release/app-release.aab build/android/ - cd android - bundle install - bundle update fastlane - bundle exec fastlane deploy_internal_test - if [[ $GITHUB_REF_NAME == rc* ]]; then - bundle exec fastlane deploy_candidate - else - bundle exec fastlane deploy_release - fi - cd .. - deploy_ios_testflight: # stashed on old.yml environment: staging runs-on: ubuntu-latest diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 000000000..b3d8927a1 --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,69 @@ +name: Deploy test to Android play store +on: + workflow_dispatch: + inputs: + environment: + type: environment + description: Select the environment + +deploy_playstore_internal: + environment: + name: ${{ inputs.environment }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: cat .github/workflows/versions.env >> $GITHUB_ENV + - uses: actions/setup-java@v4 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: 'zulu' + - uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + cache: true + - name: Set up Android SDK + if: ${{ env.ACT }} # Only run on local act setups, as GitHub Actions provides the Android SDK on Ubuntu + uses: android-actions/setup-android@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + - name: Update env files to selected environment + run: | + rm .env + rm assets/.env + echo "$WEB_APP_ENV" >> .env + cp .env assets/.env + - name: Apply .env patch + run: git apply ./scripts/enable_mobile_env.patch + - name: Install Fastlane + run: gem install fastlane -NV + - name: Remove Emoji Font + run: | + rm -rf fonts/NotoEmoji + yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml + - run: flutter pub get + - name: Prepare Android Release Build + env: + PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }} + PLAY_STORE_KEYSTORE_KEY_ALIAS: ${{ secrets.PLAY_STORE_KEYSTORE_KEY_ALIAS }} + PLAY_STORE_KEYSTORE_STORE_PASSWORD: ${{ secrets.PLAY_STORE_KEYSTORE_STORE_PASSWORD }} + PLAY_STORE_KEYSTORE_KEY_PASSWORD: ${{ secrets.PLAY_STORE_KEYSTORE_KEY_PASSWORD }} + PLAY_STORE_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG_JSON }} + run: ./scripts/prepare-android-release.sh + - name: Build Android Release + run: flutter build appbundle --target-platform android-arm,android-arm64,android-x64 + - name: Deploy Android Release + run: | + mkdir -p build/android + cp build/app/outputs/bundle/release/app-release.aab build/android/ + cd android + bundle install + bundle update fastlane + bundle exec fastlane deploy_internal_test + if [[ $GITHUB_REF_NAME == rc* ]]; then + bundle exec fastlane deploy_candidate + else + bundle exec fastlane deploy_release + fi + cd .. \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fc1cfe4a2..d73878408 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -133,59 +133,6 @@ jobs: asset_name: pangeachat-linux-${{ matrix.arch }}.tar.gz asset_content_type: application/gzip - deploy_playstore: - runs-on: ubuntu-latest - environment: production - steps: - - uses: actions/checkout@v2 - - run: cat .github/workflows/versions.env >> $GITHUB_ENV - - uses: actions/setup-java@v4 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: 'zulu' - - uses: subosito/flutter-action@v2 - with: - flutter-version: ${{ env.FLUTTER_VERSION }} - cache: true - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.3' - - name: Install Fastlane - run: gem install fastlane -NV - - name: Apply Google Services Patch - run: git apply ./scripts/enable-android-google-services.patch - - name: Remove Emoji Font - run: | - rm -rf fonts/NotoEmoji - yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml - - run: flutter pub get - - name: Prepare Android Release Build - env: - FDROID_KEY: ${{ secrets.FDROID_KEY }} - FDROID_KEY_PASS: ${{ secrets.FDROID_KEY_PASS }} - PLAYSTORE_DEPLOY_KEY: ${{ secrets.PLAYSTORE_DEPLOY_KEY }} - run: ./scripts/prepare-android-release.sh - - name: Build Android Release - run: flutter build appbundle --target-platform android-arm,android-arm64,android-x64 - - name: Get Tag Name - id: tag_name - run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})" - - name: Deploy Android Release - run: | - mkdir -p build/android - cp build/app/outputs/bundle/release/app-release.aab build/android/ - cd android - bundle install - bundle update fastlane - bundle exec fastlane deploy_internal_test - if [[ $GITHUB_REF_NAME == rc* ]]; then - bundle exec fastlane deploy_candidate - else - bundle exec fastlane deploy_release - fi - cd .. - deploy_web: runs-on: ubuntu-latest needs: build_web diff --git a/.gitignore b/.gitignore index cbc271c84..3f6474c3c 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ keys.json # Gitlab runner locally /builds/ .fvm/ +.fvmrc # Web related docs/tailwind.css diff --git a/pubspec.yaml b/pubspec.yaml index d57765b2f..6b4bec0d4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -168,10 +168,8 @@ flutter: assets: - assets/ # #Pangea - # uncomment this to enable mobile builds - # causes error with github actions - # - .env - # - assets/.env + - .env + - assets/.env - assets/pangea/ - assets/pangea/bot_faces/ # Pangea# diff --git a/scripts/enable_mobile_env.patch b/scripts/enable_mobile_env.patch new file mode 100644 index 000000000..fb10515f4 --- /dev/null +++ b/scripts/enable_mobile_env.patch @@ -0,0 +1,17 @@ +diff --git a/pubspec.yaml b/pubspec.yaml +index d57765b2f..6b4bec0d4 100644 +--- a/pubspec.yaml ++++ b/pubspec.yaml +@@ -168,10 +168,8 @@ flutter: + assets: + - assets/ + # #Pangea +- # uncomment this to enable mobile builds +- # causes error with github actions +- # - .env +- # - assets/.env ++ - .env ++ - assets/.env + - assets/pangea/ + - assets/pangea/bot_faces/ + # Pangea# From cdf82c0af9d91b10d17780af222e3eceacda0366 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Tue, 24 Dec 2024 03:57:42 +0100 Subject: [PATCH 2/3] fixed yml --- .github/workflows/manual.yml | 123 ++++++++++++++++++----------------- 1 file changed, 62 insertions(+), 61 deletions(-) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index b3d8927a1..13c89a4fc 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -6,64 +6,65 @@ on: type: environment description: Select the environment -deploy_playstore_internal: - environment: - name: ${{ inputs.environment }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: cat .github/workflows/versions.env >> $GITHUB_ENV - - uses: actions/setup-java@v4 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: 'zulu' - - uses: subosito/flutter-action@v2 - with: - flutter-version: ${{ env.FLUTTER_VERSION }} - cache: true - - name: Set up Android SDK - if: ${{ env.ACT }} # Only run on local act setups, as GitHub Actions provides the Android SDK on Ubuntu - uses: android-actions/setup-android@v2 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.3' - - name: Update env files to selected environment - run: | - rm .env - rm assets/.env - echo "$WEB_APP_ENV" >> .env - cp .env assets/.env - - name: Apply .env patch - run: git apply ./scripts/enable_mobile_env.patch - - name: Install Fastlane - run: gem install fastlane -NV - - name: Remove Emoji Font - run: | - rm -rf fonts/NotoEmoji - yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml - - run: flutter pub get - - name: Prepare Android Release Build - env: - PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }} - PLAY_STORE_KEYSTORE_KEY_ALIAS: ${{ secrets.PLAY_STORE_KEYSTORE_KEY_ALIAS }} - PLAY_STORE_KEYSTORE_STORE_PASSWORD: ${{ secrets.PLAY_STORE_KEYSTORE_STORE_PASSWORD }} - PLAY_STORE_KEYSTORE_KEY_PASSWORD: ${{ secrets.PLAY_STORE_KEYSTORE_KEY_PASSWORD }} - PLAY_STORE_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG_JSON }} - run: ./scripts/prepare-android-release.sh - - name: Build Android Release - run: flutter build appbundle --target-platform android-arm,android-arm64,android-x64 - - name: Deploy Android Release - run: | - mkdir -p build/android - cp build/app/outputs/bundle/release/app-release.aab build/android/ - cd android - bundle install - bundle update fastlane - bundle exec fastlane deploy_internal_test - if [[ $GITHUB_REF_NAME == rc* ]]; then - bundle exec fastlane deploy_candidate - else - bundle exec fastlane deploy_release - fi - cd .. \ No newline at end of file +jobs: + deploy_playstore_internal: + environment: + name: ${{ inputs.environment }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: cat .github/workflows/versions.env >> $GITHUB_ENV + - uses: actions/setup-java@v4 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: 'zulu' + - uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + cache: true + - name: Set up Android SDK + if: ${{ env.ACT }} # Only run on local act setups, as GitHub Actions provides the Android SDK on Ubuntu + uses: android-actions/setup-android@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + - name: Update env files to selected environment + run: | + rm .env + rm assets/.env + echo "$WEB_APP_ENV" >> .env + cp .env assets/.env + - name: Apply .env patch + run: git apply ./scripts/enable_mobile_env.patch + - name: Install Fastlane + run: gem install fastlane -NV + - name: Remove Emoji Font + run: | + rm -rf fonts/NotoEmoji + yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml + - run: flutter pub get + - name: Prepare Android Release Build + env: + PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }} + PLAY_STORE_KEYSTORE_KEY_ALIAS: ${{ secrets.PLAY_STORE_KEYSTORE_KEY_ALIAS }} + PLAY_STORE_KEYSTORE_STORE_PASSWORD: ${{ secrets.PLAY_STORE_KEYSTORE_STORE_PASSWORD }} + PLAY_STORE_KEYSTORE_KEY_PASSWORD: ${{ secrets.PLAY_STORE_KEYSTORE_KEY_PASSWORD }} + PLAY_STORE_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG_JSON }} + run: ./scripts/prepare-android-release.sh + - name: Build Android Release + run: flutter build appbundle --target-platform android-arm,android-arm64,android-x64 + - name: Deploy Android Release + run: | + mkdir -p build/android + cp build/app/outputs/bundle/release/app-release.aab build/android/ + cd android + bundle install + bundle update fastlane + bundle exec fastlane deploy_internal_test + if [[ $GITHUB_REF_NAME == rc* ]]; then + bundle exec fastlane deploy_candidate + else + bundle exec fastlane deploy_release + fi + cd .. \ No newline at end of file From 55e252bd05e1f6d176972d4b70a52bc5c8c24271 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Tue, 24 Dec 2024 04:00:15 +0100 Subject: [PATCH 3/3] commited the commented code again --- pubspec.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 6b4bec0d4..d57765b2f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -168,8 +168,10 @@ flutter: assets: - assets/ # #Pangea - - .env - - assets/.env + # uncomment this to enable mobile builds + # causes error with github actions + # - .env + # - assets/.env - assets/pangea/ - assets/pangea/bot_faces/ # Pangea#