Skip to content

Commit

Permalink
Add GHA; Remove websharper.log
Browse files Browse the repository at this point in the history
  • Loading branch information
Jooseppi12 committed Aug 26, 2024
1 parent d6f5a31 commit 63f4b65
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 35 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build APK

on: workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Set up Node.js with the latest LTS version
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: '6.0.x'

# Install project dependencies, including Capacitor
- name: Install dependencies
run: npm install

# Install the latest LTS Java JDK 17 (the current LTS as of 2024)
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

# Install Android SDK with the latest available tools
- name: Install Android SDK
uses: android-actions/setup-android@v2
with:
api-level: 34 # Latest Android API level as of 2024
build-tools: '34.0.0' # Corresponding build-tools version
ndk: '25.2.9519653' # Latest stable NDK as of 2024

- name: Build app
run: |
cd Capacitor.Sample
dotnet build
npx vite build
# Add the Android platform to the Capacitor project
- name: Add Android platform
run: |
npx cap add android
npx cap sync
# Build the APK using Gradle
- name: Build Android APK
run: |
cd Capacitor.Sample
cd android
./gradlew assembleDebug
- name: List files
run: ls -aR > filelist.txt

# Upload the APK as a build artifact
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: app-debug.apk
path: android/app/build/outputs/apk/debug/app-debug.apk

- name: Upload Filelist
uses: actions/upload-artifact@v3
with:
name: filelist.txt
path: filelist.txt
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
/paket-files/
.vscode/
.idea/
*.userwebsharper.log
*.user
websharper.log
/Capacitor*/vite*
/Capacitor*/bin
/Capacitor*/obj
Expand Down
24 changes: 0 additions & 24 deletions Capacitor.Sample/websharper.log

This file was deleted.

10 changes: 0 additions & 10 deletions Capacitor/websharper.log

This file was deleted.

0 comments on commit 63f4b65

Please sign in to comment.