-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (51 loc) · 1.66 KB
/
manual_dispatch_app_workflow.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
name: Manual App apk generation
run-name: Deploy by @${{ github.actor }}
on:
workflow_dispatch:
inputs:
app-type:
description: 'APK environment'
required: true
default: 'debug'
type: choice
options:
- release
- debug
jobs:
app-utils-creation:
runs-on: ubuntu-latest
outputs:
APK_NAME: ${{steps.apk-name.outputs.APK_NAME}}
APP_TYPE: ${{steps.env-type.outputs.APP_TYPE}}
steps:
- uses: actions/checkout@v3
- name: Set input environment type to environment variable 🔥
id: env-type
run: |
echo "APP_TYPE=${{ github.event.inputs.app-type }}" >> $GITHUB_ENV
- name: Get archivesBaseName
id: apk-name
run: echo "APK_NAME=app-${{env.APP_TYPE}}.apk" >> $GITHUB_OUTPUT
build-apk:
needs: app-utils-creation
runs-on: ubuntu-latest
env:
APK_NAME: ${{needs.app-utils-creation.outputs.APK_NAME}}
APP_TYPE: ${{needs.app-utils-creation.outputs.APP_TYPE}}
steps:
- uses: actions/checkout@v3
- name: set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Grant Permission to Execute
run: chmod +x gradlew
- name: Upload API Key to gradle properties 🔥
run: sed -i "s|REPLACEABLE_PIXABAY_KEY|${{secrets.PIXABAY_KEY}}|g" ./gradle.properties
- name: Build - APK 🔥
run: bash ./gradlew assemble${{env.APP_TYPE}}
- name: Uploading APK to Github Artifacts 🚀
uses: actions/upload-artifact@v3
with:
name: ${{env.APK_NAME}}
path: app/build/outputs/apk/debug/${{env.APK_NAME}}