|
20 | 20 | runs-on: ubuntu-latest |
21 | 21 | steps: |
22 | 22 | - name: The release should not have any existing assets |
23 | | - run: echo "${{ toJson(github.event.release.assets) }}" |
| 23 | + if: join(github.event.release.assets, '') != '' |
| 24 | + run: | |
| 25 | + echo "::error::The "${{ github.event.release.name }}" release has preexisting assets. This workflow will not be able to upload build files as release assets." |
| 26 | + exit 1 |
24 | 27 |
|
25 | 28 | testing: |
26 | 29 | name: Run ${{ matrix.category }} testing |
|
83 | 86 | # unit testing |
84 | 87 | - name: Run Flutter ${{ matrix.category }} tests |
85 | 88 | if: matrix.category != 'static' |
86 | | - run: flutter test --no-pub --coverage --coverage-path=./coverage/lcov.${{ matrix.category }}.info test/${{ matrix.category }}s |
| 89 | + run: flutter test --no-pub test/${{ matrix.category }}s |
87 | 90 | working-directory: code |
88 | | - - name: Upload code coverage to GitHub |
89 | | - if: matrix.category != 'static' |
90 | | - uses: actions/upload-artifact@726a6dcd0199f578459862705eed35cda05af50b # v2.2.1 |
91 | | - with: |
92 | | - name: code-coverage |
93 | | - path: code/coverage/lcov.${{ matrix.category }}.info |
94 | 91 |
|
95 | 92 | build: |
96 | 93 | name: Build the ${{ matrix.file }} file |
@@ -157,22 +154,35 @@ jobs: |
157 | 154 | run: flutter pub get |
158 | 155 | working-directory: code |
159 | 156 |
|
| 157 | + # all |
| 158 | + - name: Set the app version |
| 159 | + uses: microsoft/variable-substitution@6287962da9e5b6e68778dc51e840caa03ca84495 # v1 |
| 160 | + with: |
| 161 | + files: 'code/pubspec.ya?ml' |
| 162 | + env: |
| 163 | + version: ${{ github.event.release.tag_name }} |
| 164 | + |
160 | 165 | # apk |
161 | 166 | - name: Build an Android APK file |
162 | 167 | if: matrix.file == 'apk' |
163 | | - run: flutter build apk --obfuscate --split-debug-info=build/app/outputs/symbols |
| 168 | + run: | |
| 169 | + cat pubspec.yaml |
| 170 | + flutter build apk --obfuscate --split-debug-info=build/app/outputs/symbols |
164 | 171 | working-directory: code |
165 | 172 |
|
166 | 173 | # aab |
167 | 174 | - name: Build an Android App Bundle file |
168 | 175 | if: matrix.file == 'aab' |
169 | | - run: flutter build appbundle --obfuscate --split-debug-info=build/app/outputs/symbols |
| 176 | + run: | |
| 177 | + cat pubspec.yaml |
| 178 | + flutter build appbundle --obfuscate --split-debug-info=build/app/outputs/symbols |
170 | 179 | working-directory: code |
171 | 180 |
|
172 | 181 | # ipa |
173 | 182 | - name: Build an iOS App Store Package file |
174 | 183 | if: matrix.file == 'ipa' |
175 | 184 | run: | |
| 185 | + cat pubspec.yaml |
176 | 186 | flutter build ios --no-codesign --obfuscate --split-debug-info=build/app/outputs/symbols |
177 | 187 | echo "::warning::TODO: fastlane export_ipa" |
178 | 188 | working-directory: code |
|
0 commit comments