Skip to content

Commit

Permalink
feat(action): add GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
Vacxe committed Apr 5, 2024
1 parent 45cac94 commit 7c60872
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
34 changes: 34 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'play-console-upload'
description: 'Upload APK to Play Console'
author: 'Konstantin Aksenov'
branding:
icon: 'upload'
color: 'blue'
inputs:
path-to-apk:
description: 'Path to apk'
required: true
version-code:
description: 'Version code'
required: true
path-to-mapping:
description: 'Path to deobfuscation mapping file'
required: false
track:
description: 'Target track'
required: false
default: 'internal'
changes-not-sent-for-review:
description: 'Do not send changes for review'
required: false
default: 'false'

runs:
using: 'docker'
image: 'github-action/Dockerfile'
args:
- ${{ inputs.path-to-apk }}
- ${{ inputs.version-code }}
- ${{ inputs.path-to-mapping }}
- ${{ inputs.track }}
- ${{ inputs.changes-not-sent-for-review }}
7 changes: 7 additions & 0 deletions github-action/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ghcr.io/vacxe/google-play-cli:0.3.9

COPY entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
28 changes: 28 additions & 0 deletions github-action/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#! /bin/bash

set -e

path_to_apk=$1
version_code=$2
path_to_mapping=$3
track=$4
changesNotSentForReview=$5

echo "Play console version:"
google-play-cli version

edit_id=$(google-play-cli edit create)
echo "Edit id created: $edit_id"
echo "Upload APK..."
google-play-cli apk upload --edit-id $edit_id --apk "$path_to_apk"
echo "Update track..."
google-play-cli tracks update --edit-id $edit_id --track $track --apk-version-code $version_code
echo "Upload deobfuscation files..."
google-play-cli deobfuscation-files upload --edit-id $edit_id --deobfuscation "$path_to_mapping" --apk-version-code $apk_version_code
echo "Validate..."
google-play-cli edit validate --edit-id $edit_id
echo "Commit..."
google-play-cli edit commit --edit-id $edit_id --parameters "{\"changesNotSentForReview\": $changesNotSentForReview}"

exit 0

0 comments on commit 7c60872

Please sign in to comment.