mirror of
https://github.com/seepine/action-miniprogram-ci.git
synced 2025-01-18 18:56:36 +08:00
feat: add ci version
This commit is contained in:
parent
3b085a9e01
commit
d7c77b36b1
@ -68,6 +68,9 @@ inputs:
|
||||
required: false
|
||||
description: '设置输出文件路径,默认为./output.txt'
|
||||
default: './output.txt'
|
||||
ci-version:
|
||||
required: false
|
||||
description: 'ci版本'
|
||||
runs:
|
||||
using: 'node16'
|
||||
main: 'dist/index.js'
|
||||
|
@ -33,7 +33,7 @@ export const preview = async (option: Preview): Promise<string> => {
|
||||
}
|
||||
const command = [
|
||||
'npx',
|
||||
'miniprogram-ci',
|
||||
`miniprogram-ci@${option.ciVersion || '2.0.8'}`,
|
||||
'preview',
|
||||
...getArgs(option),
|
||||
...previewArgs
|
||||
|
@ -4,9 +4,12 @@ import {getArgs} from './utils'
|
||||
import * as cp from 'child_process'
|
||||
|
||||
export const upload = async (option: Upload): Promise<void> => {
|
||||
const command = ['npx', 'miniprogram-ci', 'upload', ...getArgs(option)].join(
|
||||
' '
|
||||
)
|
||||
const command = [
|
||||
'npx',
|
||||
`miniprogram-ci@${option.ciVersion || '2.0.8'}`,
|
||||
'upload',
|
||||
...getArgs(option)
|
||||
].join(' ')
|
||||
|
||||
core.info('Command:')
|
||||
core.info(` ${command}`)
|
||||
|
@ -9,7 +9,7 @@ export const preview = async (option: Preview): Promise<string> => {
|
||||
cp.execSync(
|
||||
[
|
||||
'npx',
|
||||
'tma',
|
||||
`tma@${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',
|
||||
`tma@${option.ciVersion || '0.1.27'}`,
|
||||
'preview',
|
||||
...getArgs(option),
|
||||
'--qrcode-output',
|
||||
|
@ -7,7 +7,7 @@ export const upload = async (option: Upload): Promise<void> => {
|
||||
cp.execSync(
|
||||
[
|
||||
'npx',
|
||||
'tma',
|
||||
`tma@${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',
|
||||
`tma@${option.ciVersion || '0.1.27'}`,
|
||||
'upload',
|
||||
...getArgs(option),
|
||||
option.projectPath
|
||||
|
@ -48,7 +48,9 @@ async function run(): Promise<void> {
|
||||
version: getInput(Inputs.version) || '',
|
||||
desc: getInput(Inputs.desc),
|
||||
robot: getInputAsInt(Inputs.robot),
|
||||
threads: getInputAsInt(Inputs.threads)
|
||||
threads: getInputAsInt(Inputs.threads),
|
||||
|
||||
ciVersion: getInput(Inputs.ciVersion)
|
||||
}
|
||||
if (getInput(Inputs.mode) === 'test') {
|
||||
isTest = true
|
||||
|
@ -40,6 +40,8 @@ export type CiOption = {
|
||||
desc?: string
|
||||
robot?: number
|
||||
threads?: number
|
||||
|
||||
ciVersion?: string
|
||||
}
|
||||
|
||||
export type Upload = CiOption & {}
|
||||
|
@ -19,7 +19,9 @@ export enum Inputs {
|
||||
scene = 'scene',
|
||||
// output
|
||||
output = 'output',
|
||||
outputPath = 'output-path'
|
||||
outputPath = 'output-path',
|
||||
|
||||
ciVersion = 'ci-version'
|
||||
}
|
||||
|
||||
export enum Outputs {
|
||||
|
Loading…
x
Reference in New Issue
Block a user