- Home
- Services
- IVY
- Portfolio
- Blogs
- About Us
- Contact Us
- Sun-Tue (9:00 am-7.00 pm)
- infoaploxn@gmail.com
- +91 656 786 53
Every time I completed a feature, I had to:
It was tedious and error-prone.
By using GitHub Actions, I now trigger builds automatically on every push or pull request, and the generated artifacts are ready for testing. It’s also incredibly useful for CI/CD pipelines when releasing to the Play Store or App Store.
I already had my Flutter app locally. So, I initialized the Git repo:
git init git remote add origin https://github.com/myusername/myflutterapp.git git add . git commit -m "Initial commit" git push -u origin main
Then came the magic: setting up GitHub Actions.
In the root of my Flutter project, I created a folder called .github/workflows. Inside it, I added a file:
mkdir -p .github/workflows touch .github/workflows/flutter_build.yml
This file will define the GitHub Action workflow.
Here’s my initial flutterbuild.yml file:
name: Flutter CI on: push: branches: [ main ] pull_request: branches: [ main ] jobs: build: runs-on: ubuntu-latest steps: - name: Checkout source uses: actions/checkout@v3 - name: Set up Flutter uses: subosito/flutter-action@v2 with: flutter-version: ’3.22.0’ # Replace with your Flutter version - name: Install dependencies run: flutter pub get - name: Analyze code run: flutter analyze - name: Run tests run: flutter test - name: Build APK run: flutter build apk --release - name: Upload artifact uses: actions/upload-artifact@v4 with: name: release-apk path: build/app/outputs/flutter-apk/app-release.apk
This tells GitHub when to run the workflow. I set it to trigger on every push or pull request to the main branch.
This defines the job. I named it build and specified ubuntu-latest as the environment, which is perfect for building Flutter apps.
Step: Checkout source
- name: Checkout source uses: actions/checkout@v3
This checks out my code from the GitHub repository so that the runner can access it.
- name: Set up Flutter uses: subosito/flutter-action@v2 with: flutter-version: ’3.22.0’
This installs Flutter in the GitHub runner. I use the exact version that matches my local dev environment.
- name: Install dependencies run: flutter pub get
This step installs all the Dart/Flutter dependencies from pubspec.yaml.
- name: Analyze code run: flutter analyze
It’s always good practice to run static analysis to catch potential issues early.
- name: Run tests run: flutter test
This runs all my unit tests to ensure everything still works.
- name: Build APK run: flutter build apk --release
This builds the release version of the APK, which is what I usually send to testers.
- name: Upload artifact uses: actions/upload-artifact@v4 with: name: release-apk path: build/app/outputs/flutter-apk/app-release.apk
This uploads the APK to the “Artifacts” section of the GitHub Actions page so I (or my QA team) can download it
Once I pushed the .github/workflows/flutter_build.yml file to the repository:
git add . git commit -m "Add GitHub Actions workflow" git push
GitHub Actions automatically kicked in. I visited the Actions tab in my repository and saw the workflow run in real-time 🎉
At the end of the build, I could download the APK from the job summary. No more manual builds for every change!
For iOS, it’s a bit tricky since Apple builds require macOS. If you want to build .ipa files, you’ll need a macOS runner, which GitHub supports — but on a limited basis (and slower than Ubuntu).
Here’s a simplified snippet for building iOS:
jobs: build_ios: runs-on: macos-latest steps: - name: Checkout source uses: actions/checkout@v3 - name: Set up Flutter uses: subosito/flutter-action@v2 with: flutter-version: ’3.22.0’ - name: Install dependencies run: flutter pub get - name: Build iOS run: flutter build ios --no-codesign
I used --no-codesign because signing iOS apps requires credentials and certificates, which I didn’t want to set up just yet. But it’s a good start for CI.
I added notifications to alert my team when builds fail or succeed using a Slack webhook:
- name: Notify Slack uses: rtCamp/action-slack-notify@v2 env: SLACKWEBHOOK: ${{ secrets.SLACKWEBHOOK }} SLACK_MESSAGE: Build ${{ job.status }} for ${{ github.repository }}
I stored my Slack webhook URL securely in GitHub Secrets.
Setting up GitHub Actions was one of the most empowering decisions I’ve made for my Flutter projects. Now:
● Every push gets analyzed, tested, and built automatically
● My QA team can easily access the APKs
● I save time, reduce mistakes, and focus on building features
If you’re a Flutter dev and not using GitHub Actions yet — start today. It’s simple, powerful, and you only have to set it up once.
Imagine reducing your operational costs by up to $100,000 annually without compromising on the technology you rely on. Through our partnerships with leading cloud and technology providers like AWS (Amazon Web Services), Google Cloud Platform (GCP), Microsoft Azure, and Nvidia Inception, we can help you secure up to $25,000 in credits over two years (subject to approval).
These credits can cover essential server fees and offer additional perks, such as:
By leveraging these credits, you can significantly optimize your operational expenses. Whether you're a startup or a growing business, the savings from these partnerships ranging from $5,000 to $100,000 annually can make a huge difference in scaling your business efficiently.
The approval process requires company registration and meeting specific requirements, but we provide full support to guide you through every step. Start saving on your cloud infrastructure today and unlock the full potential of your business.