@loopb/squady-apk-tool
v0.1.3
Published
Build Flutter APK and upload files to Qiniu
Readme
@loopb/squady-apk-tool
CLI tool for:
- Building Flutter APK and uploading to Qiniu
- Uploading any local file directly to Qiniu (jpg/png/webp/pdf/apk, etc.)
快速开始(中文)
- 安装:
npm i -g @loopb/squady-apk-tool- 配置七牛环境变量:
export QINIU_ACCESS_KEY=xxxx
export QINIU_SECRET_KEY=xxxx
export QINIU_BUCKET_NAME=your_bucket
export QINIU_DOWNLOAD_CDN_URL=https://cdn.example.com- 上传图片(jpg/png/webp 都可以):
squady-apk upload-file --file /path/to/photo.jpg --object-prefix images- 固定对象名上传:
squady-apk upload-file --file ./assets/banner.png --object-key images/banner.pngInstall
npm i -g @loopb/squady-apk-toolOr use without global install:
npx @loopb/squady-apk-tool --helpRequired Environment Variables
Set these in your shell, or in a project .env and pass --env:
QINIU_ACCESS_KEY=xxxx
QINIU_SECRET_KEY=xxxx
QINIU_BUCKET_NAME=your_bucket
QINIU_DOWNLOAD_CDN_URL=https://cdn.example.comOptional:
QINIU_UPLOAD_ZONE=z2
QINIU_UPLOAD_URL=up-z2.qiniup.com
QINIU_DEFAULT_OBJECT_KEY=apks/app-latest.apkQINIU_UPLOAD_ZONE supported values: z0, z1, z2, na0, as0.
Commands
1) Build Flutter APK and upload
squady-apk build-upload --project /path/to/flutter-projectWith flavor:
squady-apk build-upload --project . --flavor dev -- --dart-define=ENV=devSkip build and upload existing APK:
squady-apk build-upload --skip-build --apk /path/to/app-release.apk2) Upload any file directly
Upload image with random versioned key under prefix:
squady-apk upload-file --file /path/to/photo.jpg --object-prefix imagesUpload with fixed object key:
squady-apk upload-file --file ./assets/banner.png --object-key images/banner.pngIf no --object-key and no --object-prefix are passed, default key is:
files/<original-file-name>3) JSON output (for scripts/CI)
squady-apk upload-file --file ./assets/demo.webp --object-prefix images --jsonKey Options
--env <file>: env file path, default<project>/.env--use-system-env: allow fallback to shell env--object-key <key>: set exact key in Qiniu--object-prefix <prefix>: auto-generate random key under prefix--json: machine-readable result
Notes
- Local file path is not fixed. Any existing file path works.
- For scoped npm package publish, use:
npm publish --access public