Skip to content

Commit e0ed013

Browse files
committed
Add workflow for uploading build assets to App Store Connect
1 parent b1d249d commit e0ed013

1 file changed

Lines changed: 84 additions & 0 deletions

File tree

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: app store connect
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
asc_issuer_id:
7+
description: >
8+
App Store Connect issuer identifier. Required for JWT authentication.
9+
required: true
10+
type: string
11+
asc_key_id:
12+
description: >
13+
App Store Connect API key identifier. Required for JWT authentication.
14+
required: true
15+
type: string
16+
release_tag:
17+
required: true
18+
type: string
19+
secrets:
20+
ASC_AUTH_KEY_B64:
21+
description: >
22+
Base64-encoded AuthKey file (.p8) used for App Store Connect API JWT authentication.
23+
required: true
24+
25+
jobs:
26+
upload_build:
27+
runs-on: macos-latest
28+
environment: release
29+
permissions:
30+
contents: read
31+
steps:
32+
- name: Add Toolbox Envy to PATH
33+
uses: EarthmanMuons/toolbox-envy/.github/actions/add-to-path@main
34+
with:
35+
include_bins: |
36+
common
37+
flutter
38+
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+
46+
- name: Download release assets
47+
env:
48+
GH_TOKEN: ${{ github.token }}
49+
RELEASE_TAG: ${{ inputs.release_tag }}
50+
run: |
51+
set -euo pipefail
52+
53+
mkdir -p dist
54+
gh release download "$RELEASE_TAG" \
55+
--pattern "*.ipa" \
56+
--pattern "sha256sums.txt" \
57+
--dir dist
58+
59+
- id: verify_assets
60+
name: Verify release assets
61+
run: verify-checksums --dir dist --pattern '*.ipa'
62+
63+
- name: Upload ipa
64+
env:
65+
API_PRIVATE_KEYS_DIR: ${{ steps.asc_auth.outputs.asc_key_dir }}
66+
ASC_ISSUER_ID: ${{ inputs.asc_issuer_id }}
67+
ASC_KEY_ID: ${{ inputs.asc_key_id }}
68+
ASSET_PATH: ${{ steps.verify_assets.outputs.asset_path }}
69+
run: |
70+
set -euo pipefail
71+
xcrun altool --upload-app --type ios \
72+
-f "${ASSET_PATH}" \
73+
--apiKey "$ASC_KEY_ID" \
74+
--apiIssuer "$ASC_ISSUER_ID"
75+
76+
- name: Annotate workflow run with uploaded ipa
77+
env:
78+
ASSET_NAME: ${{ steps.verify_assets.outputs.asset_name }}
79+
run: |
80+
{
81+
printf '### :shipit: Uploaded iOS build:\n'
82+
printf '\n'
83+
printf -- '- [%s]\n' "${ASSET_NAME}"
84+
} >>"$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)