Build Android app #86
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build for the Where-to-fly Android app | |
name: Build Android app | |
on: | |
workflow_dispatch: | |
inputs: | |
publicRelease: | |
description: 'Public release version' | |
default: false | |
type: boolean | |
jobs: | |
build: | |
runs-on: windows-latest | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 'true' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0.x | |
- name: Prepare app signing | |
uses: timheuer/base64-to-file@v1.2 | |
with: | |
fileName: 'keystore.jks' | |
fileDir: 'src/App/Maui/' | |
encodedString: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | |
- name: Calculate Android versionCode | |
shell: cmd | |
run: | | |
set /a ANDROID_VERSION_CODE=%GITHUB_RUN_NUMBER%+100 | |
echo Using android:versionCode %ANDROID_VERSION_CODE% | |
echo ANDROID_VERSION_CODE=%ANDROID_VERSION_CODE% >> %GITHUB_ENV% | |
- name: Build MapView project | |
run: > | |
dotnet build | |
src/App/MapView/WhereToFly.App.MapView.csproj | |
-f net9.0-android | |
-c Release | |
-p:PublicRelease=${{ github.event.inputs.publicRelease }} | |
- name: Build Android .apk | |
run: > | |
dotnet publish | |
src/App/Maui/WhereToFly.App.Maui.csproj | |
-f net9.0-android | |
-p:AndroidKeyStore=true | |
-p:AndroidPackageFormats=apk | |
-p:AndroidSigningKeyStore=keystore.jks | |
-p:AndroidSigningStorePass=${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
-p:AndroidSigningKeyAlias=${{ secrets.ANDROID_KEYSTORE_ALIAS }} | |
-p:AndroidSigningKeyPass=${{ secrets.ANDROID_KEY_PASSWORD }} | |
-p:PublicRelease=${{ github.event.inputs.publicRelease }} | |
-p:AndroidVersionCode=${{ env.ANDROID_VERSION_CODE }} | |
- name: Publish build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: APK file | |
path: artifacts/publish/WhereToFly.App.Maui/release_net9.0-android/de.vividos.app.wheretofly.android-Signed.apk |