Skip to content

Commit 4bf92a5

Browse files
authored
Update deployment.yml (#7)
1 parent 87eb617 commit 4bf92a5

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

.github/workflows/deployment.yml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
release:
55
types: [ published ]
66

7+
env:
8+
FLUTTER_DEBUG_INFO_PATH: $FLUTTER_DEBUG_INFO_PATH
9+
710
jobs:
811
security_hardening:
912
name: Check security hardening
@@ -171,25 +174,59 @@ jobs:
171174
# apk
172175
- name: Build an Android APK file
173176
if: matrix.file == 'apk'
174-
run: flutter build apk --obfuscate --split-debug-info=build/app/outputs/symbols
177+
run: flutter build apk --obfuscate --split-debug-info=$FLUTTER_DEBUG_INFO_PATH
175178
working-directory: code
176179

177180
# aab
178181
- name: Build an Android App Bundle file
179182
if: matrix.file == 'aab'
180-
run: flutter build appbundle --obfuscate --split-debug-info=build/app/outputs/symbols
183+
run: flutter build appbundle --obfuscate --split-debug-info=$FLUTTER_DEBUG_INFO_PATH
181184
working-directory: code
182185

186+
# apk/aab
187+
- name: Upload the artifacts — ${{ matrix.file }}-mapping.txt file
188+
if: matrix.file == 'apk' || matrix.file == 'aab'
189+
uses: actions/upload-artifact@726a6dcd0199f578459862705eed35cda05af50b # v2.2.1
190+
with:
191+
name: ${{ matrix.file }}-mapping.txt
192+
path: build/app/outputs/mapping/release/mapping.txt
193+
- name: Upload the release assets — ${{ matrix.file }}-mapping.txt file
194+
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
195+
with:
196+
upload_url: ${{ github.event.release.upload_url }}
197+
asset_path: build/app/outputs/mapping/release/mapping.txt
198+
asset_name: ${{ matrix.file }}-mapping.txt
199+
asset_content_type: text/plain
200+
env:
201+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
202+
183203
# ipa
184204
- name: Build an iOS App Store Package file
185205
if: matrix.file == 'ipa'
186206
run: |
187-
flutter build ios --no-codesign --obfuscate --split-debug-info=build/app/outputs/symbols
207+
flutter build ios --no-codesign --obfuscate --split-debug-info=$FLUTTER_DEBUG_INFO_PATH
188208
echo "::warning::TODO: fastlane export_ipa"
189209
working-directory: code
190210

191211
# all
192-
- name: Backup the artifacts — ${{ matrix.file }} file
212+
- name: Archive Flutter symbols
213+
run: zip --recurse-paths flutter-${{ matrix.file }}-symbols.zip $FLUTTER_DEBUG_INFO_PATH
214+
working-directory: code
215+
- name: Upload the artifacts — flutter-${{ matrix.file }}-symbols.zip file
216+
uses: actions/upload-artifact@726a6dcd0199f578459862705eed35cda05af50b # v2.2.1
217+
with:
218+
name: flutter-${{ matrix.file }}-symbols.zip
219+
path: code/flutter-${{ matrix.file }}-symbols.zip
220+
- name: Upload the release assets — flutter-${{ matrix.file }}-symbols.zip file
221+
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
222+
with:
223+
upload_url: ${{ github.event.release.upload_url }}
224+
asset_path: code/flutter-${{ matrix.file }}-symbols.zip
225+
asset_name: flutter-${{ matrix.file }}-symbols.zip
226+
asset_content_type: application/zip
227+
env:
228+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
229+
- name: Upload the artifacts — ${{ matrix.file }} file
193230
uses: actions/upload-artifact@726a6dcd0199f578459862705eed35cda05af50b # v2.2.1
194231
with:
195232
name: app.${{ matrix.file }}

0 commit comments

Comments
 (0)