Skip to content

Commit 8f74c91

Browse files
committed
Adds initial script to create debug and unsigned APK's
1 parent 31fd5e0 commit 8f74c91

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

action.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "Web to App Action"
2+
description: "Build folder path of html and creates an APK for it."
3+
inputs:
4+
build-folder-path:
5+
description: "Path to build folder"
6+
required: false
7+
default: "build"
8+
9+
app-name:
10+
description: "Name of App"
11+
required: false
12+
default: "MyApp"
13+
14+
output-folder-path:
15+
description: "Path to output folder"
16+
required: false
17+
default: "apk"
18+
19+
runs:
20+
using: "composite"
21+
steps:
22+
- name: Setup JDK
23+
uses: actions/setup-java@v1
24+
with:
25+
java-version: 1.8
26+
27+
- uses: actions/setup-node@v2
28+
with:
29+
node-version: '16.x'
30+
31+
- run: mkdir -p ionic_build_folder/build/
32+
shell: bash
33+
34+
- name: Copy build files to ionic build folder
35+
run: cp -r ${{ inputs.build-folder-path }}/* ionic_build_folder/build
36+
shell: bash
37+
38+
- name: Setup ionic and capacitor
39+
run: |
40+
npm install -g @ionic/cli
41+
npm init -y
42+
npm install @capacitor/core
43+
npm install @capacitor/cli --save-dev
44+
echo '{"appId": "io.ionic.${{ inputs.app-name }}","appName": "${{ inputs.app-name }}","bundledWebRuntime": false,"npmClient": "npm","webDir": "build","cordova": {}}' > capacitor.config.json
45+
echo '{"name": "${{ inputs.app-name }}","integrations": {"capacitor": {}},"type": "react"}' > ionic.config.json
46+
cat ionic.config.json
47+
cat capacitor.config.json
48+
ionic capacitor add android
49+
cd android
50+
./gradlew assembleDebug
51+
./gradlew assembleRelease
52+
shell: bash
53+
working-directory: ionic_build_folder
54+
55+
- name: Copy APK to output folder
56+
run: |
57+
mkdir -p ${{ inputs.output-folder-path }}
58+
cp -r ionic_build_folder/android/app/build/outputs/apk/ ${{ inputs.output-folder-path }}/
59+
shell: bash

0 commit comments

Comments
 (0)