mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-05 18:45:47 +02:00
This patch removes a few restriction about when the Android build workflows run. In particular, we want to run workflows… - If the workflows themselves change because that could mean that the output changes. - If the deployment page template changes because that would mean that the published page needs to be updated. We could still exclude a few specific files if we wanted to, but they should rarely change and it's probably not worth the effort of keeping those lists updated.
76 lines
1.7 KiB
YAML
76 lines
1.7 KiB
YAML
name: Publish Test App
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- 'ios/**'
|
|
- 'readme.md'
|
|
|
|
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
|