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: {
|
||||
target: ['nsis'],
|
||||
},
|
||||
publish: 'never',
|
||||
nsis: {
|
||||
oneClick: false,
|
||||
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() {
|
||||
const releaseDir = path.resolve(process.env.STEPFORGE_RELEASE_DIR || path.join(ROOT_DIR, 'releases'));
|
||||
const workDir = fs.mkdtempSync(path.join(os.tmpdir(), 'stepforge-win-'));
|
||||
@@ -65,13 +72,8 @@ async function buildWindowsInstaller() {
|
||||
fs.mkdirSync(releaseDir, { recursive: true });
|
||||
fs.rmSync(outputDir, { recursive: true, force: true });
|
||||
|
||||
const config = createWindowsInstallerConfig(outputDir);
|
||||
|
||||
try {
|
||||
await build({
|
||||
targets: Platform.WINDOWS.createTarget('nsis'),
|
||||
config,
|
||||
});
|
||||
await build(createWindowsInstallerBuildOptions(outputDir));
|
||||
} catch (err) {
|
||||
throw new Error(`Windows installer build failed: ${err.message}`);
|
||||
}
|
||||
@@ -97,6 +99,7 @@ if (require.main === module) {
|
||||
module.exports = {
|
||||
APP_ID,
|
||||
createWindowsInstallerConfig,
|
||||
createWindowsInstallerBuildOptions,
|
||||
findInstallerExe,
|
||||
buildWindowsInstaller,
|
||||
};
|
||||
|
||||
@@ -6,7 +6,11 @@ const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
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) => {
|
||||
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.createStartMenuShortcut, true);
|
||||
assert.equal(config.nsis.shortcutName, 'StepForge');
|
||||
assert.equal(config.publish, 'never');
|
||||
assert.equal(config.asar, true);
|
||||
assert.ok(config.files.includes('app/**/*'));
|
||||
assert.ok(config.files.includes('core/**/*'));
|
||||
assert.ok(config.files.includes('exporters/**/*'));
|
||||
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');
|
||||
t.after(() => rmrf(tmp));
|
||||
fs.mkdirSync(path.join(tmp, 'nested', 'deeper'), { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user