|
5 | 5 | - "v[0-9]+.[0-9]+.[0-9]+*" |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - build_example: |
9 | | - name: Build Example App |
10 | | - runs-on: ${{ matrix.os }} |
11 | | - timeout-minutes: 60 |
12 | | - strategy: |
13 | | - fail-fast: true |
14 | | - matrix: |
15 | | - platform: |
16 | | - - apk |
17 | | - - ios |
18 | | - os: |
19 | | - - ubuntu-latest |
20 | | - - macos-latest |
21 | | - exclude: |
22 | | - # Skip build combinations where Android is attempted to build on MacOS |
23 | | - # and iOS attempt to build on Ubuntu. |
24 | | - - os: macos-latest |
25 | | - platform: apk |
26 | | - - os: ubuntu-latest |
27 | | - platform: ios |
28 | | - |
29 | | - # TODO(Dennis): iOS builds aren't properly configured yet. Fix and |
30 | | - # uncomment this exclusion |
31 | | - # https://github.com/oddbit/flutter_facebook_app_events/actions/runs/3365684172/jobs/5581387481 |
32 | | - - platform: ios |
33 | | - |
34 | | - steps: |
35 | | - - uses: actions/checkout@v4 |
36 | | - |
37 | | - # Ensure a compatible JDK for modern Android Gradle Plugin |
38 | | - - name: Set up Java 17 |
39 | | - if: matrix.platform == 'apk' |
40 | | - uses: actions/setup-java@v4 |
41 | | - with: |
42 | | - distribution: temurin |
43 | | - java-version: "17" |
44 | | - |
45 | | - - name: Set up Flutter |
46 | | - uses: subosito/flutter-action@v2 |
47 | | - with: |
48 | | - channel: "stable" |
49 | | - cache: true |
50 | | - |
51 | | - - run: flutter --version |
52 | | - |
53 | | - # Resolve root package (plugin) dependencies |
54 | | - - name: Flutter pub get (root) |
55 | | - run: flutter pub get |
56 | | - |
57 | | - # Resolve example app dependencies explicitly |
58 | | - - name: Flutter pub get (example) |
59 | | - if: matrix.platform == 'apk' |
60 | | - working-directory: ./example |
61 | | - run: flutter pub get |
62 | | - |
63 | | - - name: Configure iOS build environment |
64 | | - if: matrix.platform == 'ios' |
65 | | - run: | |
66 | | - echo "FLUTTER_EXTRA_PARAMS=--no-codesign" >> $GITHUB_ENV |
67 | | -
|
68 | | - - name: Activate iOS Pods Cache |
69 | | - uses: actions/cache@v4 |
70 | | - if: matrix.platform == 'ios' |
71 | | - with: |
72 | | - path: example/ios/Pods |
73 | | - key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }} |
74 | | - restore-keys: ${{ runner.os }}-pods- |
75 | | - |
76 | | - - run: flutter doctor |
77 | | - |
78 | | - # Start from a clean state to avoid watcher/gradle cache oddities |
79 | | - - name: Flutter clean (example) |
80 | | - if: matrix.platform == 'apk' |
81 | | - working-directory: ./example |
82 | | - run: flutter clean |
83 | | - |
84 | | - - name: Build Flutter |
85 | | - working-directory: ./example |
86 | | - run: >- |
87 | | - flutter |
88 | | - build ${{ matrix.platform }} |
89 | | - ${{ env.FLUTTER_EXTRA_PARAMS }} |
90 | | -
|
91 | | - # Help verify Android outputs and surface them as artifacts |
92 | | - - name: List Android outputs |
93 | | - if: matrix.platform == 'apk' |
94 | | - working-directory: ./example |
95 | | - run: | |
96 | | - echo "Listing build/app/outputs:" |
97 | | - ls -R build/app/outputs || true |
98 | | -
|
99 | | - - name: Upload APK artifact |
100 | | - if: matrix.platform == 'apk' |
101 | | - uses: actions/upload-artifact@v4 |
102 | | - with: |
103 | | - name: example-apk |
104 | | - path: | |
105 | | - example/build/app/outputs/flutter-apk/*.apk |
106 | | - example/build/app/outputs/apk/**/*.apk |
107 | | - example/build/**/outputs/**/*.apk |
108 | | -
|
109 | 8 | publish: |
110 | 9 | name: Publish Plugin |
111 | 10 | runs-on: ubuntu-latest |
112 | 11 | permissions: |
113 | 12 | id-token: write |
114 | | - needs: build_example |
115 | 13 | steps: |
116 | 14 | - uses: actions/checkout@v4 |
117 | 15 |
|
|
0 commit comments