Disable electron-builder publish for Windows installer
Template tests / tests (push) Successful in 1m42s
Template tests / tests (push) Successful in 1m42s
This commit is contained in:
@@ -46,7 +46,6 @@ function createWindowsInstallerConfig(outputDir) {
|
|||||||
win: {
|
win: {
|
||||||
target: ['nsis'],
|
target: ['nsis'],
|
||||||
},
|
},
|
||||||
publish: 'never',
|
|
||||||
nsis: {
|
nsis: {
|
||||||
oneClick: false,
|
oneClick: false,
|
||||||
allowToChangeInstallationDirectory: true,
|
allowToChangeInstallationDirectory: true,
|
||||||
@@ -57,6 +56,14 @@ function createWindowsInstallerConfig(outputDir) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createWindowsInstallerBuildOptions(outputDir) {
|
||||||
|
return {
|
||||||
|
targets: Platform.WINDOWS.createTarget('nsis'),
|
||||||
|
config: createWindowsInstallerConfig(outputDir),
|
||||||
|
publish: 'never',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
async function buildWindowsInstaller() {
|
async function buildWindowsInstaller() {
|
||||||
const releaseDir = path.resolve(process.env.STEPFORGE_RELEASE_DIR || path.join(ROOT_DIR, 'releases'));
|
const releaseDir = path.resolve(process.env.STEPFORGE_RELEASE_DIR || path.join(ROOT_DIR, 'releases'));
|
||||||
const workDir = fs.mkdtempSync(path.join(os.tmpdir(), 'stepforge-win-'));
|
const workDir = fs.mkdtempSync(path.join(os.tmpdir(), 'stepforge-win-'));
|
||||||
@@ -65,13 +72,8 @@ async function buildWindowsInstaller() {
|
|||||||
fs.mkdirSync(releaseDir, { recursive: true });
|
fs.mkdirSync(releaseDir, { recursive: true });
|
||||||
fs.rmSync(outputDir, { recursive: true, force: true });
|
fs.rmSync(outputDir, { recursive: true, force: true });
|
||||||
|
|
||||||
const config = createWindowsInstallerConfig(outputDir);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await build({
|
await build(createWindowsInstallerBuildOptions(outputDir));
|
||||||
targets: Platform.WINDOWS.createTarget('nsis'),
|
|
||||||
config,
|
|
||||||
});
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new Error(`Windows installer build failed: ${err.message}`);
|
throw new Error(`Windows installer build failed: ${err.message}`);
|
||||||
}
|
}
|
||||||
@@ -97,6 +99,7 @@ if (require.main === module) {
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
APP_ID,
|
APP_ID,
|
||||||
createWindowsInstallerConfig,
|
createWindowsInstallerConfig,
|
||||||
|
createWindowsInstallerBuildOptions,
|
||||||
findInstallerExe,
|
findInstallerExe,
|
||||||
buildWindowsInstaller,
|
buildWindowsInstaller,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,11 @@ const test = require('node:test');
|
|||||||
const assert = require('node:assert/strict');
|
const assert = require('node:assert/strict');
|
||||||
|
|
||||||
const { makeTmpDir, rmrf } = require('./helpers');
|
const { makeTmpDir, rmrf } = require('./helpers');
|
||||||
const { createWindowsInstallerConfig, findInstallerExe } = require('../../scripts/package-windows');
|
const {
|
||||||
|
createWindowsInstallerConfig,
|
||||||
|
createWindowsInstallerBuildOptions,
|
||||||
|
findInstallerExe,
|
||||||
|
} = require('../../scripts/package-windows');
|
||||||
|
|
||||||
test('Windows packaging uses an assisted NSIS installer', (t) => {
|
test('Windows packaging uses an assisted NSIS installer', (t) => {
|
||||||
const config = createWindowsInstallerConfig('/tmp/stepforge-output');
|
const config = createWindowsInstallerConfig('/tmp/stepforge-output');
|
||||||
@@ -17,13 +21,16 @@ test('Windows packaging uses an assisted NSIS installer', (t) => {
|
|||||||
assert.equal(config.nsis.createDesktopShortcut, true);
|
assert.equal(config.nsis.createDesktopShortcut, true);
|
||||||
assert.equal(config.nsis.createStartMenuShortcut, true);
|
assert.equal(config.nsis.createStartMenuShortcut, true);
|
||||||
assert.equal(config.nsis.shortcutName, 'StepForge');
|
assert.equal(config.nsis.shortcutName, 'StepForge');
|
||||||
assert.equal(config.publish, 'never');
|
|
||||||
assert.equal(config.asar, true);
|
assert.equal(config.asar, true);
|
||||||
assert.ok(config.files.includes('app/**/*'));
|
assert.ok(config.files.includes('app/**/*'));
|
||||||
assert.ok(config.files.includes('core/**/*'));
|
assert.ok(config.files.includes('core/**/*'));
|
||||||
assert.ok(config.files.includes('exporters/**/*'));
|
assert.ok(config.files.includes('exporters/**/*'));
|
||||||
assert.ok(!config.files.includes('assets/**/*'));
|
assert.ok(!config.files.includes('assets/**/*'));
|
||||||
|
|
||||||
|
const buildOptions = createWindowsInstallerBuildOptions('/tmp/stepforge-output');
|
||||||
|
assert.equal(buildOptions.publish, 'never');
|
||||||
|
assert.equal(buildOptions.config.publish, undefined);
|
||||||
|
|
||||||
const tmp = makeTmpDir('windows-installer');
|
const tmp = makeTmpDir('windows-installer');
|
||||||
t.after(() => rmrf(tmp));
|
t.after(() => rmrf(tmp));
|
||||||
fs.mkdirSync(path.join(tmp, 'nested', 'deeper'), { recursive: true });
|
fs.mkdirSync(path.join(tmp, 'nested', 'deeper'), { recursive: true });
|
||||||
|
|||||||
Reference in New Issue
Block a user