Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 59 additions & 8 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ name: Android CI

on:
push:
branches: [ "main" ]
branches:
- main
pull_request:
branches: [ "main" ]

jobs:
build:

build-debug-apk:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: set up JDK 21
Expand All @@ -28,9 +26,62 @@ jobs:
- name: Build debug apk
run: ./gradlew assembleDebug
- name: Rename debug apk
run: mv app/build/outputs/apk/debug/app-debug.apk webgal-$GITHUB_RUN_NUMBER-debug.apk
run: mv app/build/outputs/apk/debug/app-debug.apk webgal-debug.apk
- name: Upload debug apk
uses: actions/upload-artifact@v4
with:
name: webgal-${{ github.run_number }}-debug.apk
path: webgal-${{ github.run_number }}-debug.apk
name: webgal-debug.apk
path: webgal-debug.apk

build-template-apk:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Build template apk
run: ./gradlew assembleRelease
- name: Rename template apk
run: mv app/build/outputs/apk/release/app-release-unsigned.apk webgal-template.apk
- name: Upload template apk
uses: actions/upload-artifact@v4
with:
name: webgal-template.apk
path: webgal-template.apk

release:
runs-on: ubuntu-latest
needs:
- build-debug-apk
- build-template-apk
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create tag
id: create_tag
run: |
echo "TAG_NAME=v$(date +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.create_tag.outputs.TAG_NAME }}
draft: false
prerelease: false
files: |
artifacts/webgal-debug.apk
artifacts/webgal-template.apk
Empty file.
17 changes: 17 additions & 0 deletions app/src/main/assets/webgal/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WebGAL Android WebView Test</title>
</head>

<body>
<div style="display: flex;flex-direction:column; justify-content: center;align-items: center;font-size: 96px;">
<p>WebGAL Android WebView Test</p>
<button type="button" style="font-size: 96px;" onclick="window.close()">EXIT</button>
</div>
</body>

</html>