-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds initial script to create debug and unsigned APK's
- Loading branch information
1 parent
31fd5e0
commit 8f74c91
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: "Web to App Action" | ||
description: "Build folder path of html and creates an APK for it." | ||
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 |