-
Notifications
You must be signed in to change notification settings - Fork 97
72 lines (57 loc) · 2.44 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
name: CD
on:
release:
types: [published]
env:
FB_APP_ID: ${{ secrets.FB_APP_ID }}
FB_APP_NAME: ${{ secrets.FB_APP_NAME }}
GITHUB_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
GITHUB_OAUTH_CLIENT_SECRET: ${{ secrets.GH_OAUTH_CLIENT_SECRET }}
FASTLANE_SUPPLY_JSON_KEY: ${{ secrets.FASTLANE_SUPPLY_JSON_KEY }}
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
RELEASE_KEYSTORE_PROPERTIES: ${{ secrets.RELEASE_KEYSTORE_PROPERTIES }}
jobs:
deploy:
# This job will run on ubuntu virtual machine
runs-on: ubuntu-latest
timeout-minutes: 15
# This job will run if the release is based on master branch
if: github.event.release.target_commitish == 'master'
env:
RELEASE_TYPE: ${{ contains(github.event.release.tag_name, 'beta') && 'beta' || 'prod' }}
steps:
- uses: actions/checkout@v3
# Setup Java environment in order to build the Android apps
- uses: actions/setup-java@v1
with:
java-version: "12.x"
# Setup Ruby for Fastlane
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true
# Setup the flutter environment.
- uses: subosito/flutter-action@v2
with:
channel: "stable"
# Get flutter dependencies.
- run: flutter pub get
# Run build runner to generate dart files
- run: flutter packages pub run build_runner build --delete-conflicting-outputs
# Check for any formatting issues in the code.
- run: flutter format --set-exit-if-changed .
# Statically analyze the Dart code for any errors.
- run: flutter analyze .
# Save supply json key for fastlane
- run: echo "${FASTLANE_SUPPLY_JSON_KEY}" | base64 --decode > android/supply_json_key.json
# Save release props for signing
- run: echo "${RELEASE_KEYSTORE_PROPERTIES}" | base64 --decode > android/key.release.properties
# Save release keystore for signing
- run: echo "${RELEASE_KEYSTORE}" | base64 --decode > android/app/cv_release.jks
# Build appbundle.
- run: flutter build appbundle --dart-define=FB_APP_ID=${FB_APP_ID} --dart-define=FB_APP_NAME=${FB_APP_NAME} --dart-define=GITHUB_OAUTH_CLIENT_ID=${GITHUB_OAUTH_CLIENT_ID} --dart-define=GITHUB_OAUTH_CLIENT_SECRET=${GITHUB_OAUTH_CLIENT_SECRET}
# Ship the appbundle.
- uses: maierj/[email protected]
with:
lane: ${{ env.RELEASE_TYPE }}
subdirectory: android