asc-appstore-release

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

App Store Release with
asc
in GitHub Actions

在GitHub Actions中使用
asc
实现App Store发布

The developer's mental model:
Signed IPA/PKG (from your build step)
  → asc builds upload --wait        # upload + wait for Apple processing
  → asc builds add-beta-group       # optional: TestFlight distribution
  → asc builds update-beta-notes    # optional: "What's New" text
  → asc versions set-build          # link build to App Store version
  → asc versions check-readiness    # gate: verify all checks pass
  → asc versions submit             # submit for App Store review
See workflow-template.md for complete copy-paste workflows.
开发者的流程模型:
签名后的IPA/PKG(来自你的构建步骤)
  → asc builds upload --wait        # 上传并等待苹果处理
  → asc builds add-beta-group       # 可选:TestFlight分发
  → asc builds update-beta-notes    # 可选:设置“新功能介绍”文本
  → asc versions set-build          # 将构建版本关联至App Store版本
  → asc versions check-readiness    # 检查环节:验证所有检查项是否通过
  → asc versions submit             # 提交至App Store审核
完整的可直接复制使用的工作流请查看workflow-template.md

Mac App Store Certificate Setup

Mac App Store证书设置

Before the first CI run, you need
APPLE_MAS_CERTIFICATE_P12
and
APPLE_MAS_CERTIFICATE_PASSWORD
. Run the interactive setup script:
bash
.claude/skills/asc-appstore-release/scripts/setup-mas-certs.sh
The script walks through the full mental model:
Generate CSR
  → asc certificates create MAC_APP_DISTRIBUTION  (automated)
  → Apple portal: Mac Installer Distribution cert  (one browser step)
  → Export both as P12 via Keychain Access
  → Print base64 values ready to paste into GitHub Secrets
在首次运行CI之前,你需要准备
APPLE_MAS_CERTIFICATE_P12
APPLE_MAS_CERTIFICATE_PASSWORD
。运行交互式设置脚本:
bash
.claude/skills/asc-appstore-release/scripts/setup-mas-certs.sh
该脚本会引导你完成以下完整流程:
生成CSR
  → asc certificates create MAC_APP_DISTRIBUTION (自动执行)
  → 苹果后台:获取Mac Installer Distribution证书(一步浏览器操作)
  → 通过钥匙串访问导出为P12格式
  → 打印可直接粘贴到GitHub Secrets中的base64值

Install
asc
in GitHub Actions

在GitHub Actions中安装
asc

yaml
- name: Install asc CLI
  run: |
    brew tap tddworks/tap
    brew install asccli
Or download a specific version directly:
yaml
- name: Install asc CLI
  run: |
    VERSION="0.1.3"
    ARCH=$(uname -m | sed 's/x86_64/x86_64/;s/arm64/arm64/')
    curl -sL "https://github.com/tddworks/asc-cli/releases/download/v${VERSION}/asc_${VERSION}_macOS_${ARCH}" \
      -o /usr/local/bin/asc && chmod +x /usr/local/bin/asc
yaml
- name: Install asc CLI
  run: |
    brew tap tddworks/tap
    brew install asccli
或者直接下载指定版本:
yaml
- name: Install asc CLI
  run: |
    VERSION="0.1.3"
    ARCH=$(uname -m | sed 's/x86_64/x86_64/;s/arm64/arm64/')
    curl -sL "https://github.com/tddworks/asc-cli/releases/download/v${VERSION}/asc_${VERSION}_macOS_${ARCH}" \
      -o /usr/local/bin/asc && chmod +x /usr/local/bin/asc

Auth Setup

身份验证设置

asc
reads credentials from environment variables automatically:
yaml
env:
  ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
  ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
  ASC_PRIVATE_KEY: ${{ secrets.ASC_PRIVATE_KEY }}   # PEM content, NOT a path
Required GitHub Secrets:
SecretValue
ASC_KEY_ID
App Store Connect API Key ID (e.g.
6X3CMK22CY
)
ASC_ISSUER_ID
Issuer ID (UUID format)
ASC_PRIVATE_KEY
Full PEM content of the
.p8
file
To get the PEM content from your
.p8
file:
bash
cat AuthKey_XXXXXX.p8 | pbcopy   # paste as the secret value
asc
会自动从环境变量中读取凭证:
yaml
env:
  ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
  ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
  ASC_PRIVATE_KEY: ${{ secrets.ASC_PRIVATE_KEY }}   # PEM内容,而非文件路径
所需的GitHub Secrets:
密钥名称取值
ASC_KEY_ID
App Store Connect API密钥ID(例如
6X3CMK22CY
ASC_ISSUER_ID
发行者ID(UUID格式)
ASC_PRIVATE_KEY
.p8
文件的完整PEM内容
.p8
文件获取PEM内容的方法:
bash
cat AuthKey_XXXXXX.p8 | pbcopy   # 复制后粘贴为密钥值

Core Commands

核心命令

bash
undefined
bash
undefined

1. Upload IPA (auto-detects iOS from .ipa, macOS from .pkg)

1. 上传IPA(自动从.ipa识别iOS,从.pkg识别macOS)

asc builds upload
--app-id $APP_ID
--file MyApp.ipa
--version $VERSION
--build-number $BUILD_NUMBER
--wait # blocks until COMPLETE or FAILED
asc builds upload
--app-id $APP_ID
--file MyApp.ipa
--version $VERSION
--build-number $BUILD_NUMBER
--wait # 阻塞直至处理完成或失败

2. Get the processed build ID

2. 获取处理后的构建ID

BUILD_ID=$(asc builds list --app-id $APP_ID --pretty | jq -r '.data[0].id')
BUILD_ID=$(asc builds list --app-id $APP_ID --pretty | jq -r '.data[0].id')

3. TestFlight: add to beta group

3. TestFlight:添加至测试组

asc builds add-beta-group --build-id $BUILD_ID --beta-group-id $GROUP_ID
asc builds add-beta-group --build-id $BUILD_ID --beta-group-id $GROUP_ID

4. TestFlight: set "What's New" notes

4. TestFlight:设置“新功能介绍”说明

asc builds update-beta-notes
--build-id $BUILD_ID
--locale en-US
--notes "Bug fixes and improvements."
asc builds update-beta-notes
--build-id $BUILD_ID
--locale en-US
--notes "修复Bug并优化体验。"

5. App Store: link build to version

5. App Store:将构建关联至版本

VERSION_ID=$(asc versions list --app-id $APP_ID --pretty | jq -r '.data[0].id') asc versions set-build --version-id $VERSION_ID --build-id $BUILD_ID
VERSION_ID=$(asc versions list --app-id $APP_ID --pretty | jq -r '.data[0].id') asc versions set-build --version-id $VERSION_ID --build-id $BUILD_ID

6. App Store: gate — verify all checks pass before submitting

6. App Store:提交前检查——验证所有检查项通过后再提交

READINESS=$(asc versions check-readiness --version-id $VERSION_ID) IS_READY=$(echo "$READINESS" | jq -r '.data[0].isReadyToSubmit') if [ "$IS_READY" != "true" ]; then echo "Version is NOT ready to submit:" echo "$READINESS" | jq '.data[0] | {stateCheck, buildCheck, pricingCheck}' exit 1 fi
READINESS=$(asc versions check-readiness --version-id $VERSION_ID) IS_READY=$(echo "$READINESS" | jq -r '.data[0].isReadyToSubmit') if [ "$IS_READY" != "true" ]; then echo "版本尚未准备好提交:" echo "$READINESS" | jq '.data[0] | {stateCheck, buildCheck, pricingCheck}' exit 1 fi

7. App Store: submit for review

7. App Store:提交审核

asc versions submit --version-id $VERSION_ID
undefined
asc versions submit --version-id $VERSION_ID
undefined

Finding Your IDs

查找各类ID

bash
undefined
bash
undefined

App ID (do this once, store as a secret or env var)

App ID(执行一次,存储为密钥或环境变量)

asc apps list --pretty | jq -r '.data[] | "(.name): (.id)"'
asc apps list --pretty | jq -r '.data[] | "(.name): (.id)"'

Beta group ID

Beta测试组ID

asc testflight groups list --app-id $APP_ID --pretty | jq -r '.data[0].id'
asc testflight groups list --app-id $APP_ID --pretty | jq -r '.data[0].id'

Current version ID (latest editable version)

当前版本ID(最新可编辑版本)

asc versions list --app-id $APP_ID --pretty | jq -r '.data[0].id'
undefined
asc versions list --app-id $APP_ID --pretty | jq -r '.data[0].id'
undefined