forked from yumemi-inc/flutter-engineer-codecheck
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (103 loc) · 3.14 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Deploy
on:
workflow_dispatch:
workflow_run:
workflows: [ Analyze and Test ]
types:
- completed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
pages: write
id-token: write
jobs:
android:
name: Build and Deploy Android
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: beta
cache: true
- name: Cache build_runner
uses: actions/cache@v2
with:
path: '**/.dart_tool/build'
key: build-runner-${{ hashFiles('**/asset_graph.json') }}-${{ hashFiles('**/pubspec.lock') }}
restore-keys: build-runner-
- name: Get dependencies
run: flutter pub get
- name: Exec build_runner
run: dart pub run build_runner build
- name: Build APK
run: flutter build apk --release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: android
path: build/app/outputs/apk/release/app-release.apk
ios:
name: Build and Deploy iOS
runs-on: macos-latest
if: ${{ (github.ref == 'refs/heads/main') && (github.event.workflow_run.conclusion == 'success') }}
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: beta
cache: true
- name: Cache build_runner
uses: actions/cache@v2
with:
path: '**/.dart_tool/build'
key: build-runner-${{ hashFiles('**/asset_graph.json') }}-${{ hashFiles('**/pubspec.lock') }}
restore-keys: build-runner-
- name: Get dependencies
run: flutter pub get
- name: Exec build_runner
run: dart pub run build_runner build
- name: Build iOS
run: flutter build ios --release --no-codesign
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ios
path: app-release.ipa
web:
name: Build and Deploy Web
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: beta
cache: true
- name: Cache build_runner
uses: actions/cache@v2
with:
path: '**/.dart_tool/build'
key: build-runner-${{ hashFiles('**/asset_graph.json') }}-${{ hashFiles('**/pubspec.lock') }}
restore-keys: build-runner-
- name: Get dependencies
run: flutter pub get
- name: Exec build_runner
run: dart pub run build_runner build
- name: Build Web
run: flutter build web --base-href /${{ github.event.repository.name }}/
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './build/web'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4