Release Android #103
Workflow file for this run
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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: Release Android | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0.x | |
- name: Setup MAUI android | |
run: dotnet workload install android | |
# When running on a self hosted mac runner, the ios workload needs to be installed due to csproj configuration | |
- name: Setup MAUI iOS | |
if: ${{ runner.os == 'macOS' }} | |
run: dotnet workload install ios | |
- name: Setup MAUI | |
run: dotnet workload restore | |
- name: Restore dependencies | |
run: dotnet restore -p:TargetFramework=net9.0-android | |
- name: Put keystore | |
env: | |
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | |
run: echo "${ANDROID_KEYSTORE_BASE64}" | base64 -d > liftlog.keystore | |
working-directory: ./LiftLog.Maui | |
- uses: mlilback/build-number@v1 | |
name: Set build number | |
id: buildNumber | |
with: | |
base: 100 | |
run-id: ${{github.run_number}} | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "microsoft" | |
java-version: "17" | |
- name: Setup Android SDK Tools | |
uses: android-actions/[email protected] | |
- name: Build Tailwind | |
run: npm i && npm run build | |
working-directory: ./LiftLog.Ui | |
- name: Build UI # Seems that the typescript built files dont get copied to the publish folder unless we build the project first | |
run: dotnet build -c Release | |
working-directory: ./LiftLog.Ui | |
- name: Build | |
run: dotnet publish -p:TargetFramework=net9.0-android -f net9.0-android -c Release -p:CompressionEnabled=false -p:BuildFor=android -p:AndroidKeyStore=true -p:AndroidSigningKeyStore=liftlog.keystore -p:AndroidSigningKeyAlias=liftlog -p:AndroidSigningKeyPass=env:KEYSTORE_PASS -p:AndroidSigningStorePass=env:KEYSTORE_PASS -p:UseSentryCLI=true -p:ApplicationDisplayVersion=${{ github.event.release.name }} -p:ApplicationVersion=${{ steps.buildNumber.outputs.build-number }} | |
working-directory: ./LiftLog.Maui | |
env: | |
KEYSTORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASS }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
- name: Upload Android Release to Play Store | |
uses: r0adkll/[email protected] | |
with: | |
packageName: com.limajuice.liftlog | |
releaseFiles: LiftLog.Maui/bin/Release/net9.0-android/publish/com.limajuice.liftlog-Signed.aab | |
track: internal | |
status: completed | |
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} | |
whatsNewDirectory: release_notes |