-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (116 loc) · 4.58 KB
/
ci.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Genshin CI
on:
push:
pull_request: { branches: [master] }
jobs:
build-Android:
runs-on: ubuntu-latest
steps:
- uses: nelonoel/[email protected]
- uses: benjlevesque/[email protected]
id: short-sha
with: { length: 7 }
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with: { channel: stable, cache: true }
- name: 🏗️ Build Apk (arm64,android-x64)
run: flutter build apk --split-per-abi --target-platform android-arm64,android-x64,android-arm --release
- name: Sign APK
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: build/app/outputs/flutter-apk
signingKeyBase64: ${{ secrets.APK_SIGN_JKS_BASE64 }}
alias: ${{ secrets.APK_SIGN_ALIAS }}
keyStorePassword: ${{ secrets.APK_SIGN_PASS }}
env:
BUILD_TOOLS_VERSION: "30.0.3"
- name: Rename APK
run: |
cd build/app/outputs/flutter-apk/
mv app-armeabi-v7a-release-signed.apk genshin-wish-${{ env.BRANCH_NAME }}-${{ env.SHA }}-armeabi-v7a-release-signed.apk
mv app-arm64-v8a-release-signed.apk genshin-wish-${{ env.BRANCH_NAME }}-${{ env.SHA }}-arm64-v8a-release-signed.apk
mv app-x86_64-release-signed.apk genshin-wish-${{ env.BRANCH_NAME }}-${{ env.SHA }}-x86_64-release-signed.apk
- name: Upload armeabi-v7a apk artifact File
uses: actions/upload-artifact@v3
with:
name: genshin-wish-${{ env.BRANCH_NAME }}-${{ env.SHA }}-app-armeabi-v7a-release-signed.apk
path: build/app/outputs/flutter-apk/genshin-wish-${{ env.BRANCH_NAME }}-${{ env.SHA }}-armeabi-v7a-release-signed.apk
- name: Upload arm64-v8a apk artifact File
uses: actions/upload-artifact@v3
with:
name: genshin-wish-${{ env.BRANCH_NAME }}-${{ env.SHA }}-app-arm64-v8a-release-signed.apk
path: build/app/outputs/flutter-apk/genshin-wish-${{ env.BRANCH_NAME }}-${{ env.SHA }}-arm64-v8a-release-signed.apk
- name: Upload x86_64 apk artifact File
uses: actions/upload-artifact@v3
with:
name: genshin-wish-${{ env.BRANCH_NAME }}-${{ env.SHA }}-app-x86_64-release-signed.apk
path: build/app/outputs/flutter-apk/genshin-wish-${{ env.BRANCH_NAME }}-${{ env.SHA }}-x86_64-release-signed.apk
build-Windows:
runs-on: windows-latest
steps:
- uses: nelonoel/[email protected]
- uses: benjlevesque/[email protected]
id: short-sha
with: { length: 7 }
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with: { channel: stable, cache: true }
- run: |
flutter pub get
flutter build windows --release
- name: Upload Windows build file
uses: actions/upload-artifact@v3
with:
name: ${{ env.BRANCH_NAME }}-${{ env.SHA }}-windows-x86_64.zip
path: build/windows/runner/Release
build-Linux:
runs-on: ubuntu-latest
steps:
- uses: nelonoel/[email protected]
- uses: benjlevesque/[email protected]
id: short-sha
with: { length: 7 }
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with: { channel: stable, cache: true }
- run: |
sudo apt-get update -y
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev webkit2gtk-4.0
flutter pub get
flutter build linux --release
- name: Upload linux build File
uses: actions/upload-artifact@v3
with:
name: ${{ env.BRANCH_NAME }}-${{ env.SHA }}-linux-x86_64.zip
path: build/linux/x64/release/bundle
build-iOS:
runs-on: macos-11
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: subosito/flutter-action@v2
with: { channel: stable, cache: true }
- name: 🏗️ Build iOS
run: flutter build ios --no-codesign
build-MacOS:
runs-on: macos-latest
steps:
- uses: nelonoel/[email protected]
- uses: benjlevesque/[email protected]
id: short-sha
with: { length: 7 }
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with: { channel: stable, cache: true }
# Building
- name: Build macOS
run: |
flutter pub get
flutter build macos --release
- name: Upload web File
uses: actions/upload-artifact@v3
with:
name: ${{ env.BRANCH_NAME }}-${{ env.SHA }}-macos.zip
path: build/macos/Build/Products/Release