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..13c89a4fc --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,70 @@ +name: Deploy test to Android play store +on: + workflow_dispatch: + inputs: + environment: + type: environment + description: Select the environment + +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 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/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#