Skip to content

Commit

Permalink
chore(ci): add iOS builds and upload build artefacts
Browse files Browse the repository at this point in the history
josxha committed May 22, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent c2fe9f5 commit b83c376
Showing 2 changed files with 79 additions and 14 deletions.
49 changes: 41 additions & 8 deletions .github/workflows/on-commit-main.yml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Bootstrap melos
@@ -38,7 +38,7 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Bootstrap melos
@@ -60,7 +60,7 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Bootstrap melos
@@ -84,7 +84,7 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Build APK
working-directory: example
run: flutter build apk
@@ -93,11 +93,39 @@ jobs:
with:
name: apk
path: example/build/app/outputs/flutter-apk/app-release.apk
- name: Upload apk as artifact
uses: actions/upload-artifact@v4
with:
name: flutter_map_plugins_example.apk
path: example/build/app/outputs/flutter-apk/app-release.apk
build-ios:
runs-on: macos-latest
name: Build iOS
needs: [ test, analyze, package-score ]
defaults:
run:
working-directory: ./example
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.sdk }}
cache: true
- uses: maxim-lobanov/setup-cocoapods@v1
with:
podfile-path: example/ios/Podfile.lock
- run: flutter pub get
- name: Build iOS package
run: flutter build ios --simulator
- name: Upload Runner.app as artifact
uses: actions/upload-artifact@v4
with:
name: flutter_map_plugins_example.app
path: example/build/ios/iphonesimulator
build-web:
runs-on: ubuntu-latest
name: Build Web
needs: [ test, analyze, package-score ]
if: github.repository == 'josxha/flutter_map_plugins'
defaults:
run:
working-directory: ./example
@@ -107,13 +135,18 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Build Web
run: flutter build web
- name: Upload web as artifact
uses: actions/upload-artifact@v4
with:
name: flutter_map_plugins_example.web
path: example/build/web
- uses: FirebaseExtended/action-hosting-deploy@v0
if: github.repository_owner == 'josxha'
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_FLUTTER_MAP_PLUGINS }}'
channelId: live
projectId: flutter-map-plugins

projectId: flutter-map-plugins
44 changes: 38 additions & 6 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Bootstrap melos
@@ -37,7 +37,7 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Bootstrap melos
@@ -59,7 +59,7 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Bootstrap melos
@@ -82,7 +82,7 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Build APK
working-directory: example
run: flutter build apk
@@ -91,10 +91,37 @@ jobs:
with:
name: apk
path: example/build/app/outputs/flutter-apk/app-release.apk
- name: Upload apk as artifact
uses: actions/upload-artifact@v4
with:
name: flutter_map_plugins_example.apk
path: example/build/app/outputs/flutter-apk/app-release.apk
build-ios:
runs-on: macos-latest
name: Build iOS
defaults:
run:
working-directory: ./example
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.sdk }}
cache: true
- uses: maxim-lobanov/setup-cocoapods@v1
with:
podfile-path: example/ios/Podfile.lock
- run: flutter pub get
- name: Build iOS package
run: flutter build ios --simulator
- name: Upload Runner.app as artifact
uses: actions/upload-artifact@v4
with:
name: flutter_map_plugins_example.app
path: example/build/ios/iphonesimulator
build-web:
runs-on: ubuntu-latest
name: Build Web
if: github.repository == 'josxha/flutter_map_plugins'
defaults:
run:
working-directory: ./example
@@ -104,6 +131,11 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Build Web
run: flutter build web
- name: Upload web as artifact
uses: actions/upload-artifact@v4
with:
name: flutter_map_plugins_example.web
path: example/build/web

0 comments on commit b83c376

Please sign in to comment.