Skip to content

Commit 96a28e5

Browse files
authored
Merge pull request #78 from unvermuthet/ditch-frameworks
2 parents 38e6d29 + e4e73a2 commit 96a28e5

File tree

7 files changed

+6
-387
lines changed

7 files changed

+6
-387
lines changed

.github/actions/sign/action.yml

-179
This file was deleted.

.github/workflows/builds.yml

-16
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,6 @@ jobs:
8383
scons-cache: ${{ github.workspace }}/.scons-cache/
8484
cache-name: ${{ matrix.target.platform }}_${{ matrix.target.arch }}_${{ matrix.float-precision }}_${{ matrix.target-type }}
8585

86-
# Sign the binary (macOS only)
87-
- name: Mac Sign
88-
# Disable sign if secrets are not set
89-
if: ${{ matrix.target.platform == 'macos' && env.APPLE_CERT_BASE64 }}
90-
env:
91-
APPLE_CERT_BASE64: ${{ secrets.APPLE_CERT_BASE64 }}
92-
uses: ./.github/actions/sign
93-
with:
94-
FRAMEWORK_PATH: bin/macos/macos.framework
95-
APPLE_CERT_BASE64: ${{ secrets.APPLE_CERT_BASE64 }}
96-
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
97-
APPLE_DEV_PASSWORD: ${{ secrets.APPLE_DEV_PASSWORD }}
98-
APPLE_DEV_ID: ${{ secrets.APPLE_DEV_ID }}
99-
APPLE_DEV_TEAM_ID: ${{ secrets.APPLE_DEV_TEAM_ID }}
100-
APPLE_DEV_APP_ID: ${{ secrets.APPLE_DEV_APP_ID }}
101-
10286
# Clean up compilation files
10387
- name: Windows - Delete compilation files
10488
if: ${{ matrix.target.platform == 'windows' }}

README.md

-117
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ This repository serves as a quickstart template for GDExtension development with
66
* godot-cpp as a submodule (`godot-cpp/`)
77
* GitHub Issues template (`.github/ISSUE_TEMPLATE.yml`)
88
* GitHub CI/CD workflows to publish your library packages when creating a release (`.github/workflows/builds.yml`)
9-
* GitHub CI/CD actions to build (`.github/actions/build/action.yml`) and to sign Mac frameworks (`.github/actions/build/sign.yml`).
109
* preconfigured source files for C++ development of the GDExtension (`src/`)
1110
* setup to automatically generate `.xml` files in a `doc_classes/` directory to be parsed by Godot as [GDExtension built-in documentation](https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_docs_system.html)
1211

@@ -28,119 +27,3 @@ For getting started after cloning your own copy to your local machine, you shoul
2827

2928
This repository comes with a GitHub action that builds the GDExtension for cross-platform use. It triggers automatically for each pushed change. You can find and edit it in [builds.yml](.github/workflows/builds.yml).
3029
After a workflow run is complete, you can find the file `godot-cpp-template.zip` on the `Actions` tab on GitHub.
31-
32-
Note: for macos, you will have to build the binary as a `.dylib` in a `EXTENSION-NAME.framework` folder. The framework folder should also have a `Resources` folder with a file called `Info.plist`. Without this file, signing will fail.
33-
34-
Note: for iOS, the same should be as for MacOS, however the `Info.plist` file needs to be close to the `.dylib`, instead of in a `Resources` folder (If this is not done, the build will fail to upload to the App Store).
35-
36-
So, in our case, the builds should be:
37-
38-
```sh
39-
bin/EXTENSION-NAME.macos.template_debug.framework/EXTENSION-NAME.macos.template_release
40-
bin/EXTENSION-NAME.ios.template_debug.framework/EXTENSION-NAME.ios.template_release.arm64.dylib
41-
42-
Afterwards, you want to set in the `.gdextension` file the paths to the `.framework` folder, instead of the `.dylib` file (Note that for the `.dylib` binary, the extension is not needed, you could have a file without any extension and it would still work).
43-
44-
In the `name: Mac Sign` step, we are signing the generated mac binaries.
45-
We are reusing the following action:
46-
```yml
47-
uses: godotengine/godot-cpp-template/.github/actions/sign@main
48-
with:
49-
FRAMEWORK_PATH: bin/macos/macos.framework
50-
APPLE_CERT_BASE64: ${{ secrets.APPLE_CERT_BASE64 }}
51-
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
52-
APPLE_DEV_PASSWORD: ${{ secrets.APPLE_DEV_PASSWORD }}
53-
APPLE_DEV_ID: ${{ secrets.APPLE_DEV_ID }}
54-
APPLE_DEV_TEAM_ID: ${{ secrets.APPLE_DEV_TEAM_ID }}
55-
APPLE_DEV_APP_ID: ${{ secrets.APPLE_DEV_APP_ID }}
56-
```
57-
As you can see, this action requires some secrets to be configured in order to run. Also, you need to tell it the path to the `.framework` folder, where you have both the binary (`.dylib` file) and the `Resources` folder with the `Info.plist` file.
58-
59-
## Configuration - Mac Signing Secrets
60-
61-
In order to sign the Mac binary, you need to configure the following secrets:
62-
`APPLE_CERT_BASE64`, `APPLE_CERT_PASSWORD`, `APPLE_DEV_PASSWORD`, `APPLE_DEV_ID`, `APPLE_DEV_TEAM_ID`, `APPLE_DEV_APP_ID`. These secrets are stored in the example above in the Github secrets for repositories. The names of the secrets have to match the names of the secrets you use for your action. For more on this, read the [Creating secrets for a repository](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) article from Github.
63-
64-
These secrets are then passed down to the `godotengine/godot-cpp-template/.github/actions/sign@main` action that signs the binary.
65-
66-
In order to configure these secrets, you will need:
67-
68-
- A Mac
69-
- An Apple ID enrolled in Apple Developer Program (99 USD per year)
70-
- A `Resources/Info.plist` in the `framework` folder. Take the one in this project as an example. Be careful to set CFBundleExecutable to the **EXACT** lib name, otherwise it won't work. Also, don't put strange names in the CFBundleName and other such places. Try to only use letters and spaces. Errors will be extremly vague if not impossible to debug.
71-
72-
For the actions you will need to set the following inputs. Store them as secrets in GitHub:
73-
74-
- APPLE_CERT_BASE64
75-
- APPLE_CERT_PASSWORD
76-
- APPLE_DEV_ID
77-
- APPLE_DEV_TEAM_ID
78-
- APPLE_DEV_PASSWORD
79-
- APPLE_DEV_APP_ID
80-
81-
You will find here a guide on how to create all of them. Go to [developer.apple.com](developer.apple.com):
82-
83-
- Create an Apple ID if you don’t have one already.
84-
- Use your Apple ID to register in the Apple Developer Program.
85-
- Accept all agreements from the Apple Developer Page.
86-
87-
### APPLE_DEV_ID - Apple ID
88-
89-
- Your email used for your Apple ID.
90-
91-
- APPLE_DEV_ID = [email protected]
92-
93-
### APPLE_DEV_TEAM_ID - Apple Team ID
94-
95-
- Go to [developer.apple.com](https://developer.apple.com). Go to account.
96-
- Go to membership details. Copy Team ID.
97-
98-
- APPLE_DEV_TEAM_ID = `1ABCD23EFG`
99-
100-
### APPLE_DEV_PASSWORD - Apple App-Specific Password
101-
102-
- Create [Apple App-Specific Password](https://support.apple.com/en-us/102654). Copy the password.
103-
104-
- APPLE_DEV_PASSWORD = `abcd-abcd-abcd-abcd`
105-
106-
### APPLE_CERT_BASE64 and APPLE_CERT_PASSWORD and APPLE_DEV_APP_ID
107-
108-
- Go to [developer.apple.com](https://developer.apple.com). Go to account.
109-
- Go to certificates.
110-
- Click on + at Certificates tab. Create Developer ID Application. Click Continue.
111-
- Leave profile type as is. [Create a certificate signing request from a mac](https://developer.apple.com/help/account/create-certificates/create-a-certificate-signing-request). You can use your own name and email address. Save the file to disk. You will get a file called `CertificateSigningRequest.certSigningRequest`. Upload it to the Developer ID Application request. Click Continue.
112-
- Download the certificate. You will get a file `developerID_application.cer`.
113-
- On a Mac, right click and select open. Add it to the login keychain. In the Keychain Access app that opened, login Keychain tab, go to Keys, sort by date modified, expand your key (the key should have name you entered at common name `Common Name`), right click the expanded certificate, get info, and copy the text at Details -> Subject Name -> Common Name.
114-
Eg.
115-
- APPLE_DEV_APP_ID = `Developer ID Application: Common Name (1ABCD23EFG)`
116-
117-
- Then, select the certificate, right click and click export. At file format select p12. When exporting, set a password for the certificate. This will be APPLE_CERT_PASSWORD. You will get a `Certificates.p12` file.
118-
119-
Eg.
120-
- APPLE_CERT_PASSWORD = `<password_set_when_exporting_p12>`
121-
122-
- Then you need to make a base64 file out of it, by running:
123-
```
124-
base64 -i Certificates.p12 -o Certificates.base64
125-
```
126-
127-
- Copy the contents of the generated file:
128-
Eg.
129-
- `APPLE_CERT_BASE64` = `...`(A long text file)
130-
131-
After these secrets are obtained, all that remains is to set them in Github secrets and then use them in the Github action, eg. in the above Github action usage example, this part:
132-
133-
```
134-
- name: Mac Sign
135-
if: ${{ matrix.platform == 'macos' && env.APPLE_CERT_BASE64 }}
136-
env:
137-
APPLE_CERT_BASE64: ${{ secrets.APPLE_CERT_BASE64 }}
138-
uses: godotengine/godot-cpp-template/.github/actions/sign@main
139-
with:
140-
FRAMEWORK_PATH: bin/macos/macos.framework
141-
APPLE_CERT_BASE64: ${{ secrets.APPLE_CERT_BASE64 }}
142-
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
143-
APPLE_DEV_PASSWORD: ${{ secrets.APPLE_DEV_PASSWORD }}
144-
APPLE_DEV_ID: ${{ secrets.APPLE_DEV_ID }}
145-
APPLE_DEV_TEAM_ID: ${{ secrets.APPLE_DEV_TEAM_ID }}
146-
```

SConstruct

+2-7
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,14 @@ if env["target"] in ["editor", "template_debug"]:
5454
print("Not including class reference as we're targeting a pre-4.3 baseline.")
5555

5656
file = "{}{}{}".format(libname, env["suffix"], env["SHLIBSUFFIX"])
57-
filepath = ""
5857

59-
if env["platform"] == "macos" or env["platform"] == "ios":
60-
filepath = "{}.framework/".format(env["platform"])
61-
file = "{}{}".format(libname, env["suffix"])
62-
63-
libraryfile = "bin/{}/{}{}".format(env["platform"], filepath, file)
58+
libraryfile = "bin/{}/{}".format(env["platform"], file)
6459
library = env.SharedLibrary(
6560
libraryfile,
6661
source=sources,
6762
)
6863

69-
copy = env.InstallAs("{}/bin/{}/{}lib{}".format(projectdir, env["platform"], filepath, file), library)
64+
copy = env.InstallAs("{}/bin/{}/lib{}".format(projectdir, env["platform"], file), library)
7065

7166
default_args = [library, copy]
7267
Default(*default_args)

bin/ios/ios.framework/Info.plist

-32
This file was deleted.

0 commit comments

Comments
 (0)