forked from cogwheel0/conduit
-
Notifications
You must be signed in to change notification settings - Fork 0
202 lines (167 loc) · 5.49 KB
/
release.yml
File metadata and controls
202 lines (167 loc) · 5.49 KB
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: Release
on:
push:
tags:
- 'v*'
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
jobs:
generate-release-notes:
name: Generate Release Notes
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Create Release with Notes
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
makeLatest: true
build-android:
name: Build Android
runs-on: ubuntu-latest
needs: generate-release-notes
permissions:
contents: write
steps:
#1 Checkout Repository
- name: Checkout Repository
uses: actions/checkout@v4
#2 Setup Java
- name: Set Up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Gradle and caching
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false
#3 Setup Flutter
- name: Set Up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
#4 Install Dependencies
- name: Install Dependencies
run: flutter pub get
- name: Generate code (build_runner)
run: dart run build_runner build --delete-conflicting-outputs
#5 Setup Keystore
- name: Create Keystore
run: |
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > app/conduit-keystore.jks
echo "${{ secrets.ANDROID_KEY_PROPERTIES_BASE64 }}" | base64 --decode > key.properties
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
ANDROID_KEY_PROPERTIES_BASE64: ${{ secrets.ANDROID_KEY_PROPERTIES_BASE64 }}
working-directory: android
- name: Build APK
run: flutter build apk --split-per-abi --release
- name: Build appBundle
run: flutter build appbundle --release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Android-Release
path: |
build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk
build/app/outputs/flutter-apk/app-x86_64-release.apk
build/app/outputs/bundle/release/app-release.aab
- name: Update Release with Artifacts
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/flutter-apk/app-arm64-v8a-release.apk,build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk,build/app/outputs/flutter-apk/app-x86_64-release.apk,build/app/outputs/bundle/release/app-release.aab"
tag: ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
makeLatest: true
omitBody: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
build-ios:
name: Build iOS
runs-on: macos-latest
needs: generate-release-notes
permissions:
contents: write
steps:
#1 Checkout Repository
- name: Checkout Repository
uses: actions/checkout@v4
#2 Setup Flutter
- name: Set Up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
#3 Install Dependencies
- name: Install Dependencies
run: flutter pub get
- name: Generate code (build_runner)
run: dart run build_runner build --delete-conflicting-outputs
#4 Setup Xcode
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
#5 Cache CocoaPods
- name: Cache CocoaPods
uses: actions/cache@v4
with:
path: |
ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install CocoaPods
run: |
cd ios
pod install --verbose
#6 Cache Xcode DerivedData
- name: Cache Xcode DerivedData
uses: actions/cache@v4
with:
path: |
~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-xcode-${{ hashFiles('ios/Podfile.lock', 'ios/Runner.xcodeproj/project.pbxproj', 'pubspec.lock') }}
restore-keys: |
${{ runner.os }}-xcode-
- name: Build iOS App
run: |
flutter build ios --release --no-codesign
#7 Create IPA from App Bundle
- name: Create IPA
run: |
mkdir -p build/ios/ipa
cd build/ios/Release-iphoneos
mkdir Payload
cp -r Runner.app Payload/
zip -r ../ipa/conduit.ipa Payload
cd ../ipa
#8 Upload Artifacts
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: iOS-Release
path: |
build/ios/ipa/*.ipa
#9 Update Release
- name: Update Release with IPA
uses: ncipollo/release-action@v1
with:
artifacts: "build/ios/ipa/conduit.ipa"
tag: ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
makeLatest: true
omitBody: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true