const ci = require('miniprogram-ci');
const { getPrivateKey, drawTextToImage, drawImages, downloadFile } = require("./ci.util");
const { weixin } = require('./ci.config');
const { version } = require('./package.json');
(async () => {
const args = process.argv.splice(2);
const { BUILD_REMARK, BUILD_EXECUTOR, DATETIME } = process.env;
const { projectConfig, appConfigEnum } = weixin;
const currentAppInfo = appConfigEnum[args[0]];
const { appId: appid, qrcodeOutputDest, miniName, projectPath } = currentAppInfo;
const DEFAULT_UPDATE_DESCRIPTION = `${BUILD_EXECUTOR}于${DATETIME}上传`;
const WX_PRIVATE_KEY = process.env[currentAppInfo.privateKey] || ''
currentAppInfo.privateKey = getPrivateKey(WX_PRIVATE_KEY)
console.log('----- 正在初始化配置 ------')
const project = new ci.Project({
appid,
...projectConfig,
...currentAppInfo
})
console.log('----- 初始化配置成功 ------')
console.log('----- 正在生成预览码 ------')
console.log('ci', ci);
const previewResult = await ci.preview({
project,
desc: BUILD_REMARK || DEFAULT_UPDATE_DESCRIPTION, // 本次更新日志
...projectConfig,
...currentAppInfo,
})
console.log('previewResult', previewResult);
console.log('----- 生成预览码成功 ------')
以上是这是ci代码段
这是1.9.16之后的版本 没办法生成二维码
这是1.9.16的版本 这个可以生成预览二维码