feat: fix shuffle harder #50
Workflow file for this run
This file contains hidden or 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: Deploy to Google Play | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Chỉ trigger khi push tag như v1.7.0 | |
| jobs: | |
| build: | |
| name: Build & Deploy to Play Store | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check if tag is from meow-app-v2 branch | |
| id: check_branch | |
| run: | | |
| git fetch origin meow-app-v2 | |
| if git merge-base --is-ancestor origin/meow-app-v2 $GITHUB_SHA; then | |
| echo "✅ Tag commit is on meow-app-v2" | |
| else | |
| echo "❌ Tag commit is NOT on meow-app-v2. Skipping deployment." | |
| exit 1 | |
| fi | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.24.5' | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Set version from tag | |
| id: versioning | |
| run: | | |
| TAG_NAME="${GITHUB_REF_NAME}" | |
| VERSION_NAME="${TAG_NAME#v}" | |
| VERSION_CODE=${GITHUB_RUN_NUMBER} | |
| echo "🔖 Version set to $VERSION_NAME+$VERSION_CODE" | |
| sed -i "s/^version: .*/version: $VERSION_NAME+$VERSION_CODE/" pubspec.yaml | |
| echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV | |
| - name: Run build_runner | |
| run: flutter pub run build_runner build --delete-conflicting-outputs | |
| - name: Decode google-services.json | |
| run: | | |
| echo "${{ secrets.GOOGLE_SERVICES }}" | base64 --decode > android/app/google-services.json | |
| - name: Decode Keystore | |
| run: | | |
| mkdir -p android/build | |
| echo "$KEYSTORE_BASE64" | base64 --decode > android/build/ci_keystore.jks | |
| env: | |
| KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | |
| - name: Build release AAB | |
| env: | |
| KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | |
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| run: flutter build appbundle --release | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.1' | |
| - name: Install Fastlane | |
| run: gem install fastlane | |
| - name: Create credentials file | |
| run: | | |
| mkdir -p android/fastlane | |
| printf '%s' "$GOOGLE_PLAY_CREDENTIALS" > android/fastlane/credentials.json | |
| env: | |
| GOOGLE_PLAY_CREDENTIALS: ${{ secrets.GOOGLE_PLAY_CREDENTIALS }} | |
| - name: Deploy using Fastlane | |
| working-directory: android | |
| run: | | |
| fastlane supply \ | |
| --json_key fastlane/credentials.json \ | |
| --package_name com.vinhnt.meow_app \ | |
| --aab ../build/app/outputs/bundle/release/app-release.aab \ | |
| --track internal |