Skip to content

KevinGong2013/fastlane-plugin-apkgo

Repository files navigation

fastlane-plugin-apkgo

Gem CI

fastlane plugin to publish an APK to all major Chinese Android app stores in one step — via apkgo cloud.

一行 lane,将 APK 发布到华为 / 小米 / OPPO / vivo / 荣耀 / 应用宝 / 三星 / Google Play / 蒲公英 / fir 等所有主流安卓商店。凭证云端托管,发布历史可追溯。

Getting started

Add the plugin to your project:

fastlane add_plugin apkgo

Or add to your Pluginfile:

gem "fastlane-plugin-apkgo"

Prerequisites

This plugin drives the apkgo cloud Open API. Before using it:

  1. Sign up at apkgo.baici.tech.
  2. Configure store credentials and bind them to your app in the dashboard. The plugin targets stores by name — it cannot create credentials.
  3. Create an API key (Settings → API Keys) with the upload permission and put it in CI as APKGO_API_KEY.

Usage

lane :release do
  gradle(task: "assembleRelease")

  upload_to_apkgo(
    api_key: ENV["APKGO_API_KEY"],
    apk: lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH],
    package_name: "com.example.myapp",
    version_name: "1.2.3",
    release_notes: "Bug fixes and improvements",
    stores: ["huawei", "xiaomi", "oppo"] # omit = all stores bound to the app
  )
end

apk defaults to the output of the gradle action, so you can usually omit it.

Scheduled release (定时发布)

upload_to_apkgo(
  api_key: ENV["APKGO_API_KEY"],
  package_name: "com.example.myapp",
  release_time: "2026-06-20T10:00:00+08:00" # RFC3339, must be in the future
)

Stores that support scheduling honor it; others release immediately after review.

Options

Option Env Default Description
api_key APKGO_API_KEY Open API key (apkgo_…), needs upload permission
apk APKGO_APK gradle output Path to the APK
host APKGO_HOST https://apkgo.baici.tech apkgo cloud base URL (for self-hosted)
package_name APKGO_PACKAGE_NAME Required unless app_id is set
app_id APKGO_APP_ID apkgo cloud app UUID (alternative to package_name)
app_name APKGO_APP_NAME Display name when auto-creating the app
version_code APKGO_VERSION_CODE Informational; the worker re-parses the APK
version_name APKGO_VERSION_NAME Informational
release_notes APKGO_RELEASE_NOTES Update notes for each store
release_time APKGO_RELEASE_TIME Scheduled release, RFC3339 in the future
stores APKGO_STORES all bound Target store names, e.g. ["huawei","xiaomi"]
wait APKGO_WAIT true Poll until done; fail the lane if any store fails
poll_interval APKGO_POLL_INTERVAL 5 Seconds between status polls
timeout APKGO_TIMEOUT 1800 Max seconds to wait

Output

Shared value Description
APKGO_JOB_ID The created upload job id
APKGO_JOB The full job object, including per-store results

How it works

The APK bytes never transit the apkgo cloud API server — the plugin:

  1. requests a direct-to-storage upload ticket (POST /openapi/v1/uploads/tickets);
  2. uploads the APK straight to object storage (七牛 Kodo);
  3. creates the job (POST /openapi/v1/uploads);
  4. polls (GET /openapi/v1/uploads/{id}) until every store finishes, surfacing per-store success and store-side review (审核) state.

See the Open API reference.

Development

bundle install
bundle exec rspec      # tests
bundle exec rubocop    # lint

License

MIT — see LICENSE.

About

fastlane plugin to publish an APK to Chinese Android app stores via the apkgo cloud Open API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages