Skip to content

Commit 6a2bc40

Browse files
committed
Add workflow for uploading build assets to Google Play Console
1 parent 7c341f4 commit 6a2bc40

2 files changed

Lines changed: 115 additions & 11 deletions

File tree

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: google play console
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
release_tag:
7+
required: true
8+
type: string
9+
gcp_wif_provider:
10+
description: >
11+
Full resource name of the Google Cloud Workload Identity Federation
12+
provider used for GitHub OIDC authentication
13+
(format: projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/providers/PROVIDER_ID).
14+
required: true
15+
type: string
16+
gcp_service_account:
17+
description: >
18+
Email address of the Google Cloud service account to impersonate via
19+
Workload Identity Federation. This service account must be granted
20+
the appropriate permissions in the Google Play Console for uploading
21+
Android app builds (no static service account keys are used).
22+
required: true
23+
type: string
24+
package_name:
25+
description: >
26+
The Android application ID of the app in Google Play (for example,
27+
'com.earthmanmuons.whatchord'). This must match the package name used
28+
when the app was first created in the Play Console.
29+
required: true
30+
type: string
31+
track:
32+
description: >
33+
The Google Play release track to which the uploaded app bundle will be
34+
assigned (such as 'internal', 'alpha', 'beta', or 'production').
35+
required: false
36+
type: string
37+
default: internal
38+
release_status:
39+
description: >
40+
The release status to apply after uploading the app bundle.
41+
Use 'draft' to create a draft release in the Play Console for
42+
manual review and publishing, or 'completed' to publish
43+
immediately to the selected track.
44+
required: false
45+
type: string
46+
default: draft
47+
48+
jobs:
49+
upload_build:
50+
runs-on: ubuntu-latest
51+
environment: release
52+
permissions:
53+
contents: read
54+
id-token: write
55+
steps:
56+
- name: Checkout source code
57+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
58+
with:
59+
persist-credentials: false
60+
61+
- name: Add Toolbox Envy to PATH
62+
uses: EarthmanMuons/toolbox-envy/.github/actions/add-to-path@main
63+
with:
64+
include_bins: |
65+
common
66+
flutter
67+
68+
- name: Download release assets
69+
env:
70+
GH_TOKEN: ${{ github.token }}
71+
RELEASE_TAG: ${{ inputs.release_tag }}
72+
run: |
73+
set -euo pipefail
74+
75+
mkdir -p dist
76+
gh release download "$RELEASE_TAG" \
77+
--pattern "*.aab" \
78+
--pattern "sha256sums.txt" \
79+
--dir dist
80+
81+
- id: verify_assets
82+
name: Verify release assets
83+
run: verify-checksums --dir dist --pattern '*.aab'
84+
85+
- id: gcp_auth
86+
name: Configure Google Cloud authentication
87+
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093
88+
with:
89+
workload_identity_provider: ${{ inputs.gcp_wif_provider }}
90+
service_account: ${{ inputs.gcp_service_account }}
91+
92+
- name: upload aab
93+
uses: r0adkll/upload-google-play@935ef9c68bb393a8e6116b1575626a7f5be3a7fb
94+
with:
95+
serviceAccountJson: ${{ steps.gcp_auth.outputs.credentials_file_path }}
96+
packageName: ${{ inputs.package_name }}
97+
releaseFiles: dist/*.aab
98+
track: ${{ inputs.track }}
99+
status: ${{ inputs.release_status }}

.github/workflows/upload-build-ios.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: app store connect
33
on:
44
workflow_call:
55
inputs:
6+
release_tag:
7+
required: true
8+
type: string
69
asc_issuer_id:
710
description: >
811
App Store Connect issuer identifier. Required for JWT authentication.
@@ -13,9 +16,6 @@ on:
1316
App Store Connect API key identifier. Required for JWT authentication.
1417
required: true
1518
type: string
16-
release_tag:
17-
required: true
18-
type: string
1919
secrets:
2020
ASC_AUTH_KEY_B64:
2121
description: >
@@ -29,20 +29,18 @@ jobs:
2929
permissions:
3030
contents: read
3131
steps:
32+
- name: Checkout source code
33+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
34+
with:
35+
persist-credentials: false
36+
3237
- name: Add Toolbox Envy to PATH
3338
uses: EarthmanMuons/toolbox-envy/.github/actions/add-to-path@main
3439
with:
3540
include_bins: |
3641
common
3742
flutter
3843
39-
- id: asc_auth
40-
name: Configure App Store Connect authentication
41-
env:
42-
ASC_AUTH_KEY_B64: ${{ secrets.ASC_AUTH_KEY_B64 }}
43-
ASC_KEY_ID: ${{ inputs.asc_key_id }}
44-
run: asc-auth-key-setup
45-
4644
- name: Download release assets
4745
env:
4846
GH_TOKEN: ${{ github.token }}
@@ -60,6 +58,13 @@ jobs:
6058
name: Verify release assets
6159
run: verify-checksums --dir dist --pattern '*.ipa'
6260

61+
- id: asc_auth
62+
name: Configure App Store Connect authentication
63+
env:
64+
ASC_AUTH_KEY_B64: ${{ secrets.ASC_AUTH_KEY_B64 }}
65+
ASC_KEY_ID: ${{ inputs.asc_key_id }}
66+
run: asc-auth-key-setup
67+
6368
- name: Upload ipa
6469
env:
6570
API_PRIVATE_KEYS_DIR: ${{ steps.asc_auth.outputs.asc_key_dir }}
@@ -69,7 +74,7 @@ jobs:
6974
run: |
7075
set -euo pipefail
7176
xcrun altool --upload-app --type ios \
72-
-f "${ASSET_PATH}" \
77+
-f dist/*.ipa \
7378
--apiKey "$ASC_KEY_ID" \
7479
--apiIssuer "$ASC_ISSUER_ID"
7580

0 commit comments

Comments
 (0)