Build Android app #40
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 Forms app | |
name: Build Android Forms app | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 'true' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
- name: Build WebLib npm package | |
run: | | |
cd src/Shared/WebLib | |
npm install | |
npm run build-release | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Add MSBuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- name: Set up Java 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Prepare app signing | |
uses: joutvhu/write-file@v1.0.2 | |
with: | |
path: src/App/Android/keystore.jks | |
contents: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | |
write_mode: overwrite | |
encoding: base64 | |
- name: Set versionCode in AndroidManifest.xml | |
uses: Nambers/ReplaceStringInFile@v1.3 | |
with: | |
path: src/App/Android/Properties/AndroidManifest.xml | |
oldString: 200 | |
newString: 1${{ github.run_number }} # this works until build 100 | |
- name: Build and sign Android .apk | |
run: > | |
msbuild src/App/Android/WhereToFly.App.Android.csproj | |
/restore /t:SignAndroidPackage /p:Configuration=Release | |
/p:AndroidKeyStore=true | |
/p:AndroidSigningKeyStore=keystore.jks | |
/p:AndroidSigningStorePass=${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
/p:AndroidSigningKeyAlias=${{ secrets.ANDROID_KEYSTORE_ALIAS }} | |
/p:AndroidSigningKeyPass=${{ secrets.ANDROID_KEY_PASSWORD }} | |
- name: Publish build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: APK file | |
path: src/App/Android/bin/Release/de.vividos.app.wheretofly.android-Signed.apk |