-
Notifications
You must be signed in to change notification settings - Fork 8
91 lines (90 loc) · 3.18 KB
/
release-android.yml
File metadata and controls
91 lines (90 loc) · 3.18 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
name: Release Android
on:
workflow_dispatch:
inputs:
githubRef:
description: 'Github ref to build and release'
required: true
default: 'develop'
release:
types: [created]
jobs:
release-android:
name: Release Android
runs-on: macos-latest
env:
CRYPTEX_GIT_URL: https://${{ secrets.CI_GITHUB_PERSONAL_ACCESS_TOKEN }}@github.com/${{ secrets.CRYPTEX_GIT_REPOSITORY }}.git
CRYPTEX_PASSWORD: ${{ secrets.CRYPTEX_PASSWORD }}
steps:
- name: Set environment variables
env:
DEFAULT_REF: ${{ github.event.release.tag_name }}
run: |
echo "CHECKOUT_REF=${{ github.event.inputs.githubRef || env.DEFAULT_REF }}" >> $GITHUB_ENV
- uses: sarisia/actions-status-discord@v1
if: ${{ always() }}
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: Android release started
color: 0xFFFFFF
- name: Checkout tag
uses: actions/checkout@v3
with:
ref: ${{ env.CHECKOUT_REF }}
- uses: volta-cli/action@v4
- name: Setup Ruby & bundle
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Decrypt fastlane vars
run: yarn fastlane run decrypt_fastlane_vars
- uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
cache: 'yarn'
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Yarn Install
run: yarn install --prefer-offline --frozen --frozen-lockfile
- name: Yarn Setup
run: yarn postinstall
- name: Sync google_services
run: yarn contexts:sync:google_services
- name: Sync app_vars
run: yarn contexts:app:sync
- name: Sync google_play_credentials
run: yarn fastlane sync_google_play_credentials
- name: Sync android_keystore
run: yarn fastlane sync_android_keystore
- name: Sync sentry_properties
run: yarn fastlane sync_sentry_properties
- name: Run fastlane (android)
run: cd android && bundle install && bash -c 'set -a && source ../.env && set +a && bundle exec fastlane internal'
- uses: actions/upload-artifact@v3
with:
name: Android bundle
path: android/app/build/outputs/bundle/app-release.aab
- uses: sarisia/actions-status-discord@v1
if: ${{ failure() }}
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: Android release failed
color: 0xFF5054
- uses: sarisia/actions-status-discord@v1
if: ${{ success() }}
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: Android release completed
color: 0x37EB77