-
Notifications
You must be signed in to change notification settings - Fork 6
83 lines (76 loc) · 2.75 KB
/
cicd.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
name: Continuous Integration
on:
push:
pull_request:
env:
LANG: en_US.UTF-8
# Notifications
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_URL }}
SLACK_CHANNEL: '#dev-builds'
jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Fastlane and required plugins
run: |
sudo gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"
bundle install --path vendor/bundle
# Runs build with Gradle
- name: Build with Fastlane
run: bundle exec fastlane debug_dev
- name: Send notification of build result
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
text: '${{github.repository}} Dev build status is ${{ job.status }}'
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
if: always()
release:
if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
timeout-minutes: 45
env:
# S3
FOLDER: android-base
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
KEYS_BUCKET: ${{ secrets.AWS_S3_KEYS_BUCKET }}
# Android Release
JSON_KEYFILE: google-api.json
RELEASE_STORE_FILE: key.keystore
RELEASE_STORE_PASSWORD: ${{ secrets.ANDROID_RELEASE_STORE_PASSWORD }}
RELEASE_KEY_ALIAS: debug
RELEASE_KEY_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }}
# Notifications
SLACK_URL: ${{ secrets.SLACK_URL }}
SLACK_CHANNEL: '#dev-builds'
steps:
- name: Checkout
uses: actions/checkout@v2
# Downloads certificate, private key and Firebase file
- name: Download code signing items
run: |
aws s3 cp s3://$KEYS_BUCKET/$FOLDER/ . --recursive
mv ./android/$RELEASE_STORE_FILE ./app/$RELEASE_STORE_FILE
- name: Install Fastlane and required plugins
run: |
sudo gem install bundler
bundle install --path vendor/bundle
# Build with Gradle and submit to Play Store
- name: Submit Development build with Fastlane
if: ${{ github.ref == 'refs/heads/develop' }}
run: bundle exec fastlane deploy_dev
- name: Submit Staging build with Fastlane
if: ${{ github.ref == 'refs/heads/master' }}
run: bundle exec fastlane deploy_staging
- name: Send notification of build result
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
text: '${{github.repository}} ${{github.ref}} build submission status is ${{ job.status }}'
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
if: always()