Skip to content

Commit

Permalink
Merge pull request #1375 from klembot/develop
Browse files Browse the repository at this point in the history
Twine 2.6.1
  • Loading branch information
klembot authored Feb 5, 2023
2 parents 1330fa5 + e8bb69b commit 4116ffe
Show file tree
Hide file tree
Showing 22 changed files with 750 additions and 117 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,27 @@ you work, but if you want the app to read story files initially again, you will
need to restart the process.

To create a release, run `npm run build`. Finished files will be found under
`dist/`. In order to build Windows apps on OS X or Linux, you will need to have
`dist/`. In order to build Windows apps on macOS or Linux, you will need to have
[Wine](https://www.winehq.org/) and [makensis](http://nsis.sourceforge.net/)
installed. A file named `2.json` is created under `dist/` which contains
information relevant to the autoupdater process, and is currently posted to
https://twinery.org/latestversion/2.json.

The build process looks for these environment variables when notarizing a macOS
build:

- `APPLE_APP_ID`: The app ID to use. The convention is `country.company.appname`.
- `APPLE_ID`: User name of the Apple account to use for notarization.
- `APPLE_ID_PASSWORD`: App-specific password for the Apple account to use for
notarization.

If any of these environment variables are not set, the build process will skip
notarizing. This means users will need to right-click the application and open
it manually.

You must have the full Xcode app installed to notarize the app, not just the
Xcode command line tools.

`npm test` will test the source code respectively.

`npm run clean` will delete existing files in `electron-build/` and `dist/`.
37 changes: 36 additions & 1 deletion electron-builder.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,44 @@
const child_process = require('child_process');
const {notarize} = require('@electron/notarize');
const path = require('path');
const pkg = require('./package.json');

const isPreview =
/alpha|beta|pre/.test(pkg.version) || process.env.FORCE_PREVIEW;

module.exports = {
async afterSign(context) {
if (context.packager.platform.name === 'mac') {
if (!('APPLE_APP_ID' in process.env)) {
console.log(
'APPLE_APP_ID environment variable is not set, skipping notarization'
);
return;
}

if (!('APPLE_ID' in process.env)) {
console.log(
'APPLE_ID environment variable is not set, skipping notarization'
);
return;
}

if (!('APPLE_ID_PASSWORD' in process.env)) {
console.log(
'APPLE_ID_PASSWORD environment variable is not set, skipping notarization'
);
return;
}

console.log('Notarizing Mac app...');
await notarize({
appBundleId: process.env.APPLE_APP_ID,
appPath: path.join(context.appOutDir, `Twine.app`),
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASSWORD
});
}
},

// This step was necessary to ad hoc sign the app. Otherwise, on Apple Silicon
// you get repeated prompts for file access. This is commented out because we
// are able to sign the app thanks to the Interactive Fiction Technology
Expand All @@ -20,6 +54,7 @@ module.exports = {
// );
// }
// },
appId: 'org.twinery.twine',
directories: {
output: 'dist/electron'
},
Expand Down
230 changes: 228 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Twine",
"version": "2.6.0",
"version": "2.6.1",
"description": "a GUI for creating nonlinear stories",
"author": "Chris Klimas <[email protected]>",
"license": "GPL-3.0",
Expand Down Expand Up @@ -54,6 +54,7 @@
"use-error-boundary": "^2.0.6"
},
"devDependencies": {
"@electron/notarize": "^1.2.3",
"@playwright/test": "^1.27.1",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
Expand Down Expand Up @@ -86,6 +87,7 @@
"cross-var": "^1.1.0",
"electron": "^18.3.6",
"electron-builder": "^23.3.3",
"electron-builder-notarize": "^1.5.0",
"faker": "^5.4.0",
"history": "^5.1.0",
"jest-axe": "^4.1.0",
Expand Down
Loading

0 comments on commit 4116ffe

Please sign in to comment.