Skip to content

Commit

Permalink
Desktop: Seamless-Updates: added latest-mac-arm64.yml (#10941)
Browse files Browse the repository at this point in the history
  • Loading branch information
AliceHincu authored Aug 31, 2024
1 parent 4ccc46e commit 3bca12f
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-macos-m1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ jobs:
npm pkg set 'build.mac.identity'=null --json
PYTHON_PATH=$(which python) USE_HARD_LINKS=false yarn dist --mac --arm64 --publish=never
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ const fs = require('fs');
const path = require('path');
const os = require('os');
const sha512 = require('js-sha512');
const distDirName = 'dist';
const distPath = path.join(__dirname, distDirName);

const generateChecksumFile = () => {
if (os.platform() !== 'linux') {
return []; // SHA-512 is only for AppImage
}
const distDirName = 'dist';
const distPath = path.join(__dirname, distDirName);

let appImageName = '';
const files = fs.readdirSync(distPath);
for (const key in files) {
Expand All @@ -30,4 +31,8 @@ const generateChecksumFile = () => {
return [sha512FilePath];
};

exports.default = generateChecksumFile;
const mainHook = () => {
generateChecksumFile();
};

exports.default = mainHook;
25 changes: 25 additions & 0 deletions packages/app-desktop/artifactBuildCompleted.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const fs = require('fs');
const path = require('path');
const os = require('os');
const distDirName = 'dist';
const distPath = path.join(__dirname, distDirName);

const renameLatestYmlFile = () => {
if (os.platform() === 'darwin' && process.arch === 'arm64') {
const latestMacFilePath = path.join(distPath, 'latest-mac.yml');
const renamedMacFilePath = path.join(distPath, 'latest-mac-arm64.yml');

if (fs.existsSync(latestMacFilePath)) {
fs.renameSync(latestMacFilePath, renamedMacFilePath);
return [renamedMacFilePath];
} else {
throw new Error('latest-mac.yml not found!');
}
}
};

const mainHook = () => {
renameLatestYmlFile();
};

exports.default = mainHook;
2 changes: 1 addition & 1 deletion packages/app-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"build/tesseract.js-core/**",
"build/7zip/**"
],
"afterAllArtifactBuild": "./generateSha512.js",
"afterAllArtifactBuild": "./afterAllArtifactBuild.js",
"asar": true,
"asarUnpack": "./node_modules/node-notifier/vendor/**",
"win": {
Expand Down

0 comments on commit 3bca12f

Please sign in to comment.