mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-08 17:09:07 +08:00
change github-ci-build script
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
import buildUiOnCurrentPlatform from './steps/build-ui-on-current-platform.mjs'
|
import makeDistForCurrentPlatform from './steps/make-dist-for-current-platform.mjs'
|
||||||
buildUiOnCurrentPlatform()
|
makeDistForCurrentPlatform()
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
// import buildUiOnCurrentPlatform from './steps/build-ui-on-current-platform.mjs';
|
|
||||||
import increasePackageVersion from './steps/increase-package-version.mjs'
|
import increasePackageVersion from './steps/increase-package-version.mjs'
|
||||||
import releaseVersion from './steps/release-version.mjs'
|
import releaseVersion from './steps/release-version.mjs'
|
||||||
;(async () => {
|
;(async () => {
|
||||||
await increasePackageVersion()
|
await increasePackageVersion()
|
||||||
// await buildUiOnCurrentPlatform()
|
|
||||||
await releaseVersion()
|
await releaseVersion()
|
||||||
})()
|
})()
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
import childProcess from 'node:child_process'
|
|
||||||
import { osPlatformToBuildCommandMap, currentOsPlatform } from '../vars/os.mjs'
|
|
||||||
|
|
||||||
export default function buildUiOnCurrentPlatform() {
|
|
||||||
try {
|
|
||||||
const uiBuildProcess = childProcess.spawnSync(
|
|
||||||
`pnpm run build:${osPlatformToBuildCommandMap[currentOsPlatform]}`,
|
|
||||||
{
|
|
||||||
stdio: ['inherit', 'inherit', 'inherit'],
|
|
||||||
shell: true
|
|
||||||
}
|
|
||||||
)
|
|
||||||
if (uiBuildProcess.error) {
|
|
||||||
throw uiBuildProcess.error
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('error encounter when build ui:')
|
|
||||||
console.error(error)
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+3
-5
@@ -3,15 +3,15 @@ import yaml from 'js-yaml'
|
|||||||
import url from 'node:url'
|
import url from 'node:url'
|
||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
import fs from 'node:fs'
|
import fs from 'node:fs'
|
||||||
import { buildTargetListMapByPlatform, osPlatformToBuildCommandMap } from './vars/os.mjs'
|
import { buildTargetListMapByPlatform, osPlatformToBuildCommandMap } from '../vars/os.mjs'
|
||||||
|
|
||||||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
|
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
|
||||||
|
|
||||||
const getBuilderConfig = () => {
|
const getBuilderConfig = () => {
|
||||||
return yaml.load(fs.readFileSync(path.join(__dirname, '../electron-builder.yml'), 'utf8'))
|
return yaml.load(fs.readFileSync(path.join(__dirname, '../../electron-builder.yml'), 'utf8'))
|
||||||
}
|
}
|
||||||
|
|
||||||
const main = async () => {
|
export default async function makeDistForCurrentPlatform() {
|
||||||
const buildTargets = buildTargetListMapByPlatform[process.platform]
|
const buildTargets = buildTargetListMapByPlatform[process.platform]
|
||||||
const platformKeyForBuildParameter = osPlatformToBuildCommandMap[process.platform]
|
const platformKeyForBuildParameter = osPlatformToBuildCommandMap[process.platform]
|
||||||
if (!buildTargets?.length || !platformKeyForBuildParameter) {
|
if (!buildTargets?.length || !platformKeyForBuildParameter) {
|
||||||
@@ -25,5 +25,3 @@ const main = async () => {
|
|||||||
|
|
||||||
return await builder.build(buildParameter)
|
return await builder.build(buildParameter)
|
||||||
}
|
}
|
||||||
|
|
||||||
main()
|
|
||||||
Reference in New Issue
Block a user