Upload to google play #6
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
name: windowsCI | |
on: | |
push: | |
branches: [ ] | |
pull_request: | |
branches: [ ] | |
workflow_dispatch: | |
env: | |
DOTNETVERSION: 8.0.x | |
jobs: | |
buildAndroid: | |
runs-on: windows-2022 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET SDK ${{env.DOTNETVERSION}} | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '${{env.DOTNETVERSION}}' | |
- name: List installed .NET info | |
shell: pwsh | |
run: dotnet --info | |
- name: Install .NET MAUI | |
shell: bash | |
run: | | |
dotnet nuget locals all --clear | |
dotnet workload install android | |
dotnet workload install maui | |
- name: Setup Java 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '11' | |
- name: Restore nuget packages | |
run: | | |
dotnet restore HomeBudget.sln | |
- name: Setup project | |
shell: bash | |
env: | |
DATA: ${{ secrets.GOOGLE_SERVICES_JSON}} | |
run: | | |
touch HomeBudgetMaui/Platforms/Android/google-services.json | |
echo $DATA | base64 -di > HomeBudgetMaui/Platforms/Android/google-services.json | |
- name: Create Keystore file | |
uses: timheuer/base64-to-file@v1.2 | |
with: | |
fileName: "keystore.jks" | |
fileDir: "HomeBudgetMaui/" | |
encodedString: ${{ secrets.KEYSTORE }} | |
- name: Get Version | |
env: | |
NUM: ${{ github.run_number }} | |
run: | | |
$version = (200000+$($Env:GITHUB_RUN_NUMBER)) | |
echo $version | |
echo "VERSION_NUMBER=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | |
- name: Set version | |
uses: damienaicheh/update-android-version-manifest-action@v1.0.0 | |
with: | |
android-manifest-path: './HomeBudgetMaui/Platforms/Android/AndroidManifest.xml' | |
version-code: ${{ env.VERSION_NUMBER }} | |
print-file: true | |
version-name: '2.0.0' | |
- name: Build | |
run: | | |
dotnet build HomeBudgetMaui/HomeBudgetMaui.csproj -c Release /p:AndroidKeyStore=true /p:AndroidSigningKeyStore=keystore.jks /p:AndroidSigningKeyAlias=${{ secrets.KEYSTORE_ALIAS }} /p:AndroidSigningKeyPass=${{ secrets.KEYSTORE_PASS }} /p:AndroidSigningStorePass=${{ secrets.KEYSTORE_ALIAS_PASS }} --no-restore | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Bundle | |
path: HomeBudgetMaui/bin/Release/net8.0-android/com.darktower.homebudget-Signed.aab | |
retention-days: 5 | |
- name: Upload build to Google Play | |
if: ${{ github.ref_name == 'maui' }} | |
uses: KevinRohn/github-action-upload-play-store@v1.0.0 | |
with: | |
service_account_json: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
package_name: "com.darktower.homebudget" | |
aab_file_path: "HomeBudgetMaui/bin/Release/net8.0-android/com.darktower.homebudget-Signed.aab" | |
track: "beta" | |
release_status: "draft" |