🎈 perf(添加自动上传体验版):
This commit is contained in:
+25
-6
@@ -1,16 +1,35 @@
|
||||
const path = require('path')
|
||||
const childProcess = require('child_process')
|
||||
const versions =
|
||||
childProcess.execSync('git rev-parse --abbrev-ref HEAD', { encoding: 'utf8' }) != 'HEAD\n'
|
||||
? childProcess.execSync('git rev-parse --abbrev-ref HEAD', { encoding: 'utf8' })
|
||||
: childProcess.execSync('git describe --tags --abbrev=0', { encoding: 'utf8' })
|
||||
const CURRENT_GITHASH = childProcess.execSync('git rev-parse --short HEAD', { encoding: 'utf8' })
|
||||
childProcess.execSync('git rev-parse --abbrev-ref HEAD', {
|
||||
encoding: 'utf8',
|
||||
}) != 'HEAD\n'
|
||||
? childProcess.execSync('git rev-parse --abbrev-ref HEAD', {
|
||||
encoding: 'utf8',
|
||||
})
|
||||
: childProcess.execSync('git describe --tags --abbrev=0', {
|
||||
encoding: 'utf8',
|
||||
})
|
||||
const CURRENT_GITHASH = childProcess.execSync('git rev-parse --short HEAD', {
|
||||
encoding: 'utf8',
|
||||
})
|
||||
const CURRENT_VERSION = `Version: ${JSON.stringify(process.env.CODE_BRANCH || versions)} ${CURRENT_GITHASH} ${new Date().toLocaleString()}`.replace(
|
||||
/\"|\\n/g,
|
||||
'',
|
||||
)
|
||||
|
||||
console.log('process::', process)
|
||||
const CIPluginOpt = {
|
||||
// 微信小程序
|
||||
weapp: {
|
||||
appid: 'wx64fe67f111d52457',
|
||||
privateKeyPath: 'key/private.wx64fe67f111d52457.key',
|
||||
// devToolsInstallPath: 'D:/weixin/微信web开发者工具',
|
||||
},
|
||||
// 版本号
|
||||
version: versions,
|
||||
// 版本发布描述
|
||||
desc: versions,
|
||||
}
|
||||
|
||||
const config = {
|
||||
projectName: 'EShop',
|
||||
@@ -23,7 +42,7 @@ const config = {
|
||||
},
|
||||
sourceRoot: 'src',
|
||||
outputRoot: 'dist',
|
||||
plugins: [],
|
||||
plugins: [['@tarojs/plugin-mini-ci', CIPluginOpt]],
|
||||
defineConstants: {
|
||||
CURRENT_VERSION: JSON.stringify(CURRENT_VERSION),
|
||||
CURRENT_GITHASH: JSON.stringify(CURRENT_GITHASH),
|
||||
|
||||
Reference in New Issue
Block a user