-
Notifications
You must be signed in to change notification settings - Fork 9
225 lines (219 loc) · 8.32 KB
/
cd.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
name: Store CD
on:
push:
tags:
- "v*"
jobs:
# CD
deploy_android:
name: Android Play Store
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '17.0'
- name: Decrypt Android keys
run: sh ./.github/scripts/decrypt_android_keys.sh
env:
KEYS_SECRET_PASSPHRASE: ${{ secrets.KEYS_SECRET_PASSPHRASE }}
- name: Use JD
uses: r26d/jq-action@master
with:
cmd: jq -n env
- name: Generate changelog
run: bash ./.github/scripts/generate_android_changelog.sh
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.x'
channel: 'stable'
- name: Decrypt dev configs
run: sh ./scripts/decrypt_dev_configs.sh
env:
DEV_CONFIGS_PASSPHRASE: ${{ secrets.DEV_CONFIGS_PASSPHRASE }}
- name: Install Flutter dependencies
run: flutter pub get
- run: flutter build appbundle --release
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.2'
- name: Bundle update
run: bundle update --bundler
working-directory: ./android
- name: Run Fastlane
uses: maierj/[email protected]
with:
lane: 'playstore'
subdirectory: 'android'
deploy_ios:
name: iOS Deploy TestFlight
runs-on: macos-13
steps:
# Ensure the xcode version is available
- name: List Xcode installations
run: sudo ls -1 /Applications | grep "Xcode"
# Select your required version
- name: Select Xcode 15.0
run: sudo xcode-select -s /Applications/Xcode_15.0.app/Contents/Developer
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Decrypt iOS keys
run: sh ./.github/scripts/decrypt_ios_keys.sh
env:
KEYS_SECRET_PASSPHRASE: ${{ secrets.KEYS_SECRET_PASSPHRASE }}
- name: Generate changelog
run: bash ./.github/scripts/generate_ios_changelog.sh
- name: Run Flutter tasks
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.x'
channel: 'stable'
- name: Decrypt dev configs
run: sh ./scripts/decrypt_dev_configs.sh
env:
DEV_CONFIGS_PASSPHRASE: ${{ secrets.DEV_CONFIGS_PASSPHRASE }}
- run: flutter pub get
- run: flutter build ios --release --no-codesign
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.2'
- name: Bundle update
run: bundle update --bundler
working-directory: ./ios
- name: Deploy iOS Beta to TestFlight via Fastlane
uses: maierj/[email protected]
with:
lane: 'release'
subdirectory: 'ios'
env:
APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}'
APP_STORE_CONNECT_APPLE_ID: '${{ secrets.APP_STORE_CONNECT_APPLE_ID }}'
APP_STORE_CONNECT_BUNDLE_IDENTIFIER: '${{ secrets.APP_STORE_CONNECT_BUNDLE_IDENTIFIER }}'
DEVELOPER_PORTAL_TEAM_ID: '${{ secrets.DEVELOPER_PORTAL_TEAM_ID }}'
FASTLANE_APPLE_ID: '${{ secrets.FASTLANE_APPLE_ID }}'
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: '${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}'
MATCH_PASSWORD: '${{ secrets.MATCH_PASSWORD }}'
GIT_AUTHORIZATION: '${{ secrets.GIT_AUTHORIZATION }}'
PROVISIONING_PROFILE_SPECIFIER: '${{ secrets.PROVISIONING_PROFILE_SPECIFIER }}'
TEMP_KEYCHAIN_PASSWORD: '${{ secrets.TEMP_KEYCHAIN_PASSWORD }}'
TEMP_KEYCHAIN_USER: '${{ secrets.TEMP_KEYCHAIN_USER }}'
FIREBASE_CLI_TOKEN: '${{ secrets.FIREBASE_CLI_TOKEN }}'
GOOGLE_APP_ID: '${{ secrets.GOOGLE_APP_ID }}'
# deploy_macos:
# name: macOS Deploy TestFlight
# runs-on: macOS-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# ref: ${{ github.ref }}
# - name: Decrypt macOS keys
# run: sh ./.github/scripts/decrypt_macos_keys.sh
# env:
# KEYS_SECRET_PASSPHRASE: ${{ secrets.KEYS_SECRET_PASSPHRASE }}
# - name: Run Flutter tasks
# uses: subosito/flutter-action@v2
# with:
# channel: 'dev'
# - name: Decrypt dev configs
# run: sh ./scripts/decrypt_dev_configs.sh
# env:
# DEV_CONFIGS_PASSPHRASE: ${{ secrets.DEV_CONFIGS_PASSPHRASE }}
# - name: Upgrades flutter
# run: flutter upgrade
# - name: Enable macOS
# run: flutter config --enable-macos-desktop
# - run: flutter pub get
# - run: cd ./macos && pod install
## - run: flutter build macos --release
# - uses: ruby/setup-ruby@v1
# with:
# ruby-version: '2.7.2'
# - name: Bundle update
# run: bundle update --bundler
# working-directory: ./ios
# - name: Deploy macOS Beta to TestFlight via Fastlane
# uses: maierj/[email protected]
# with:
# lane: 'release'
# subdirectory: 'macos'
# env:
# APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}'
# DEVELOPER_APP_ID: '${{ secrets.DEVELOPER_APP_ID }}'
# DEVELOPER_APP_IDENTIFIER: '${{ secrets.DEVELOPER_APP_IDENTIFIER }}'
# DEVELOPER_PORTAL_TEAM_ID: '${{ secrets.DEVELOPER_PORTAL_TEAM_ID }}'
# FASTLANE_APPLE_ID: '${{ secrets.FASTLANE_APPLE_ID }}'
# FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: '${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}'
# MATCH_PASSWORD: '${{ secrets.MATCH_PASSWORD }}'
# GIT_AUTHORIZATION: '${{ secrets.GIT_AUTHORIZATION }}'
# PROVISIONING_PROFILE_SPECIFIER: '${{ secrets.PROVISIONING_PROFILE_SPECIFIER }}'
# TEMP_KEYCHAIN_PASSWORD: '${{ secrets.TEMP_KEYCHAIN_PASSWORD }}'
# TEMP_KEYCHAIN_USER: '${{ secrets.TEMP_KEYCHAIN_USER }}'
deploy_windows:
name: Windows App
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run Flutter tasks
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.x'
channel: 'stable'
- name: Decrypt dev configs
run: sh ./scripts/decrypt_dev_configs.sh
env:
DEV_CONFIGS_PASSPHRASE: ${{ secrets.DEV_CONFIGS_PASSPHRASE }}
- name: Upgrades flutter
run: flutter upgrade
- name: Enable windows
run: flutter config --enable-windows-desktop
- run: flutter doctor -v
- run: flutter pub get
- name: Build windows
run: flutter build windows --release
- name: 'Zip files'
run: powershell Compress-Archive build\windows\x64\runner\Release\ windows.zip
- name: upload artifacts
uses: actions/upload-artifact@v2
with:
name: windows-artifact
path: windows.zip
github_release:
name: Create GitHub Release
needs: [deploy_android, deploy_ios, deploy_windows]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: RELEASE_NOTE.md
draft: false
prerelease: false
- name: Use Download Artifact v2
uses: actions/download-artifact@v2
with:
name: windows-artifact
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./windows.zip
asset_name: nsysu_ap_windows.zip
asset_content_type: application/zip