Fix Play Store workflow YAML syntax, extract version script

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gerwin Kuijntjes
2026-04-02 13:39:40 +02:00
parent 8141e55521
commit d099f72398
2 changed files with 18 additions and 20 deletions

View File

@@ -42,26 +42,7 @@ jobs:
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
)
VERSION_CODE=$(python3 .github/scripts/get_version_code.py)
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