mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-27 22:04:08 +02:00
Update deploy APK workflow
This commit is contained in:
@@ -12,57 +12,57 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: checkout sources
|
- name: checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: use Node.js 20.x
|
- name: use Node.js 20.x
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
- name: Set up Java
|
- name: Set up Java
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
distribution: "temurin"
|
distribution: 'temurin'
|
||||||
java-version: 17
|
java-version: 17
|
||||||
|
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: build Nuxt project
|
- name: build Nuxt project
|
||||||
run: npm run generate
|
run: npm run generate
|
||||||
|
|
||||||
- name: copy to Android project
|
- name: copy to Android project
|
||||||
run: npx cap sync
|
run: npx cap sync
|
||||||
|
|
||||||
- name: build Android app
|
- name: build Android app
|
||||||
run: ./android/gradlew assembleDebug -p android --no-daemon
|
run: ./android/gradlew assembleDebug -p android --no-daemon
|
||||||
|
|
||||||
- name: rename apk
|
- name: rename apk
|
||||||
working-directory: android/app/build/outputs/apk/debug/
|
working-directory: android/app/build/outputs/apk/debug/
|
||||||
run: |
|
run: |
|
||||||
build="$(date +%Y%m%d-%H%M%S)-$(git rev-parse --short HEAD)"
|
build="$(date +%Y%m%d-%H%M%S)-$(git rev-parse --short HEAD)"
|
||||||
name="audiobookshelf-${build}.apk"
|
name="audiobookshelf-${build}.apk"
|
||||||
mv -v app-debug.apk "${name}"
|
mv -v app-debug.apk "${name}"
|
||||||
|
|
||||||
- name: prepare test page ressources
|
- name: prepare test page ressources
|
||||||
run: |
|
run: |
|
||||||
mkdir ghpages
|
mkdir ghpages
|
||||||
cp android/app/build/outputs/apk/debug/*apk ghpages/
|
cp android/app/build/outputs/apk/debug/*apk ghpages/
|
||||||
cp static/Logo.png ghpages/logo.png
|
cp static/Logo.png ghpages/logo.png
|
||||||
cp .github/testing-page-template.html ghpages/index.html
|
cp .github/testing-page-template.html ghpages/index.html
|
||||||
|
|
||||||
- name: build test page
|
- name: build test page
|
||||||
working-directory: ghpages
|
working-directory: ghpages
|
||||||
run: |
|
run: |
|
||||||
sed -i "s/__DATE__/$(date)/g" index.html
|
sed -i "s/__DATE__/$(date)/g" index.html
|
||||||
sed -i "s/__COMMIT__/$(git rev-parse --short HEAD)/g" index.html
|
sed -i "s/__COMMIT__/$(git rev-parse --short HEAD)/g" index.html
|
||||||
sed -i "s/__APK__/$(ls *apk)/g" index.html
|
sed -i "s/__APK__/$(ls *apk)/g" index.html
|
||||||
|
|
||||||
- name: upload test page artifact
|
- name: upload test page artifact
|
||||||
uses: actions/upload-pages-artifact@v1
|
uses: actions/upload-pages-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: ./ghpages
|
path: ./ghpages
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
needs: build
|
needs: build
|
||||||
@@ -79,4 +79,4 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: deploy to GitHub Pages
|
- name: deploy to GitHub Pages
|
||||||
id: deployment
|
id: deployment
|
||||||
uses: actions/deploy-pages@v1
|
uses: actions/deploy-pages@v4
|
||||||
|
|||||||
Reference in New Issue
Block a user