Skip to content

Commit 61b3e8f

Browse files
committed
fix: Fixed installer not notarized properly
1 parent 88481e2 commit 61b3e8f

3 files changed

Lines changed: 20 additions & 19 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
"deploy": "npm run pkg && npm run notarize && npm run upload",
146146
"prepublishOnly": "npm run build"
147147
},
148-
"version": "1.0.1",
148+
"version": "1.0.2",
149149
"bugs": "https://github.com/codifycli/codify/issues",
150150
"keywords": [
151151
"oclif",

scripts/notarize.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ for filename in ./.build/dist/macos/*.pkg; do
33
echo "Uploading and notarizing $filename with Apple... (5-10 minutes)"
44
RESULT=$(
55
xcrun notarytool submit $filename \
6-
--keychain-profile "notarytool-password" \
6+
--keychain-profile "notary-tool" \
77
--wait \
88
-f json
99
)
@@ -12,7 +12,7 @@ for filename in ./.build/dist/macos/*.pkg; do
1212
echo $RESULT
1313

1414
SUBMISSION_ID=$(jq -r '.id' <<< $RESULT)
15-
xcrun notarytool log $SUBMISSION_ID --keychain-profile "notarytool-password"
15+
xcrun notarytool log $SUBMISSION_ID --keychain-profile "notary-tool"
1616

1717
echo "Stapling notary to $filename"
1818
xcrun stapler staple $filename

scripts/pkg.ts

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,22 @@ async function ignoreError(fn: () => Promise<any> | any): Promise<void> {
5454

5555
// Oclif has a bug where the installer doesn't clear out the auto-updater location. This causes older versions
5656
// to be re-used even with a clean install
57+
// Comment this out because it does not work with MacOS notary tool. It fails verification
5758
async function patchMacOsInstallers() {
58-
console.log(chalk.magenta('Patching MacOS installers with bug fix'))
59-
60-
const pkgFolder = './.build/dist/macos';
61-
const files = await fs.readdir(pkgFolder)
62-
const pkgFiles = files.filter((name) => name.endsWith('.pkg'))
63-
64-
for (const pkgFile of pkgFiles) {
65-
const pkgPath = path.join(pkgFolder, pkgFile);
66-
const tmpPath = path.join(pkgFolder, 'tmp');
67-
68-
execSync(`pkgutil --expand ${pkgPath} ${tmpPath}`)
69-
await fs.appendFile(path.join(tmpPath, 'Scripts', 'preinstall'), '\nsudo rm -rf ~/.local/share/codify', 'utf8');
70-
execSync(`pkgutil --flatten ${tmpPath} ${pkgPath} `)
71-
execSync(`rm -rf ${tmpPath}`);
72-
console.log(chalk.magenta(`Done patching installer ${pkgFile}`))
73-
}
59+
// console.log(chalk.magenta('Patching MacOS installers with bug fix'))
60+
//
61+
// const pkgFolder = './.build/dist/macos';
62+
// const files = await fs.readdir(pkgFolder)
63+
// const pkgFiles = files.filter((name) => name.endsWith('.pkg'))
64+
//
65+
// for (const pkgFile of pkgFiles) {
66+
// const pkgPath = path.join(pkgFolder, pkgFile);
67+
// const tmpPath = path.join(pkgFolder, 'tmp');
68+
//
69+
// execSync(`pkgutil --expand ${pkgPath} ${tmpPath}`)
70+
// await fs.appendFile(path.join(tmpPath, 'Scripts', 'preinstall'), '\nsudo rm -rf ~/.local/share/codify', 'utf8');
71+
// execSync(`pkgutil --flatten ${tmpPath} ${pkgPath} `)
72+
// execSync(`rm -rf ${tmpPath}`);
73+
// console.log(chalk.magenta(`Done patching installer ${pkgFile}`))
74+
// }
7475
}

0 commit comments

Comments
 (0)