Skip to content

fix: disable offline support for now #129

fix: disable offline support for now

fix: disable offline support for now #129

Workflow file for this run

# https://dev.to/khromov/build-your-capacitor-android-app-bundle-using-github-actions-24do
name: Build Android app
on:
push:
branches:
- master
jobs:
build:
name: Build and release APK
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v1
with:
distribution: 'zulu'
java-version: '11'
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 19.x
- name: Install app dependencies
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
run: npm install
- name: Build app
run: npm run build-mobile-app
- name: Build app assets
uses: mujo-code/[email protected]
env:
CI: "true"
with:
args: npm run build-app-assets
- name: Capacitor sync
run: npx cap sync
- name: Build APK
run: |
cd android && ./gradlew app:tasks --all && ./gradlew assembleRelease
- name: Extract Android signing key from env
run: |
echo "${{ secrets.RELEASE_KEYSTORE }}" > android/release.jks.base64
base64 -d android/release.jks.base64 > android/release.decrypted.jks
- name: Sign build
uses: r0adkll/sign-android-release@v1
id: sign_apk
with:
releaseDirectory: android/app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.RELEASE_KEYSTORE }}
alias: release
keyStorePassword: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
env:
# override default build-tools version (29.0.3) -- optional
BUILD_TOOLS_VERSION: "30.0.2"
- name: Copy and rename signed build
run: |
cp ${{steps.sign_apk.outputs.signedReleaseFile}} android/app/build/outputs/apk/release/app-release.apk
- name: Upload release APK
uses: actions/upload-artifact@v2
with:
name: app-release
path: android/app/build/outputs/apk/release/app-release.apk
pre-release:
name: Create Github Release
needs: [build]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Fetch app-release-signed.apk
uses: actions/download-artifact@v1
with:
name: app-release
path: ./app-release
- name: Generate file checksums
run: sha256sum ./app-release/app-release.apk > checksums.txt
- uses: "marvinpinto/action-automatic-releases@latest"
name: Create Release and Upload Assets
id: create_release
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Latest Android Build"
files: |
app-release/app-release.apk
checksums.txt