mirror of
https://github.com/seepine/action-miniprogram-ci.git
synced 2025-04-05 20:00:10 +08:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b277a85ced | ||
|
6166125503 | ||
|
9d2b9bf1d6 | ||
|
1d7b9db8ea | ||
|
53aca87be0 |
16
README.md
16
README.md
@ -64,13 +64,15 @@ appid 和 setting 相关设置将会自动从 `project.config.json` 文件中读
|
||||
|
||||
| Name | Description | Default |
|
||||
| ------------------ | ------------------------------------------------------------------------------------------------------------- | --------------------- |
|
||||
| mode | ci 模式,可选 upload/preview. | upload |
|
||||
| type | 小程序类型,可选 miniProgram/miniProgramPlugin/miniGame/miniGamePlugin | miniProgram |
|
||||
| project-path | 项目的路径,即 project.config.json 所在的目录,默认根路径,即./, 若 uniapp 项目,一般传入./dist/build/mp-weixin | ./ |
|
||||
| private-key | 私钥,在获取项目属性和上传时用于鉴权使用,在微信公众平台上登录后下载, 建议通过 secrets 设置 | |
|
||||
| private-key-path | 私钥完整路径,private-key 为空时使用路径值,例如./private.key | |
|
||||
| ignores | 指定需要排除的规则,默认忽略 node_modules 路径 | node_modules/**/* |
|
||||
| version | 自定义版本号,空则根据时间戳自动生成 YYYY.MMDD.HHmmss | YYYY.MMDD.HHmmss |
|
||||
| platform | ci 平台,可选 wechat/douyin | wechat |
|
||||
| ci-version | ci的版本,默认值 `miniprogram-ci@2.0.8`, `tt-ide-cli@0.1.27` | |
|
||||
| mode | ci 模式,可选 upload/preview. | upload |
|
||||
| type | 小程序类型,可选 miniProgram/miniProgramPlugin/miniGame/miniGamePlugin | miniProgram |
|
||||
| project-path | 项目的路径,即 project.config.json 所在的目录,默认根路径,即./, 若 uniapp 项目,一般传入./dist/build/mp-weixin | ./ |
|
||||
| private-key | 私钥,在获取项目属性和上传时用于鉴权使用,在微信公众平台上登录后下载, 建议通过 secrets 设置 | |
|
||||
| private-key-path | 私钥完整路径,private-key 为空时使用路径值,例如./private.key | |
|
||||
| ignores | 指定需要排除的规则,默认忽略 node_modules 路径 | node_modules/**/* |
|
||||
| version | 自定义版本号,空则根据时间戳自动生成 YYYY.MMDD.HHmmss | YYYY.MMDD.HHmmss |
|
||||
| desc | 自定义备注 | 'fix some bug.' |
|
||||
| robot | 指定使用哪一个 ci 机器人,可选值:1 ~ 30 | 1 |
|
||||
| threads | 指定本地编译过程中开启的线程数 | 默认获取 cpu 线程数 |
|
||||
|
@ -1,6 +1,9 @@
|
||||
name: 'action-miniprogram-ci'
|
||||
description: '将 miniprogram-ci 封装为 action,通过 Actions 实现小程序自动化上传/预览'
|
||||
author: 'seepine'
|
||||
branding:
|
||||
icon: package
|
||||
color: orange
|
||||
inputs:
|
||||
mode:
|
||||
required: false
|
||||
|
5382
dist/index.js
generated
vendored
5382
dist/index.js
generated
vendored
File diff suppressed because it is too large
Load Diff
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "action-miniprogram-ci",
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.0",
|
||||
"private": true,
|
||||
"description": "将 miniprogram-ci 封装为 action, 通过 Actions 实现小程序自动化上传/预览",
|
||||
"main": "lib/main.js",
|
||||
@ -28,8 +28,7 @@
|
||||
"@actions/core": "1.10.0",
|
||||
"jimp": "0.22.10",
|
||||
"jsqr": "1.4.0",
|
||||
"qrcode-terminal": "0.12.0",
|
||||
"tt-ide-cli": "0.1.27"
|
||||
"qrcode-terminal": "0.12.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "18.16.3",
|
||||
|
@ -9,7 +9,7 @@ export const preview = async (option: Preview): Promise<string> => {
|
||||
cp.execSync(
|
||||
[
|
||||
'npx',
|
||||
`tma@${option.ciVersion || '0.1.27'}`,
|
||||
`tt-ide-cli@${option.ciVersion || '0.1.27'}`,
|
||||
'set-app-config',
|
||||
option.appid,
|
||||
'--token',
|
||||
@ -19,7 +19,7 @@ export const preview = async (option: Preview): Promise<string> => {
|
||||
|
||||
const command = [
|
||||
'npx',
|
||||
`tma@${option.ciVersion || '0.1.27'}`,
|
||||
`tt-ide-cli@${option.ciVersion || '0.1.27'}`,
|
||||
'preview',
|
||||
...getArgs(option),
|
||||
'--qrcode-output',
|
||||
@ -29,7 +29,7 @@ export const preview = async (option: Preview): Promise<string> => {
|
||||
core.info('Command:')
|
||||
core.info(` ${command}`)
|
||||
cp.execSync(command)
|
||||
cp.execSync('npx tma logout')
|
||||
cp.execSync(`npx ${`tt-ide-cli@${option.ciVersion || '0.1.27'}`} logout`)
|
||||
if (option.qrcodeFormat === 'terminal') {
|
||||
const qrcodeData = await getQrCode(option.qrcodeOutputDest)
|
||||
const qrcode = await generate(qrcodeData)
|
||||
|
@ -7,7 +7,7 @@ export const upload = async (option: Upload): Promise<void> => {
|
||||
cp.execSync(
|
||||
[
|
||||
'npx',
|
||||
`tma@${option.ciVersion || '0.1.27'}`,
|
||||
`tt-ide-cli@${option.ciVersion || '0.1.27'}`,
|
||||
'set-app-config',
|
||||
option.appid,
|
||||
'--token',
|
||||
@ -16,7 +16,7 @@ export const upload = async (option: Upload): Promise<void> => {
|
||||
)
|
||||
const command = [
|
||||
'npx',
|
||||
`tma@${option.ciVersion || '0.1.27'}`,
|
||||
`tt-ide-cli@${option.ciVersion || '0.1.27'}`,
|
||||
'upload',
|
||||
...getArgs(option),
|
||||
option.projectPath
|
||||
@ -24,5 +24,5 @@ export const upload = async (option: Upload): Promise<void> => {
|
||||
core.info('Command:')
|
||||
core.info(` ${command}`)
|
||||
cp.execSync(command)
|
||||
cp.execSync('npx tma logout')
|
||||
cp.execSync(`npx ${`tt-ide-cli@${option.ciVersion || '0.1.27'}`} logout`)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user