electrobun 0.1.13-beta.1 → 0.1.13-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli/index.ts +24 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrobun",
3
- "version": "0.1.13-beta.1",
3
+ "version": "0.1.13-beta.2",
4
4
  "description": "Build ultra fast, tiny, and cross-platform desktop apps with Typescript.",
5
5
  "license": "MIT",
6
6
  "author": "Blackboard Technologies Inc.",
package/src/cli/index.ts CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  symlinkSync,
14
14
  statSync,
15
15
  copyFileSync,
16
+ renameSync,
16
17
  } from "fs";
17
18
  import { execSync } from "child_process";
18
19
  import * as readline from "readline";
@@ -1752,25 +1753,41 @@ if (commandArg === "init") {
1752
1753
  // DMG creation for macOS only
1753
1754
  if (targetOS === 'macos') {
1754
1755
  console.log("creating dmg...");
1755
- // make a dmg
1756
- const dmgPath = join(buildFolder, `${appFileName}.dmg`);
1757
- artifactsToUpload.push(dmgPath);
1756
+ const finalDmgPath = join(buildFolder, `${appFileName}.dmg`);
1757
+ // NOTE: For some ungodly reason using the bare name in CI can conflict with some mysterious
1758
+ // already mounted volume. I suspect the sanitized appFileName can match your github repo
1759
+ // or some other tool is mounting something somewhere. Either way, as a workaround
1760
+ // while creating the dmg for a stable build we temporarily give it a -stable suffix
1761
+ // to match the behaviour of -canary builds.
1762
+ const dmgCreationPath =
1763
+ buildEnvironment === "stable"
1764
+ ? join(buildFolder, `${appFileName}-stable.dmg`)
1765
+ : finalDmgPath;
1766
+ const baseVolumeName = sanitizeVolumeNameForHdiutil(appFileName);
1767
+ const dmgVolumeName =
1768
+ buildEnvironment === "stable"
1769
+ ? `${baseVolumeName}-stable`
1770
+ : baseVolumeName;
1758
1771
  // hdiutil create -volname "YourAppName" -srcfolder /path/to/YourApp.app -ov -format UDZO YourAppName.dmg
1759
1772
  // Note: use ULFO (lzfse) for better compatibility with large CEF frameworks and modern macOS
1760
1773
  execSync(
1761
- `hdiutil create -volname "${sanitizeVolumeNameForHdiutil(appFileName)}" -srcfolder ${escapePathForTerminal(
1774
+ `hdiutil create -volname "${dmgVolumeName}" -srcfolder ${escapePathForTerminal(
1762
1775
  selfExtractingBundle.appBundleFolderPath
1763
- )} -ov -format ULFO ${escapePathForTerminal(dmgPath)}`
1776
+ )} -ov -format ULFO ${escapePathForTerminal(dmgCreationPath)}`
1764
1777
  );
1778
+ if (buildEnvironment === "stable" && dmgCreationPath !== finalDmgPath) {
1779
+ renameSync(dmgCreationPath, finalDmgPath);
1780
+ }
1781
+ artifactsToUpload.push(finalDmgPath);
1765
1782
 
1766
1783
  if (shouldCodesign) {
1767
- codesignAppBundle(dmgPath);
1784
+ codesignAppBundle(finalDmgPath);
1768
1785
  } else {
1769
1786
  console.log("skipping codesign");
1770
1787
  }
1771
1788
 
1772
1789
  if (shouldNotarize) {
1773
- notarizeAndStaple(dmgPath);
1790
+ notarizeAndStaple(finalDmgPath);
1774
1791
  } else {
1775
1792
  console.log("skipping notarization");
1776
1793
  }