A template repository for 4D component developement.
This repository is configured to enable CI/CD of 4D components using a chain of GitHub Actions.
You may clone it to get started with your own 4D component development on GitHub.
Note: If you rename the project, you should modify env.project_path
in your publish.yml
.
See also test-build-component.yml
, run-tests.yml
.
The build destination path is ${PWD}
. See miyako/4D/.github/actions/build-component
env:
project_path: example/Project/example.4DProject
Whenever you push changes to your main
branch, the default workflow is automatically triggered in patch
mode.
on:
push:
branches:
- main
paths:
- '*/Project/Sources/**/*.4dm'
- '*/Project/Sources/*/*.4DForm'
- '*/Project/Sources/*.4DCatalog'
- '*/Project/Resources/**'
You can manually dispatch the default workflow for any branch, in either patch
minor
major
mode.
The workflow does the following:
- The project is compiled on a GitHub hosted runner (
macos-latest
) usingtool4d
. - The project is built as a component for ARM/Apple Silicon and AMD/Intel processors.
- The component is signed with your Apple Developer ID Application certificate.
- The component is submitted to Apple for notarisation.
- The component is published under Releases (.zip and .dmg format).
The repository must have package.json
file at the root level.
Note: The format is obviously inspired by, but not necessarily relate to, npm
. In future versions, 4D may roll out its own way of managing dependencies.
In addition to arbitrary meta properties, you should provide the following build parameters:
Path | Type | Description |
---|---|---|
version | Text | semantic versioning 2.0.0 |
tool.platform | Text | always macos |
tool.branch | Text | default=20.x |
tool.version | Text | default=20.2 |
tool.build | Text | default=latest |
tool.arch | Text | x86 or arm |
Note: Free GitHub hosted macOS runners are running on Intel. If you have a subscription, you can select ARM hosted runners. ARM macOS runners are now available.
- For Feature Releases, the space should be URL encoded, e.g.
20%20Rx
20%20R6
. - The
latest
keyword can't be used while a Feature Release is in beta.
Your Apple Developer credentials should be stored in GitHub Actions secrets.
From Xcode or Keychain, export signing certificate. You will be asked to set a password.
Secret | Description |
---|---|
APPLE_DEVELOPER_ID_CERTIFICATE |
base64 encoded |
APPLE_DEVELOPER_ID_CERTIFICATE_PASSWORD |
password to read the certificate |
KEYCHAIN_PASSWORD |
an arbitrary password (used to access temporary keychain) |
NOTARYTOOL_APPLE_ID |
xcrun notarytool submit parameter |
NOTARYTOOL_TEAM_ID |
xcrun notarytool submit parameter |
NOTARYTOOL_PASSWORD |
xcrun notarytool submit parameter |
CODESIGN_APPLE_ID |
codesign parameter |
The following actions are used by the default workflow. If your repository is not allowed to execute external workflows, clone them.
miyako/4D/.github/actions/package-set-version@v1
- updatepackage.json
miyako/4D/.github/actions/tool4d-get-version@v1
- parsepackage.json
miyako/4D/.github/actions/tool4d-download@v1
- downloadtool4d
miyako/4D/.github/actions/build-component@v1
- build component withtool4d
miyako/4D/.github/actions/deployment-setup-keychain@v1
-setup keychain with secretsmiyako/4D/.github/actions/deployment-codesign-product@v1
- codesign and notarise componentmiyako/4D/.github/actions/deployment-create-zip@v1
- create .zip from .dmgmiyako/4D/.github/actions/deployment-release-assets@v1
- upload .zip and .dmg
In addition, the following GitHub workflow actions are used internally.
Installing an Apple certificate on macOS runners for Xcode development
c.f. https://localazy.com/blog/how-to-automatically-sign-macos-apps-using-github-actions