-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
112 lines (110 loc) · 3.4 KB
/
action.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
name: "Fastlane Build and Deploy"
description: "Uses Fastlane to build and deploy apps"
author: "Salem Fenn"
# TODO: simplify this, it icky
inputs:
build-type:
description: "Type of build, where assemble (APK) or bundle (signed AAB) are valid options."
required: true
default: "assemble"
gradle-task:
description: "Name of the gradle task to exec (eg. assembleDebug, assembleRelease, bundleRelease)"
required: false
default: "assembleDebug"
package-name:
description: "Package name"
required: false
keystore-content:
description: "Keystore file content as base64 encoded string"
required: false
keystore-password:
description: "Keystore password"
required: false
keystore-alias:
description: "Keystore alias"
required: false
json-key-data:
description: "JSON keystore file content"
required: false
project-path:
description: "Project path"
required: true
output-path:
description: "Output path of the build"
required: false
default: "output.apk"
bundler-version:
description: "Bundler version to use"
default: "2.5.5"
required: false
fastlane-version:
description: "Fastlane version to use"
default: "2.219.0"
required: false
fastlane-env:
description: "env file name to pass to fastlane --env"
required: false
ruby-version:
description: "Ruby version to use"
required: false
default: "head"
node-version:
description: "Node version to use"
required: false
default: "latest"
runs:
using: "composite"
steps:
- id: "SETUP_RUBY"
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ inputs.ruby-version }}
bundler: ${{ inputs.bundler-version }}
bundler-cache: true
- id: "SETUP_NODE"
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- id: "ENSURE_VALID_BUILD_TYPE"
env:
BUILD_TYPE: ${{ inputs.build-type }}
run: |
if [ "${BUILD_TYPE}" != "assemble" -a "${BUILD_TYPE}" != "bundle" ]; then
echo "Invalid build-type: " ${BUILD_TYPE}
exit 1
fi
shell: sh
- id: "CREATE_KEYSTORE_FILE"
env:
KEYSTORE_CONTENT: ${{ inputs.keystore-content }}
run: |
if [ -n "${KEYSTORE_CONTENT}" ]; then
echo "Creating keystore from content"
echo "${KEYSTORE_CONTENT}" | base64 -d > keystore.jks
fi
shell: sh
- id: "INSTALL_BUNDLER_PACKAGES"
run: bundle install
shell: sh
- id: "INSTALL_FASTLANE"
env:
FASTLANE_VERSION: ${{ inputs.fastlane-version }}
run: bundle add fastlane --version ${FASTLANE_VERSION}
shell: sh
- id: "RUN_FASTLANE"
env:
BUILD_TYPE: ${{ inputs.build-type }}
GRADLE_TASK: ${{ inputs.gradle-task }}
PACKAGE_NAME: ${{ inputs.package-name }}
KEYSTORE_CONTENT: ${{ inputs.keystore-content }}
KEYSTORE_PASSWORD: ${{ inputs.keystore-password }}
KEYSTORE_ALIAS: ${{ inputs.keystore-alias }}
JSON_KEY_DATA: ${{ inputs.json-key-data }}
PROJECT_PATH: ${{ inputs.project-path }}
OUTPUT_PATH: ${{ inputs.output-path }}
FASTLANE_VERSION: ${{ inputs.fastlane-version }}
FASTLANE_ENV: ${{ inputs.fastlane-env }}
ACTION_PATH: ${{ github.action_path }}
KEYSTORE_FILE_PATH: keystore.jks
run: bundle exec fastlane android ${BUILD_TYPE}
shell: sh