-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (90 loc) · 3.24 KB
/
android_enterprise_release.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
name: Android Enterprise Release
on:
push:
branches:
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.repository }}
cancel-in-progress: true
jobs:
detect-changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
# Matches all files which can affect iOS build, when changed
iosFiles: ${{ steps.file-changes.outputs.iosFiles }}
# Matches all files which can affect Android build, when changed
androidFiles: ${{ steps.file-changes.outputs.androidFiles }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect Changes
uses: dorny/paths-filter@v2
id: file-changes
with:
base: ${{ github.ref }}
filters: |
iosFiles:
- "!(androidApp/**)"
androidFiles:
- "!(iosApp/**)"
enterprise:
name: Enterprise build
runs-on: [ ubuntu-latest ]
needs: detect-changes
if: ${{ needs.detect-changes.outputs.androidFiles == 'true' }}
env:
# TODO Verify app distribution groups
APP_DISTRIBUTION_GROUPS: futured-qa, devs
APP_DISTRIBUTION_ARTIFACT_TYPE: APK
FIREBASE_CREDENTIALS_FILE: firebase_credentials.json
# TODO Platform-specific slack channel name for notifications, eg. "gmlh-android"
SLACK_CHANNEL: project-slack-channel-name
# TODO verify product flavor configuration
# Specifies API environment for KMP build.
# One of [dev|prod] as per configuration of Buildkonfig plugin in :shared:network:* Gradle module.
KMP_FLAVOR: dev
steps:
- name: Set build number
run: echo "BUILD_NUMBER=$((GITHUB_RUN_NUMBER))" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Prepare environment
run: |
echo "BUILD_NUMBER=$((GITHUB_RUN_NUMBER))" >> $GITHUB_ENV
echo '${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }}' > $FIREBASE_CREDENTIALS_FILE
- name: Run unit tests
shell: bash
# `testReleaseUnitTest` covers androidApp module and all shared modules all at once. No need to call `testEnterpriseUnitTest` and `testReleaseUnitTest`.
run: ./gradlew --continue testReleaseUnitTest
- name: Assemble and upload to Firebase App Distribution
shell: bash
run: |
./gradlew \
assembleEnterprise -P buildkonfig.flavor=$KMP_FLAVOR \
appDistributionUploadEnterprise \
--serviceCredentialsFile="$FIREBASE_CREDENTIALS_FILE" \
--artifactType="$APP_DISTRIBUTION_ARTIFACT_TYPE" \
--groups="$APP_DISTRIBUTION_GROUPS"
- name: Slack Notification
if: failure()
uses: homoluctus/slatify@master
with:
type: "failure"
job_name: '*Enterprise build*'
username: GitHub
channel: ${{env.SLACK_CHANNEL}}
url: ${{secrets.SLACK_WEB_HOOK}}
commit: true
token: ${{secrets.GITHUB_TOKEN}}