H5构建部署 + 小程序上传 v1.0.3
- 构建 H5 并部署至 zhiyin.yzrcloud.cn(含 nginx /api/ 代理) - 构建并上传微信小程序至微信侧(版本 1.0.3,包体 495KB) - 启动生产后端(端口 3006,zhiyinwx.yzrcloud.cn 代理) - 修复 tsconfig.build.json 缺失导致 dist 输出路径错误
This commit is contained in:
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
declare const _default: import("@playwright/test").PlaywrightTestConfig<{}, {}>;
|
||||
export default _default;
|
||||
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const test_1 = require("@playwright/test");
|
||||
exports.default = (0, test_1.defineConfig)({
|
||||
testDir: './test',
|
||||
testMatch: '*.browser.spec.ts',
|
||||
timeout: 30000,
|
||||
use: {
|
||||
baseURL: 'http://localhost:3006',
|
||||
},
|
||||
});
|
||||
//# sourceMappingURL=playwright.config.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"playwright.config.js","sourceRoot":"","sources":["playwright.config.ts"],"names":[],"mappings":";;AAAA,2CAA+C;AAE/C,kBAAe,IAAA,mBAAY,EAAC;IAC1B,OAAO,EAAE,QAAQ;IACjB,SAAS,EAAE,mBAAmB;IAC9B,OAAO,EAAE,KAAK;IACd,GAAG,EAAE;QACH,OAAO,EAAE,uBAAuB;KACjC;CACF,CAAC,CAAA"}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist", "test", "**/*spec.ts", "**/*.spec.ts"]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
|
||||
const ci = require('miniprogram-ci')
|
||||
const path = require('path')
|
||||
const { execSync } = require('child_process')
|
||||
|
||||
const projectPath = path.resolve(__dirname, '../dist/build/mp-weixin')
|
||||
const privateKeyPath = path.resolve('/root/opencode-workspace/微信小程序参数/宇之然AI磁场appid/private.wxf466b3c3bc411ffc.key')
|
||||
@@ -14,26 +15,41 @@ async function main() {
|
||||
ignores: ['node_modules/**/*'],
|
||||
})
|
||||
|
||||
console.log(`Uploading from: ${projectPath}`)
|
||||
console.log(`AppID: ${appid}`)
|
||||
|
||||
// Dry-run mode for testing — set raw false to actually upload
|
||||
// For testing, we do a preview first
|
||||
// Get version from git tag or use timestamp
|
||||
let version = '1.0.3'
|
||||
try {
|
||||
const previewResult = await ci.preview({
|
||||
project,
|
||||
desc: '预览测试',
|
||||
setting: {
|
||||
es6: true,
|
||||
minify: false,
|
||||
},
|
||||
})
|
||||
console.log('Preview success!')
|
||||
console.log('Preview result:', JSON.stringify(previewResult, null, 2))
|
||||
} catch (err) {
|
||||
console.error('Preview failed:', err.message)
|
||||
process.exit(1)
|
||||
}
|
||||
const gitTag = execSync('git describe --tags --abbrev=0 2>/dev/null || echo ""', { encoding: 'utf8' }).trim()
|
||||
if (gitTag) version = gitTag.replace(/^v/, '')
|
||||
} catch {}
|
||||
|
||||
const now = new Date()
|
||||
const desc = `v${version} ${now.toISOString().slice(0, 10)} ${now.toTimeString().slice(0, 5)}`
|
||||
|
||||
console.log(`Uploading: ${projectPath}`)
|
||||
console.log(`Version: ${version}`)
|
||||
console.log(`Desc: ${desc}`)
|
||||
|
||||
const result = await ci.upload({
|
||||
project,
|
||||
version,
|
||||
desc,
|
||||
setting: {
|
||||
es6: true,
|
||||
minify: true,
|
||||
autoPrefixWXSS: true,
|
||||
},
|
||||
onProgressUpdate: (task) => {
|
||||
if (task.status === 'uploading') {
|
||||
console.log(`Uploading... ${task.current}/${task.total}`)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
console.log('Upload success!')
|
||||
console.log('Result:', JSON.stringify(result, null, 2))
|
||||
}
|
||||
|
||||
main()
|
||||
main().catch(err => {
|
||||
console.error('Upload failed:', err.message)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user