Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GitHub Actions workflow to build Flutter app and create Release, put this file under `.github/workflows` folder.
on:
push:
branches:
- master
name: Build and Release Apps
jobs:
build:
name: Build Apps
runs-on: macos-latest
steps:
- name: Export Release Timestamp
run: echo "::set-env name=APP_VERSION::release_$(date +'%Y-%m-%d_%H-%m-%S')"
- name: Checkout repository
uses: actions/checkout@v1
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: "12.x"
- name: Set up Flutter
uses: subosito/flutter-action@v1
with:
channel: "stable"
- name: Install pub Dependencies
run: flutter pub get
- name: Run Tests
run: flutter test
- name: Build Android App
run: flutter build apk --split-per-abi
- name: Build iOS App
run: |
flutter build ios --no-codesign
cd build/ios/iphoneos
mkdir Payload
cd Payload
ln -s ../Runner.app
cd ..
zip -r app.ipa Payload
- name: Release Apps
uses: ncipollo/release-action@v1
with:
tag: ${{ env.APP_VERSION }}
name: ${{ env.APP_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "build/app/outputs/apk/release/*.apk,build/ios/iphoneos/app.ipa"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment