mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-06 11:04:52 +02:00
This page automatically builds the Android app from the latest commit on the branch master, generates a test page and publishes it to GitHub Pages as a nice way for non-developers to get the latest app version for testing without having to build it themselves. This page might need the pages source set to GitHub Actions at Settings → Pages → Build and deployment → Source.
73 lines
1.7 KiB
YAML
73 lines
1.7 KiB
YAML
name: Publish Test App
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout sources
|
|
uses: actions/checkout@v3
|
|
|
|
- name: use Node.js 16.x
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
|
|
- name: install dependencies
|
|
run: npm ci
|
|
|
|
- name: build Nuxt project
|
|
run: npm run generate
|
|
|
|
- name: copy to Android project
|
|
run: npx cap sync
|
|
|
|
- name: build Android app
|
|
run: ./android/gradlew assembleDebug -p android --no-daemon
|
|
|
|
- name: rename apk
|
|
working-directory: android/app/build/outputs/apk/debug/
|
|
run: |
|
|
build="$(date +%Y%m%d-%H%M%S)-$(git rev-parse --short HEAD)"
|
|
name="audiobookshelf-${build}.apk"
|
|
mv -v app-debug.apk "${name}"
|
|
|
|
- name: prepare test page ressources
|
|
run: |
|
|
mkdir ghpages
|
|
cp android/app/build/outputs/apk/debug/*apk ghpages/
|
|
cp static/Logo.png ghpages/logo.png
|
|
cp .github/testing-page-template.html ghpages/index.html
|
|
|
|
- name: build test page
|
|
working-directory: ghpages
|
|
run: |
|
|
sed -i "s/__DATE__/$(date)/g" index.html
|
|
sed -i "s/__COMMIT__/$(git rev-parse --short HEAD)/g" index.html
|
|
sed -i "s/__APK__/$(ls *apk)/g" index.html
|
|
|
|
- name: upload test page artifact
|
|
uses: actions/upload-pages-artifact@v1
|
|
with:
|
|
path: ./ghpages
|
|
|
|
deploy:
|
|
needs: build
|
|
|
|
permissions:
|
|
pages: write
|
|
id-token: write
|
|
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v1
|