Skip to content

Play Store Connect style CLI for Google Play Developer API

License

Notifications You must be signed in to change notification settings

unlimiting-studio/psc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@unlimiting/psc

Google Play Developer API의 공식 Edits workflow를 따르는 Node.js ESM CLI입니다.

  • 빌드 없이 node로 즉시 실행
  • 패키지명: @unlimiting/psc
  • 실행 명령: psc
  • 인증 토큰 출력 시 자동 마스킹

설치

npm i -g @unlimiting/psc

또는 로컬 실행:

npx @unlimiting/psc --help

요구사항

  • Node.js 20+
  • Google Play Console에 연결된 Service Account JSON
  • Service Account에 Android Publisher API 권한

환경변수

  • GOOGLE_APPLICATION_CREDENTIALS: 서비스 계정 JSON 파일 경로 (표준)
  • PSC_SERVICE_ACCOUNT_JSON_PATH: 서비스 계정 JSON 파일 경로 (대체)
  • PSC_SERVICE_ACCOUNT_JSON: 서비스 계정 JSON 문자열 직접 주입
  • PSC_CONFIG_PATH: psc config 파일 경로 (기본: ./.psc/config.json -> ~/.psc/config.json 순서 탐색)
  • PSC_PACKAGE_NAME: 기본 package name (예: com.example.app)
  • PSC_IMPERSONATE_SUBJECT: 도메인 위임 사용 시 subject 이메일

우선순위:

  1. PSC_SERVICE_ACCOUNT_JSON
  2. --credentials
  3. PSC_SERVICE_ACCOUNT_JSON_PATH
  4. GOOGLE_APPLICATION_CREDENTIALS
  5. ./.psc/config.json 또는 ~/.psc/config.json에 저장된 credentialsPath

명령 구조

  • auth login --credentials (자격증명 저장)
  • auth token
  • auth status --package-name
  • edits create|validate|commit
  • bundles upload --aab
  • tracks get|update
  • publish submit (create -> upload -> track update -> validate -> commit)

사용 예시

1) 인증 상태 확인

최초 1회 로그인(저장):

# 글로벌 저장: ~/.psc/service-account.json, ~/.psc/config.json
psc auth login --credentials ./service-account.json

# 로컬 저장: ./.psc/service-account.json, ./.psc/config.json
psc auth login --credentials ./service-account.json --local

저장 후에는 --credentials 없이 실행 가능:

psc auth token
psc auth status --package-name com.example.app

즉시 경로 지정이 필요하면 기존 방식도 가능:

psc auth token --credentials ./service-account.json
psc auth status --credentials ./service-account.json --package-name com.example.app

auth token은 액세스 토큰을 전체 출력하지 않고 마스킹해서 보여줍니다.

2) 수동 Edits 흐름

# edit 생성
psc edits create --credentials ./service-account.json --package-name com.example.app

# AAB 업로드
psc bundles upload --credentials ./service-account.json --package-name com.example.app --edit-id <EDIT_ID> --aab ./app-release.aab

# 트랙 업데이트
psc tracks update --credentials ./service-account.json --package-name com.example.app --edit-id <EDIT_ID> --track internal --version-code 123 --status completed

# 유효성 검증
psc edits validate --credentials ./service-account.json --package-name com.example.app --edit-id <EDIT_ID>

# 커밋
psc edits commit --credentials ./service-account.json --package-name com.example.app --edit-id <EDIT_ID>

3) 원샷 배포

psc publish submit \
  --credentials ./service-account.json \
  --package-name com.example.app \
  --aab ./app-release.aab \
  --track internal \
  --status completed

4) 점진 배포(inProgress)

psc publish submit \
  --credentials ./service-account.json \
  --package-name com.example.app \
  --aab ./app-release.aab \
  --track production \
  --status inProgress \
  --user-fraction 0.1

release notes 파일 형식

--release-notes-file은 JSON 배열 또는 JSON 객체를 지원합니다.

배열 형식:

[
  { "language": "en-US", "text": "Bug fixes" },
  { "language": "ko-KR", "text": "버그 수정" }
]

객체 형식:

{
  "en-US": "Bug fixes",
  "ko-KR": "버그 수정"
}

보안 메모

  • 토큰/비밀키 전체값은 출력하지 않습니다.
  • CLI 에러 로그도 민감정보를 직접 출력하지 않도록 최소화되어 있습니다.

GitHub Actions

  • CI: PR/main push 시 npm ci, npm test, npm pack --dry-run
  • Release: 수동 실행(workflow_dispatch)으로 버전 입력 후 npm 배포

배포 워크플로우는 npm Trusted Publishing(OIDC) 기준입니다.

  • GitHub Actions permissions에 id-token: write가 필요합니다.
  • npm 패키지 설정에서 해당 GitHub 저장소/워크플로우를 Trusted Publisher로 연결해야 합니다.

About

Play Store Connect style CLI for Google Play Developer API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors