diff --git a/.github/testing-page-template.html b/.github/testing-page-template.html new file mode 100644 index 00000000..8a3d33f2 --- /dev/null +++ b/.github/testing-page-template.html @@ -0,0 +1,81 @@ + + + + + +Audiobookshelf :: Testers + + + + + + + +

Audiobookshelf :: Testers

+ +

+ Here you can download the latest version of Audiobookshelf for Android for testing. + The app is automatically built for every new patch added to the project. +

+ +
+
Built on
+
__DATE__
+ +
Git commit
+ __COMMIT__ + +
Download
+ __APK__ +
+ +

+ Using this requires some technical knowledge to install the APK manually. + Regular users should use the releases published on the Play Store. +

+ +
+ +

Report bugs, request features, provide feedback, and contribute on GitHub

+

+ + + + + + + + + diff --git a/.github/workflows/deploy-apk.yml b/.github/workflows/deploy-apk.yml new file mode 100644 index 00000000..63654bb0 --- /dev/null +++ b/.github/workflows/deploy-apk.yml @@ -0,0 +1,73 @@ +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