mirror of
https://github.com/awatertrevi/xamarin-neo4j.git
synced 2026-10-06 01:23:55 +00:00
Add Play Store deploy workflow and bump Android version to 2.0.0
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
c5403313d9
commit
8141e55521
@@ -0,0 +1,89 @@
|
|||||||
|
name: Deploy to Play Store
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main"]
|
||||||
|
paths:
|
||||||
|
- "Xamarin.Neo4j/**"
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 45
|
||||||
|
environment: android-prod
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: "10.0.x"
|
||||||
|
|
||||||
|
- name: Setup JDK
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: microsoft
|
||||||
|
java-version: "21"
|
||||||
|
|
||||||
|
- name: Install MAUI Android workload
|
||||||
|
run: dotnet workload install maui-android
|
||||||
|
|
||||||
|
- name: Decode keystore
|
||||||
|
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > ${{ runner.temp }}/pocketgraph.jks
|
||||||
|
|
||||||
|
- name: Get next version code from Play Store
|
||||||
|
id: version
|
||||||
|
env:
|
||||||
|
PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.PLAY_SERVICE_ACCOUNT_JSON }}
|
||||||
|
run: |
|
||||||
|
pip install google-api-python-client google-auth --quiet
|
||||||
|
VERSION_CODE=$(python3 - <<'EOF'
|
||||||
|
import json, os
|
||||||
|
from googleapiclient.discovery import build
|
||||||
|
from google.oauth2 import service_account
|
||||||
|
|
||||||
|
creds = service_account.Credentials.from_service_account_info(
|
||||||
|
json.loads(os.environ['PLAY_SERVICE_ACCOUNT_JSON']),
|
||||||
|
scopes=['https://www.googleapis.com/auth/androidpublisher']
|
||||||
|
)
|
||||||
|
service = build('androidpublisher', 'v3', credentials=creds)
|
||||||
|
edit = service.edits().insert(packageName='nl.resoftware.pocketgraph', body={}).execute()
|
||||||
|
bundles = service.edits().bundles().list(
|
||||||
|
packageName='nl.resoftware.pocketgraph',
|
||||||
|
editId=edit['id']
|
||||||
|
).execute()
|
||||||
|
service.edits().delete(packageName='nl.resoftware.pocketgraph', editId=edit['id']).execute()
|
||||||
|
max_code = max([b['versionCode'] for b in bundles.get('bundles', [])], default=0)
|
||||||
|
print(max_code + 1)
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
sed -i "s/android:versionCode=\"[^\"]*\"/android:versionCode=\"$VERSION_CODE\"/" \
|
||||||
|
Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j.Android/Properties/AndroidManifest.xml
|
||||||
|
echo "version_code=$VERSION_CODE" >> $GITHUB_OUTPUT
|
||||||
|
echo "Version code: $VERSION_CODE"
|
||||||
|
|
||||||
|
- name: Build signed AAB
|
||||||
|
working-directory: Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j.Android
|
||||||
|
run: |
|
||||||
|
dotnet publish -f net10.0-android -c Release \
|
||||||
|
-p:AndroidPackageFormat=aab \
|
||||||
|
-p:AndroidKeyStore=true \
|
||||||
|
-p:AndroidSigningKeyStore=${{ runner.temp }}/pocketgraph.jks \
|
||||||
|
-p:AndroidSigningKeyAlias=${{ secrets.KEYSTORE_ALIAS }} \
|
||||||
|
-p:AndroidSigningStorePass=${{ secrets.KEYSTORE_STORE_PASS }} \
|
||||||
|
-p:AndroidSigningKeyPass=${{ secrets.KEYSTORE_KEY_PASS }}
|
||||||
|
|
||||||
|
- name: Upload to Play Store
|
||||||
|
uses: r0adkll/upload-google-play@v1
|
||||||
|
with:
|
||||||
|
serviceAccountJsonPlainText: ${{ secrets.PLAY_SERVICE_ACCOUNT_JSON }}
|
||||||
|
packageName: nl.resoftware.pocketgraph
|
||||||
|
releaseFiles: Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j.Android/bin/Release/net10.0-android/publish/*-Signed.aab
|
||||||
|
track: internal
|
||||||
|
status: completed
|
||||||
|
whatsNewDirectory: Xamarin.Neo4j/distribution/whatsnew
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:versionCode="1"
|
android:versionCode="2"
|
||||||
android:versionName="1.0"
|
android:versionName="2.0.0"
|
||||||
package="nl.resoftware.pocketgraph">
|
package="nl.resoftware.pocketgraph">
|
||||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="36" />
|
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="36" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
<Nullable>disable</Nullable>
|
<Nullable>disable</Nullable>
|
||||||
<!-- Embed all assemblies in the APK so plain adb install works without Fast Deployment -->
|
<!-- Embed all assemblies in the APK so plain adb install works without Fast Deployment -->
|
||||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
||||||
|
<ApplicationDisplayVersion>2.0.0</ApplicationDisplayVersion>
|
||||||
|
<ApplicationVersion>2</ApplicationVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user