Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from Appcenter to GitHub CI to publish apps in App Store Connect and Googles Play console #1711

Open
clangenb opened this issue Nov 17, 2024 · 1 comment · May be fixed by #1712
Open
Assignees

Comments

@clangenb
Copy link
Member

Microsoft's Appcenter retires as of March 2025, so we should find other solutions, it appears that we can do everything from Github's CI directly:

name: Deploy Flutter App

on:
  push:
    branches:
      - main

jobs:
  build-and-deploy:
    runs-on: macos-latest

    steps:
      # 1. Checkout the repository
      - name: Checkout code
        uses: actions/checkout@v3

      # 2. Set up Flutter
      - name: Set up Flutter
        uses: subosito/flutter-action@v2
        with:
          flutter-version: 'stable'

      # 3. Install dependencies
      - name: Install dependencies
        run: flutter pub get

      # 4. Set up Apple Code Signing
      - name: Import Certificates and Provisioning Profiles
        uses: apple-actions/import-codesign-certs@v1
        with:
          p12-file-base64: ${{ secrets.P12_FILE }}
          p12-password: ${{ secrets.P12_PASSWORD }}
          mobileprovision-file-base64: ${{ secrets.PROVISION_PROFILE }}

      # 5. Build iOS IPA
      - name: Build iOS IPA
        run: flutter build ipa --release
        env:
          CI: true

      # 6. Build Android AppBundle
      - name: Build Android AppBundle
        run: flutter build appbundle --release

      # 7. Deploy to Google Play Beta Track
      - name: Deploy to Google Play (Beta)
        uses: r0adkll/upload-google-play@v1
        with:
          serviceAccountJson: ${{ secrets.GOOGLE_PLAY_JSON }}
          packageName: com.example.yourapp
          releaseFiles: build/app/outputs/bundle/release/app-release.aab
          track: beta  # Publish to the beta track

      # 8. Upload Build to App Store Connect
      - name: Upload to App Store Connect
        uses: appleboy/[email protected]
        with:
          issuer_id: ${{ secrets.APP_STORE_ISSUER_ID }}
          key_id: ${{ secrets.APP_STORE_KEY_ID }}
          private_key: ${{ secrets.APP_STORE_PRIVATE_KEY }}
          ipa_path: build/ios/ipa/*.ipa

@clangenb clangenb self-assigned this Nov 17, 2024
@clangenb clangenb linked a pull request Nov 18, 2024 that will close this issue
2 tasks
@clangenb
Copy link
Member Author

Current state in wip Branches:

IOS

Finally found an action, which does all the heavy load. However, I still get the error that it can't find any provisioning profiles in the build phase. It is the same error as in the manual workflow before. Hence, I do think that we have to check our certificates in the Apple Developper Portal (review the pending licence agreement), and maybe re-import the secretes again in the secrets. I do think that the build setup is fine otherwise.
-> If it doesn't work, I suggest that Piero goes to through the steps outline in our actions readme with his Mac.

Android

Setup is simpler, but we need to set up the service account, as outlined in the action we are using. https://github.com/r0adkll/upload-google-play?tab=readme-ov-file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant