pull/88/head
xiaojunnuo 3 years ago
parent 1b1a8539c9
commit 120d149c86

@ -1 +1,2 @@
VUE_APP_PUBLISH_URL=http://dev-sidecar.docmirror.cn/update/ VUE_APP_PUBLISH_URL=http://dev-sidecar.docmirror.cn/update/
VUE_APP_PUBLISH_PROVIDER=generic

@ -15,6 +15,7 @@ function appendIntro (context, systemType, latest) {
}) })
} }
exports.default = async function (context) { exports.default = async function (context) {
console.log('after-all-artifact-build', context)
appendIntro(context, 'mac', 'latest-mac.yml') appendIntro(context, 'mac', 'latest-mac.yml')
appendIntro(context, 'win', 'latest.yml') appendIntro(context, 'win', 'latest.yml')
appendIntro(context, 'linux', 'latest-linux.yml') appendIntro(context, 'linux', 'latest-linux.yml')

@ -1,7 +0,0 @@
const fs = require('fs')
exports.default = async function (context) {
// console.log('context', context)
if (context.packager.platform.nodeName === 'linux') {
fs.copyFileSync('../build/app-update.yml', '../dist_electron/linux_unpacked/resources/app-update.yml')
}
}

@ -1,6 +1,22 @@
const path = require('path') const path = require('path')
const AdmZip = require('adm-zip') const AdmZip = require('adm-zip')
const pkg = require('../package.json') const pkg = require('../package.json')
const fs = require('fs')
function writeAppUpdateYmlForLinux () {
const publishUrl = process.env.VUE_APP_PUBLISH_URL
const publishProvider = process.env.VUE_APP_PUBLISH_PROVIDER
// provider: generic
// url: 'http://dev-sidecar.docmirror.cn/update/preview/'
// updaterCacheDirName: '@docmirrordev-sidecar-gui-updater'
const fileContent = `provider: ${publishProvider}
url: '${publishUrl}'
updaterCacheDirName: '@docmirrordev-sidecar-gui-updater'
`
console.log('write linux app-update.yml,updateUrl:', publishUrl)
const filePath = path.resolve('./dist_electron/linux-unpacked/resources/app-update.yml')
fs.writeFileSync(filePath, fileContent)
}
exports.default = async function (context) { exports.default = async function (context) {
// console.log('context', context) // console.log('context', context)
let targetPath let targetPath
@ -11,6 +27,7 @@ exports.default = async function (context) {
} else if (context.packager.platform.nodeName === 'linux') { } else if (context.packager.platform.nodeName === 'linux') {
targetPath = path.join(context.appOutDir, './resources') targetPath = path.join(context.appOutDir, './resources')
systemType = 'linux' systemType = 'linux'
writeAppUpdateYmlForLinux()
} else { } else {
targetPath = path.join(context.appOutDir, './resources') targetPath = path.join(context.appOutDir, './resources')
systemType = 'win' systemType = 'win'

@ -1,6 +1,7 @@
const path = require('path') const path = require('path')
const webpack = require('webpack') const webpack = require('webpack')
const publishUrl = process.env.VUE_APP_PUBLISH_URL const publishUrl = process.env.VUE_APP_PUBLISH_URL
const publishProvider = process.env.VUE_APP_PUBLISH_PROVIDER
console.log('publish url', publishUrl) console.log('publish url', publishUrl)
module.exports = { module.exports = {
pages: { pages: {
@ -38,7 +39,7 @@ module.exports = {
builderOptions: { builderOptions: {
afterPack: './pkg/after-pack.js', afterPack: './pkg/after-pack.js',
afterAllArtifactBuild: './pkg/after-all-artifact-build.js', afterAllArtifactBuild: './pkg/after-all-artifact-build.js',
afterPackContent: './pkg/after-pack-content.js', // artifactBuildCompleted: './pkg/artifact-build-completed.js',
// builderOptions: { // builderOptions: {
// publish: ['github']// 此处写入github 就好,不用添加其他内容 // publish: ['github']// 此处写入github 就好,不用添加其他内容
// }, // },
@ -68,12 +69,12 @@ module.exports = {
linux: { linux: {
icon: 'build/mac/', icon: 'build/mac/',
target: [ target: [
'deb', // 'deb',
'AppImage' 'AppImage'
] ]
}, },
publish: { publish: {
provider: 'generic', provider: publishProvider,
url: publishUrl url: publishUrl
// url: 'http://dev-sidecar.docmirror.cn/update/preview/' // url: 'http://dev-sidecar.docmirror.cn/update/preview/'
} }

Loading…
Cancel
Save