-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathaction.yml
62 lines (54 loc) · 1.8 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
name: "Website to APK Action"
description: "Build folder path of html and creates an APK for it."
branding:
color: 'blue'
icon: 'smartphone'
inputs:
build-folder-path:
description: "Path to build folder"
required: false
default: "build"
app-name:
description: "Name of App"
required: false
default: "MyApp"
output-folder-path:
description: "Path to output folder"
required: false
default: "apk"
runs:
using: "composite"
steps:
- name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: actions/setup-node@v2
with:
node-version: '16.x'
- run: mkdir -p ionic_build_folder/build/
shell: bash
- name: Copy build files to ionic build folder
run: cp -r ${{ inputs.build-folder-path }}/* ionic_build_folder/build
shell: bash
- name: Setup ionic and capacitor
run: |
npm install -g @ionic/cli
npm init -y
npm install @capacitor/core
npm install @capacitor/cli --save-dev
echo '{"appId": "io.ionic.${{ inputs.app-name }}","appName": "${{ inputs.app-name }}","bundledWebRuntime": false,"npmClient": "npm","webDir": "build","cordova": {}}' > capacitor.config.json
echo '{"name": "${{ inputs.app-name }}","integrations": {"capacitor": {}},"type": "react"}' > ionic.config.json
cat ionic.config.json
cat capacitor.config.json
ionic capacitor add android
cd android
./gradlew assembleDebug
./gradlew assembleRelease
shell: bash
working-directory: ionic_build_folder
- name: Copy APK to output folder
run: |
mkdir -p ${{ inputs.output-folder-path }}
cp -r ionic_build_folder/android/app/build/outputs/apk/ ${{ inputs.output-folder-path }}/
shell: bash