-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (99 loc) · 3.74 KB
/
demo-build-basic.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
# This is a basic workflow to help you get started with Actions
name: Demo Build
# Controls when the workflow will run
on:
# Triggers the workflow on push main and any release/ branches
push:
branches:
- 'main'
- 'release/*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Specify GITHUB_TOKEN scope for the entire workflow
permissions: read-all
# Set default values for run jobs
defaults:
run:
shell: bash
env:
CI_BUILD: true
jobs:
build:
name: App Build
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout 🗄
uses: actions/checkout@v3
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Setup Android Runner 🛠️
uses: ./.github/actions/setup-android-runner
# Gradle execution - clean
- name: Clean 🧹
uses: gradle/gradle-build-action@v2
with:
arguments: clean
# Gradle execution - assemble with gradle scan and publish
- name: Build 🛠️
uses: gradle/gradle-build-action@v2
env:
SIGNING_KEYSTORE_STORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_STORE_PASSWORD }}
SIGNING_KEYSTORE_KEY_ALIAS: ${{ secrets.SIGNING_KEYSTORE_KEY_ALIAS }}
SIGNING_KEYSTORE_KEY_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_KEY_PASSWORD }}
with:
arguments: :app:assemble --scan
# Upload build artefacts
- name: Upload apk
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
retention-days: 1
name: "Build Artefacts"
path: |
app/build/outputs/apk/*/*.apk
app/build/outputs/logs/**
app/build/outputs/mapping/**
# Analyze APK
- name: Analyse Release Build - Same Repo 🛠️
id: apk-info-release
uses: ./.github/actions/apkanalyzer-checks
with:
file-path: app/build/outputs/apk/release/app-release.apk
# Analyze APK
- name: Analyse Debug Build - External Repo 🛠️
id: apk-info-debug
uses: theappbusiness/apkanalyzer-checks@main
with:
file-path: app/build/outputs/apk/debug/app-debug.apk
generate-summary: false
- name: Capture Info from APK Analyze
run: |
{
echo "### Outputs from apkanalyzer-checks action"
echo ""
echo "| Description | File Size | Download Size | Download Size Bytes |"
echo "| ----------- | --------- | ------------- | ------------------- |"
echo "| Release | ${{ steps.apk-info-release.outputs.apk-file-size }} | ${{ steps.apk-info-release.outputs.apk-download-size }} | ${{ steps.apk-info-release.outputs.apk-download-size-bytes }} |"
echo "| Debug | ${{ steps.apk-info-debug.outputs.apk-file-size }} | ${{ steps.apk-info-debug.outputs.apk-download-size }} | ${{ steps.apk-info-debug.outputs.apk-download-size-bytes }} |"
} >> $GITHUB_STEP_SUMMARY
checks:
name: Checks & Test
uses: ./.github/workflows/reusable-checks.yml
# Deploy build artefacts to target locations
deploy:
name: Deploy Builds 🚀
runs-on: ubuntu-latest
needs: [build, checks]
steps:
- name: Deploy to PlayStore
run: |
{
echo "### Deployment Summary"
echo ""
echo "This Github Action demo is now complete"
echo "Thank you"
echo ""
echo "Enjoy your friday 🎉"
} >> $GITHUB_STEP_SUMMARY