-
-
Notifications
You must be signed in to change notification settings - Fork 25
178 lines (159 loc) · 5.75 KB
/
main.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Multi-Platform Build
on:
push:
tags:
- '*'
jobs:
build_android_and_tv:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.0'
- run: flutter pub get
- name: Decode keystore
run: |
echo "${{ secrets.KEYSTORE_FILE }}" | base64 --decode > keystore.jks
# Build Android Mobile
- name: Build Android APK Mobile
run: flutter build apk --dart-define=isTV=false --release --split-per-abi
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_ALIAS_PASSWORD: ${{ secrets.KEY_ALIAS_PASSWORD }}
- name: Rename Android APK
run: mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk build/app/outputs/flutter-apk/easyTV-${{ github.ref_name }}.apk
# Build Android TV
- name: Build Android APK TV
run: flutter build apk --dart-define=isTV=true --release
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_ALIAS_PASSWORD: ${{ secrets.KEY_ALIAS_PASSWORD }}
- name: Rename Android APK
run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/easyTV-${{ github.ref_name }}-tv.apk
- name: Upload android_and_tv artifact
uses: actions/upload-artifact@v4
with:
name: android-and-tv-artifact
path: |
build/app/outputs/flutter-apk/easyTV-${{ github.ref_name }}.apk
build/app/outputs/flutter-apk/easyTV-${{ github.ref_name }}-tv.apk
build_ios_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.0'
- run: flutter pub get
# Build iOS
- name: Build iOS
run: |
flutter build ios --dart-define=isTV=false --release --no-codesign
cd build/ios/iphoneos
mkdir Payload
mv Runner.app Payload/
zip -r easyTV-${{ github.ref_name }}.ipa Payload
# Build macOS
- name: Build macOS
run: |
flutter build macos --dart-define=isTV=false --release
cd build/macos/Build/Products/Release
zip -r easyTV-${{ github.ref_name }}-macos.zip *.app
- name: Upload ios-macos artifact
uses: actions/upload-artifact@v4
with:
name: ios-macos-artifact
path: |
build/ios/iphoneos/easyTV-${{ github.ref_name }}.ipa
build/macos/Build/Products/Release/easyTV-${{ github.ref_name }}-macos.zip
build_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.0'
- run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
sudo apt-get install -y libasound2-dev
- run: flutter config --enable-linux-desktop
- run: flutter pub get
- name: Build Linux
run: |
flutter build linux --dart-define=isTV=false --release
cd build/linux/x64/release/bundle
zip -r easyTV-${{ github.ref_name }}-linux.zip *
- name: Upload linux artifact
uses: actions/upload-artifact@v4
with:
name: linux-artifact
path: |
build/linux/x64/release/bundle/easyTV-${{ github.ref_name }}-linux.zip
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.0'
- run: flutter config --enable-windows-desktop
- run: flutter pub get
- name: Build Windows
run: |
flutter build windows --dart-define=isTV=false --release
cp windows/system32/* build/windows/x64/runner/Release/
ls -l build/windows/x64/runner/Release
cd build/windows/x64/runner/Release
7z a easyTV-${{ github.ref_name }}-windows.zip *
- name: Upload windows artifact
uses: actions/upload-artifact@v4
with:
name: windows-artifact
path: |
build/windows/x64/runner/Release/easyTV-${{ github.ref_name }}-windows.zip
create_release:
needs: [ build_linux, build_windows, build_android_and_tv, build_ios_macos ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download artifact artifact
uses: actions/download-artifact@v4
with:
path: release
merge-multiple: true
- name: display Release dir
run: |
realpath release
ls -l release
pwd
- name: Upload artifacts to Release
uses: softprops/action-gh-release@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
draft: true
prerelease: false
files: |
./release/easyTV-${{ github.ref_name }}.apk
./release/ios/iphoneos/easyTV-${{ github.ref_name }}.ipa
./release/easyTV-${{ github.ref_name }}-tv.apk
./release/easyTV-${{ github.ref_name }}-linux.zip
./release/easyTV-${{ github.ref_name }}-windows.zip
./release/macos/Build/Products/Release/easyTV-${{ github.ref_name }}-macos.zip