diff --git a/packages/ui/scripts/github-ci-build.mjs b/packages/ui/scripts/github-ci-build.mjs index 149b5f2..825c15b 100644 --- a/packages/ui/scripts/github-ci-build.mjs +++ b/packages/ui/scripts/github-ci-build.mjs @@ -1,2 +1,2 @@ -import buildUiOnCurrentPlatform from './steps/build-ui-on-current-platform.mjs' -buildUiOnCurrentPlatform() +import makeDistForCurrentPlatform from './steps/make-dist-for-current-platform.mjs' +makeDistForCurrentPlatform() diff --git a/packages/ui/scripts/release-new-version.mjs b/packages/ui/scripts/release-new-version.mjs index 5f24d88..e474d3b 100644 --- a/packages/ui/scripts/release-new-version.mjs +++ b/packages/ui/scripts/release-new-version.mjs @@ -1,8 +1,6 @@ -// import buildUiOnCurrentPlatform from './steps/build-ui-on-current-platform.mjs'; import increasePackageVersion from './steps/increase-package-version.mjs' import releaseVersion from './steps/release-version.mjs' ;(async () => { await increasePackageVersion() - // await buildUiOnCurrentPlatform() await releaseVersion() })() diff --git a/packages/ui/scripts/steps/build-ui-on-current-platform.mjs b/packages/ui/scripts/steps/build-ui-on-current-platform.mjs deleted file mode 100644 index 89e21bf..0000000 --- a/packages/ui/scripts/steps/build-ui-on-current-platform.mjs +++ /dev/null @@ -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) - } -} diff --git a/packages/ui/scripts/make-dist-for-current-platform.mjs b/packages/ui/scripts/steps/make-dist-for-current-platform.mjs similarity index 81% rename from packages/ui/scripts/make-dist-for-current-platform.mjs rename to packages/ui/scripts/steps/make-dist-for-current-platform.mjs index e7c0252..e0138d2 100644 --- a/packages/ui/scripts/make-dist-for-current-platform.mjs +++ b/packages/ui/scripts/steps/make-dist-for-current-platform.mjs @@ -3,15 +3,15 @@ import yaml from 'js-yaml' import url from 'node:url' import path from 'node:path' 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 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 platformKeyForBuildParameter = osPlatformToBuildCommandMap[process.platform] if (!buildTargets?.length || !platformKeyForBuildParameter) { @@ -25,5 +25,3 @@ const main = async () => { return await builder.build(buildParameter) } - -main()