Skip to content

Commit

Permalink
add Cordova
Browse files Browse the repository at this point in the history
  • Loading branch information
floki1250 committed Oct 4, 2024
1 parent f1719b2 commit 8de4115
Show file tree
Hide file tree
Showing 7 changed files with 2,199 additions and 1 deletion.
65 changes: 65 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build Nuxt and Cordova

on:
push:
branches:
- main # Adjust to your main branch
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3

# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18" # Adjust to your Node.js version

# Step 3: Install dependencies for Nuxt 3 project
- name: Install dependencies
run: npm install
working-directory: . # Root directory

# Step 4: Build the Nuxt 3 app
- name: Build Nuxt 3 app
run: npm run build
working-directory: . # Root directory

# Step 5: Copy Nuxt build output to Cordova 'www' folder
- name: Copy Nuxt build to Cordova www
run: |
rm -rf mobile/www/*
cp -r dist/* mobile/www/
working-directory: .

# Step 6: Set up Java (required for Cordova)
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: "11" # You may need to adjust the version for Cordova compatibility

# Step 7: Set up Android SDK (required for Cordova)
- name: Install Android SDK
uses: malinskiy/action-android@v2
with:
api-level: 30 # Adjust to your preferred Android API level
target: default
arch: x86_64
ndk: "21.4.7075529" # Adjust NDK version if needed

# Step 8: Install Cordova
- name: Install Cordova
run: npm install -g cordova

# Step 9: Build the Cordova Android app
- name: Build Cordova Android app
run: |
cordova platform add android
cordova build android
working-directory: mobile
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
.nitro
.cache
dist

mobile/www
mobile/platforms
# Node dependencies
node_modules

Expand Down
26 changes: 26 additions & 0 deletions mobile/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

.DS_Store

# Generated by package manager
node_modules/

# Generated by Cordova
/plugins/
/platforms/
11 changes: 11 additions & 0 deletions mobile/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.magic.magicping" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>MagicPing</name>
<description>Sample Apache Cordova App</description>
<author email="dev@cordova.apache.org" href="https://cordova.apache.org">
Apache Cordova Team
</author>
<content src="index.html" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
</widget>
Loading

0 comments on commit 8de4115

Please sign in to comment.