-
Notifications
You must be signed in to change notification settings - Fork 20
180 lines (175 loc) · 6.19 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
name: Store CD
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
# CD
deploy_android:
name: Android Play Store
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- 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.13.x'
channel: 'stable'
- 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@v2
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.13.x'
channel: 'stable'
- 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 }}'
# deploy_web:
# name: Web Firebase Hosting
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: subosito/flutter-action@v2
# with:
# flutter-version: '3.13.x'
# channel: 'stable'
# - name: Enable Web
# run: flutter config --enable-web
# - run: flutter pub get
# - name: Build Web
# run: flutter build web
# - name: Deploy to Firebase
# uses: w9jds/firebase-action@master
# with:
# args: deploy --only hosting
# env:
# FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
# PROJECT_ID: nkust-ap-flutter
deploy_windows:
name: Windows App
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run Flutter tasks
uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.x'
channel: 'stable'
- 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\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@v2
- 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: nkust_ap_windows.zip
asset_content_type: application/zip