Skip to content

Commit e71718d

Browse files
committed
fix(action): move package and sa to top level
1 parent 71be8d6 commit e71718d

File tree

4 files changed

+20
-32
lines changed

4 files changed

+20
-32
lines changed

Diff for: github-action/entrypoint.sh

+9-3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ USER_FRACTION=${12}
3131
echo "Play console version:"
3232
google-play-cli version
3333

34+
checkParameter "Service Account JSON" "$SERVICE_ACCOUNT_JSON"
35+
export PLAYSTORE_SERVICE_ACCOUNT_JSON_CONTENT="$SERVICE_ACCOUNT_JSON"
36+
37+
echo "Package name: $PACKAGE_NAME"
38+
export APP_PACKAGE_NAME="$PACKAGE_NAME"
39+
3440
echo "Template: $TEMPLATE"
3541

3642
case $TEMPLATE in
@@ -45,23 +51,23 @@ case $TEMPLATE in
4551
checkParameter "Version code" "$VERSION_CODE"
4652
checkParameter "Path to apk" "$PATH_TO_APK"
4753

48-
sh /templates/apk-upload.sh "$SERVICE_ACCOUNT_JSON" "$PACKAGE_NAME" "$PATH_TO_APK" "$VERSION_CODE" "$TRACK" "$FLAG_CHANGES_NOT_SENT_FOR_REVIEW" "$STATUS" "$USER_FRACTION"
54+
sh /templates/apk-upload.sh "$PATH_TO_APK" "$VERSION_CODE" "$TRACK" "$FLAG_CHANGES_NOT_SENT_FOR_REVIEW" "$STATUS" "$USER_FRACTION"
4955
;;
5056

5157
"bundles-upload")
5258
checkParameter "Package name" "$PACKAGE_NAME"
5359
checkParameter "Version code" "$VERSION_CODE"
5460
checkParameter "Path to bundle" "$PATH_TO_BUNDLE"
5561

56-
sh /templates/bundles-upload.sh "$SERVICE_ACCOUNT_JSON" "$PACKAGE_NAME" "$PATH_TO_BUNDLE" "$VERSION_CODE" "$TRACK" "$FLAG_CHANGES_NOT_SENT_FOR_REVIEW" "$STATUS" "$USER_FRACTION"
62+
sh /templates/bundles-upload.sh "$PATH_TO_BUNDLE" "$VERSION_CODE" "$TRACK" "$FLAG_CHANGES_NOT_SENT_FOR_REVIEW" "$STATUS" "$USER_FRACTION"
5763
;;
5864

5965
"deobfuscation-files-upload")
6066
checkParameter "Package name" "$PACKAGE_NAME"
6167
checkParameter "Version code" "$VERSION_CODE"
6268
checkParameter "Path to mapping" "$PATH_TO_MAPPING"
6369

64-
sh /templates/deobfuscation-files-upload.sh "$SERVICE_ACCOUNT_JSON" "$PACKAGE_NAME" "$PATH_TO_MAPPING" "$VERSION_CODE" "$FLAG_CHANGES_NOT_SENT_FOR_REVIEW"
70+
sh /templates/deobfuscation-files-upload.sh "$PATH_TO_MAPPING" "$VERSION_CODE" "$FLAG_CHANGES_NOT_SENT_FOR_REVIEW"
6571
;;
6672

6773
*)

Diff for: github-action/templates/apk-upload.sh

+4-10
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
set -e
44

5-
SERVICE_ACCOUNT_JSON="${1}"
6-
PACKAGE_NAME=$2
75
PATH_TO_APK=$3
86
VERSION_CODE=$4
97
TRACK=$5
@@ -12,7 +10,6 @@ STATUS="${7}"
1210
USER_FRACTION=${8}
1311

1412
echo "---"
15-
echo "Package name: $PACKAGE_NAME"
1613
echo "Path to apk: $PATH_TO_APK"
1714
echo "Version code: $VERSION_CODE"
1815
echo "Track: $TRACK"
@@ -21,19 +18,16 @@ echo "User fraction: $USER_FRACTION"
2118
echo "Changes not sent for review: $FLAG_CHANGES_NOT_SENT_FOR_REVIEW"
2219
echo "---"
2320

24-
export PLAYSTORE_SERVICE_ACCOUNT_JSON_CONTENT="$SERVICE_ACCOUNT_JSON"
25-
export APP_PACKAGE_NAME="$PACKAGE_NAME"
26-
2721
EDIT_ID=$(google-play-cli edit create)
2822
echo "Edit id created: $EDIT_ID"
2923
echo "Upload APK..."
30-
google-play-cli apk upload --edit-id "$EDIT_ID" --package-name "$PACKAGE_NAME" --apk "$PATH_TO_APK"
24+
google-play-cli apk upload --edit-id "$EDIT_ID" --apk "$PATH_TO_APK"
3125
echo "Update track..."
32-
google-play-cli tracks update --edit-id "$EDIT_ID" --package-name "$PACKAGE_NAME" --apk-version-code "$VERSION_CODE" --track "$TRACK" \
26+
google-play-cli tracks update --edit-id "$EDIT_ID" --apk-version-code "$VERSION_CODE" --track "$TRACK" \
3327
${USER_FRACTION:+ --user-fraction "$USER_FRACTION"} \
3428
${STATUS:+ --status "$STATUS"}
3529
echo "Validate..."
36-
google-play-cli edit validate --edit-id "$EDIT_ID" --package-name "$PACKAGE_NAME" || true # Ignore until changes-not-sent-for-review will be added as parameter
30+
google-play-cli edit validate --edit-id "$EDIT_ID" || true # Ignore until changes-not-sent-for-review will be added as parameter
3731
echo "Commit..."
38-
google-play-cli edit commit --edit-id "$EDIT_ID" --package-name "$PACKAGE_NAME" \
32+
google-play-cli edit commit --edit-id "$EDIT_ID" \
3933
${FLAG_CHANGES_NOT_SENT_FOR_REVIEW:+ --changes-not-sent-for-review "$FLAG_CHANGES_NOT_SENT_FOR_REVIEW"}

Diff for: github-action/templates/bundles-upload.sh

+4-10
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,14 @@
22

33
set -e
44

5-
SERVICE_ACCOUNT_JSON="${1}"
6-
PACKAGE_NAME="${2}"
75
PATH_TO_BUNDLE="${3}"
86
VERSION_CODE="${4}"
97
TRACK="${5}"
108
FLAG_CHANGES_NOT_SENT_FOR_REVIEW="${6}"
119
STATUS="${7}"
1210
USER_FRACTION=${8}
1311

14-
export PLAYSTORE_SERVICE_ACCOUNT_JSON_CONTENT="$SERVICE_ACCOUNT_JSON"
15-
export APP_PACKAGE_NAME="$PACKAGE_NAME"
16-
1712
echo "---"
18-
echo "Package name: $PACKAGE_NAME"
1913
echo "Path to bundle: $PATH_TO_BUNDLE"
2014
echo "Version code: $VERSION_CODE"
2115
echo "Track: $TRACK"
@@ -27,13 +21,13 @@ echo "---"
2721
EDIT_ID=$(google-play-cli edit create)
2822
echo "Edit id created: $EDIT_ID"
2923
echo "Upload Bundle..."
30-
google-play-cli bundles upload --edit-id "$EDIT_ID" --package-name "$PACKAGE_NAME" --bundle "$PATH_TO_BUNDLE"
24+
google-play-cli bundles upload --edit-id "$EDIT_ID" --bundle "$PATH_TO_BUNDLE"
3125
echo "Update track..."
32-
google-play-cli tracks update --edit-id "$EDIT_ID" --package-name "$PACKAGE_NAME" --apk-version-code "$VERSION_CODE" --track "$TRACK" \
26+
google-play-cli tracks update --edit-id "$EDIT_ID" --apk-version-code "$VERSION_CODE" --track "$TRACK" \
3327
${USER_FRACTION:+ --user-fraction "$USER_FRACTION"} \
3428
${STATUS:+ --status "$STATUS"}
3529
echo "Validate..."
36-
google-play-cli edit validate --edit-id "$EDIT_ID" --package-name "$PACKAGE_NAME" || true # Ignore until changes-not-sent-for-review will be added as parameter
30+
google-play-cli edit validate --edit-id "$EDIT_ID" || true # Ignore until changes-not-sent-for-review will be added as parameter
3731
echo "Commit..."
38-
google-play-cli edit commit --edit-id "$EDIT_ID" --package-name "$PACKAGE_NAME" \
32+
google-play-cli edit commit --edit-id "$EDIT_ID" \
3933
${FLAG_CHANGES_NOT_SENT_FOR_REVIEW:+ --changes-not-sent-for-review "$FLAG_CHANGES_NOT_SENT_FOR_REVIEW"}

Diff for: github-action/templates/deobfuscation-files-upload.sh

+3-9
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,22 @@
22

33
set -e
44

5-
SERVICE_ACCOUNT_JSON="${1}"
6-
PACKAGE_NAME="${2}"
75
PATH_TO_MAPPING="${3}"
86
VERSION_CODE="${4}"
97
FLAG_CHANGES_NOT_SENT_FOR_REVIEW="${5}"
108

119
echo "---"
12-
echo "Package name: $PACKAGE_NAME"
1310
echo "Path to mapping: $PATH_TO_MAPPING"
1411
echo "Version code: $VERSION_CODE"
1512
echo "Changes not sent for review: $FLAG_CHANGES_NOT_SENT_FOR_REVIEW"
1613
echo "---"
1714

18-
export PLAYSTORE_SERVICE_ACCOUNT_JSON_CONTENT="$SERVICE_ACCOUNT_JSON"
19-
export APP_PACKAGE_NAME="$PACKAGE_NAME"
20-
2115
EDIT_ID=$(google-play-cli edit create)
2216
echo "Edit id created: $EDIT_ID"
2317
echo "Upload deobfuscation files..."
24-
google-play-cli deobfuscation-files upload --edit-id "$EDIT_ID" --package-name "$PACKAGE_NAME" --deobfuscation "$PATH_TO_MAPPING" --apk-version-code "$VERSION_CODE"
18+
google-play-cli deobfuscation-files upload --edit-id "$EDIT_ID" --deobfuscation "$PATH_TO_MAPPING" --apk-version-code "$VERSION_CODE"
2519
echo "Validate..."
26-
google-play-cli edit validate --edit-id "$EDIT_ID" --package-name "$PACKAGE_NAME" || true # Ignore until changes-not-sent-for-review will be added as parameter
20+
google-play-cli edit validate --edit-id "$EDIT_ID" || true # Ignore until changes-not-sent-for-review will be added as parameter
2721
echo "Commit..."
28-
google-play-cli edit commit --edit-id "$EDIT_ID" --package-name "$PACKAGE_NAME" \
22+
google-play-cli edit commit --edit-id "$EDIT_ID" \
2923
${FLAG_CHANGES_NOT_SENT_FOR_REVIEW:+ --changes-not-sent-for-review "$FLAG_CHANGES_NOT_SENT_FOR_REVIEW"}

0 commit comments

Comments
 (0)