Skip to content

Commit

Permalink
doc: add build notes to README
Browse files Browse the repository at this point in the history
  • Loading branch information
torkelrogstad committed Feb 28, 2024
1 parent c8b6b55 commit 6ac7afe
Showing 1 changed file with 97 additions and 8 deletions.
105 changes: 97 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,36 @@ If you'd like to build from source, check below.

## Development Environment Prerequisites

- Godot 4.1.1 [Download Page](https://godotengine.org/download)
- Godot 4.2.1 [Download Page](https://godotengine.org/download)

Currently only scripted in GDScript, but we could use the .NET version of Godot
which brings C# support.
```bash
# macOS
$ brew install godot

Once you've gotten your development environment set up:
# Ubuntu/Debian
$ snap install godot-4 # note: this gets installed as godot-4, not godot

- Clone repo
- Open the project and run
# Windows
$ choco install godot
```

### Important
## Getting started

Ensure that `godot` is installed such that is in on your `$PATH`.

For building releases, so-called "export templates" has to be downloaded. These
are available from the official
[website](https://github.com/godotengine/godot/releases/download/4.2.1-stable/Godot_v4.2.1-stable_export_templates.tpz).
Note that these are unique per version of Godot, but _not_ unique per platform
we're exporting for.

From the GUI, these templates can be downloaded like this:

1. "Project" menu in the toolbar
2. "Export" item within the "Project" menu
3. "Download and install"

## Important

The app relies on external binaries to be downloaded from a specific GitHub
release. This is a bit cumbersome, but was the best we could come up with for
Expand All @@ -45,7 +64,77 @@ now.
keychain. More info here:
https://developer.apple.com/help/account/create-certificates/create-developer-id-certificates

### LICENSE
## Export preset notes

The file `export_presets.cfg` controls the export (i.e. build) process for the
Launcher. It is controlled through the Godot GUI. If you write comments in the
file, they will get **erased** once the file is saved. Furthermore, enums are
represented as numbers, not strings...

`export_presets.cfg` is kept in Git. This file does not contain anything
sensitive. It is _merged_ with `.godot/export_credentials.cfg`, which _does_
contain sensitive information. This file is also merged with certain environment
variables, such that this can be done on CI without fiddling around with files.

### macOS

Signing (and therefore also notarizing) the application requires having the
correct set of certificates + private keys on the machine doing the export.
Certificates can be viewed using `Keychain Access.app`. Seeing certificates
capable of signing (i.e. certificates with private keys):

```bash
$ security find-identity -v -p codesigning | grep LayerTwo`
```

Notarizing the app requires an App Store Connect API key. Docs for generating
this can be found
[here](https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api).
There's three components to this key, which should go into
`.godot/export_credentials.cfg` before exporting:
1. Issuer ID (`notarization/api_uuid`). This is an UUID indicating which
organization the key belongs to. This is available over the
[list of active keys](https://appstoreconnect.apple.com/access/integrations/api).
2. The key itself (`notarization/api_key`). This is a path to a `.p8` file, and
can only be obtained when creating the key.
3. Key ID (`notarization/api_key_id`). This is available in the
[list of active keys](https://appstoreconnect.apple.com/access/integrations/api).
Explanation of export config file options:
```
export/distribution_type
0=testing ?
1=distribution
2=app store
codesign/codesign
0=disabled
1=built-in ad-hoc
2=rcodesign ruby tool for exporting from Linux
3=Xcode codesign
notarization/notarization
0=disabled
2=xcrun notarytool
```
Generate App Store Connect API keys:
Download the key somewhere
Docs on macOS:
https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_macos.html
### Windows
Signing (is that the correct Windows nomenclature?) of the build artifacts does
not happen in our pipeline. This leads to a scary pop-up warning the user when
they try and launch the app. This could probably be set up, somehow. Left as an
exercise to the reader!
## LICENSE
MIT License
Expand Down

0 comments on commit 6ac7afe

Please sign in to comment.